Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old September 19th, 2017, 06:52 PM
I am having an issue with a user field not changing bound minimum/maximum. I have:
Quote:
<!-- User value assigned for the ability -->
<field
id="abiUser"
name="User Value"
type="user"
usedelta="yes"
maxfinal="50">
<!-- Bound the user value to the limits established for the ability -->
<bound phase="Initialize" priority="5500" name="Bound abiUser">
<before name="Calc abiFinal"/><![CDATA[
@minimum = field[abiMinimum].value
@maximum = field[abiMaximum].value - field[abiBonus].value
]]></bound>

<!-- Disc/Dept have a minimum ability value of 0 -->
<eval index="2" phase="Initialize" priority="5000"><![CDATA[

if (hero.tagis[CharType.typShip] = 1) then
field[abiMinimum].value = 0
elseif (hero.tagis[CharType.typShip] = 0) then
field[abiMinimum].value = 1
endif

field[abiMaximum].value = 5
]]></eval>
The CharType tag is set from the configure hero form. The initial CharType is not typShip. This starts the Discipline component minimums (from eval script 2) at 1. If I then do change it to the typShip, the minimum becomes 0, but abiUser remains 1.

Am I missing a timing or trick to have the abiUser recalculate when CharType tag changes? (a change script on the menu_thing component?)

Is there a way to treat a change in this tag as a new portfolio with the initial CharType.typShip tag?

Some other possibility?

Thanks!
TC
TCArknight is offline   #1 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 19th, 2017, 07:33 PM
I was just having a similar issue with Chill. I played around with the timing. Ultimately, I set the bound and eval priorities to the same value. In your case, try setting them both to 5000.

That's what did it for me, anyway. I'm still learning, though. I'm not an expert. I can't guarantee that I did it right. I can only offer that it works as intended.
EightBitz is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old September 19th, 2017, 08:08 PM
If the minimum for a normal character is 2, then as soon as you create a new character, the value of this field, which has a default of 0 will be set to the minimum of 2. Then, HL notices the change in character type, which triggers a recalculation of the minimum, but there's no need to change the value - the current value of 2 is in-between the minimum of 1 and the maximum of 5.

Check the incrementer on abiUser - does it now let you decrease the value?
Mathias is offline   #3 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old September 20th, 2017, 12:16 PM
It does, but I was trying to find a way to reset it to the minimum without user having to do that.

i guess the simplest way is going to be to set all to minimum of 0, and if it's not typShip add 1 to the abiBonus...
TCArknight is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old September 20th, 2017, 12:33 PM
Is the CharType a pick that's selected in a table, or just a drop-down?

If it's a pick, you can add a creation script to its component that resets that field when a new one (namely the ship type) is selected:

Code:
<creation><![CDATA[
  perform hero.child[whatever].field[abiUser].reset
  ]]></creation>
Mathias is offline   #5 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old September 20th, 2017, 12:38 PM
Thanks Mathias!

I will give that a try when I get home. I didn't know there was such an option.
TCArknight is offline   #6 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old September 23rd, 2017, 09:09 AM
for some reason, this isn't working.

Quote:
<component
id="CharType"
name="Character Type">

<!-- Each type needs its own identity tag that is forwarded to the hero
by the actor pick when selected -->
<identity group="CharType"/>

<creation><![CDATA[
perform hero.child[discdept01].field[abiUser].reset
]]></creation>

</component>
Thoughts?
TCArknight is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old September 28th, 2017, 01:56 PM
You're using a chooser portal to select the CharType picks?
Mathias is offline   #8 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old October 11th, 2017, 01:58 PM
Sorry for taking so long, but I thought I had this figured out. Apparently not.

The CharType pick is being selected through a menu:
Quote:
<portal
id="menutype"
style="menuNormal">
<menu_things
component="CharType"
field="acType">
</menu_things>
</portal>
If I have the reset in a script on the actor early (initialize/3000), then it works when changing back and forth between CharType's:
Quote:
foreach pick in hero where "component.AttrSys"
if (hero.tagis[CharType.typShip] = 1) then
perform eachpick.assign[AttrType.System]
else
perform eachpick.assign[AttrType.Attribute]
endif

~perform eachpick.field[abiUser].reset
nexteach
With this though, it seems like it constantly resets, and doesn't allow incrementing of abiUser.

Last edited by TCArknight; October 11th, 2017 at 02:12 PM.
TCArknight is offline   #9 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old October 16th, 2017, 05:27 AM
Anyone? Any thoughts on this?

It seems like if the pick is added through a menu, it doesn’t trigger a creation script.
TCArknight is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:44 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.