Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
foreach bootstrap is thing-only. You want foreach pick in gizmo if you want to alter the picks once they're on the character.
Although, actually, why use a foreach to find exactly one thing? container.childfound[resLPSpecialty].field[resMax].value += parent.field[lpNumSpec].value Note - that's assuming the pick running this script is a different thing, also bootstrapped alongside resLPSpecialty, within the gizmo - if this is a script on the parent pick, then it would be: gizmo.childfound[resLPSpecialty].field[resMax].value += field[lpNumSpec].value |
#21 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
That did it!
Each skill selected on the lifepath module forwards a LifepathSkill.xxx identity tag to the module itself. In some cases, I need to make sure the same skill hasn't been taken twice in the same module. Is there an example somewhere of pulling all of a particular tag into a string/array and checking for duplicates? Working on - |
#22 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Why not use a denytag test, if you want to be certain that the user doesn't double up skills? Or is this something where you want to allow it, but warn the user if they do it?
|
#23 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
I can actually see situations for both.
I like the idea of allowing, but warning if the same one is taken twice (since the Skills are nonunique). Working on - |
#24 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
And a different question.
The Lifepath Module component has an Index field which looks at a field on the hero to set it's value. Code:
<field id="lpIndex" name="Index" type="derived" defvalue="0"> <calculate phase="Initialize" priority="1000"><![CDATA[ if (tagis[LifepathCat.Tour] <> 0) then herofield[acLPTours].value += 1 @value = herofield[acLPTours].value endif ]]></calculate> </field> Working on - |
#25 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
For the second of these, check out the "orderfield" attribute on components: http://hlkitwiki.wolflair.com/index...._Element_(Data)
(note that the auto link detection messes up on closing parentheses, and I don't have time to get that correct right now). I'll talk about how to build a prereq to count the existing copies of that skill another time - I'm afraid I need to get back to work right now, but I had a quick answer I could link to for how to build the index. |
#26 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
Quote:
Can you think of a reason that a checkbox wouldn't display on a gizmo form? This is my layout and template, which seems like it should work, but no luck... Code:
<template id="lpSpecialtyGain" name="Specialty Gained" compset="LifepathHelper" marginhorz="3" marginvert="2"> <portal id="lblGained" style="lblNormal"> <label> <labeltext><![CDATA[ @text = "Specialty Gained?" ]]></labeltext> </label> </portal> <portal id="gained" style="chkNormal" tiptext="Click to indicate hero gains a Specialty for this tour."> <checkbox field="lpSpecGained"> </checkbox> </portal> <position><![CDATA[ height = portal[gained].height + 5 ~position our tallest portal at the top portal[gained].top = 0 portal[gained].visible = 1 ~position the gained portal on the far right perform portal[gained].alignedge[right,0] ~position the aging portal to the left of the years button portal[lblGained].left = 0 portal[lblGained].width = 150 perform portal[lblGained].alignrel[rtol,gained,-5] ]]></position> </template> <!-- static layout This layout consists of the character's name, race, and status info, which are laid out in a ribbon across the top. --> <layout id="lifepathmodule"> <portalref portal="lpSkill" taborder="10"/> <portalref portal="lpSpecialty" taborder="20"/> <templateref template="lpSpecialtyGain" dynamic="yes" taborder="15"/> <!-- This script sizes and positions the layout and its child visual elements. --> <position><![CDATA[ ~width = 350 perform portal[lpSkill].autoplace perform template[lpSpecialtyGain].autoplace[20] perform portal[lpSpecialty].autoplace[10] height = portal[lpSpecialty].bottom ]]></position> </layout> Working on - |
|
#27 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
I found the issue for the checkbox. I needed the field on the Lifepath component, rather than the helper.
Working on - |
#28 |
|
|