View Single Post
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 04:06 PM
Quote:
Originally Posted by rob View Post
Restricting the contents of the traits menu will work differently, because menus don't behave the same way as choosers. With menus, you are selecting a thing or pick that is referenced but not otherwise modified by the selection process.
We can now look at displaying the menu appropriately. The menu portal definition should look similar to the one below.

<portal
id="menu"
style="menuSmall">
<menu_things
field="acTrtBonus"
component="none"
maxvisible="10"
usepicksfield="acTrtSrc"
candidatefield="acTrtExpr">
</menu_things>
</portal>

This will store the selection in the "acTrtBonus" field and pull the tagexpr and source designation out of the "acTrtExpr" and "acTrtSrc" fields, respectively.

Once that's done, the final step is to actually do something with the selected trait. For this, we'll need an Eval script that retrieves the selection trait and properly confers the +1 bonus to it. This should be added to the Actor component and look similar to the following.

<eval index="1" phase="PreTraits" priority="5000">
<before name="Calc trtFinal"/><![CDATA[
if (field[acTrtBonus].ischosen <> 0) then
field[acTrtBonus].chosen.field[trtBonus].value += 1
endif
]]></eval>

When the user selects one of the available traits, you should now see the appropriate traits be granted the +1 bonus.
rob is offline   #50 Reply With Quote