Quote:
Originally Posted by Mathias
Let's say your advantage cost is stored in the adCost field.
So, this should be close to what you want:
Code:
if (hero.intersect[Start,Start] <> 0) then
field[adCost].value -= 1
endif
|
I have this in my traits.str is this what you mean by advantage cost?
<!-- Attribute component
Each attribute possessed by the actor derives from this component
-->
<component
id="Attribute"
name="Attribute"
autocompset="no">
<!-- Attributes have a minimum trait value of 1 -->
<eval index="1" phase="Initialize" priority="3000"><![CDATA[
field[trtMinimum].value = 1
]]></eval>
<!-- Each attribute point above one that is allocated by the user costs 4CP * the level, per level -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
var traitlevel as number
var traitcost as number
var finalvalue as number
traitlevel = field[trtUser].value
traitcost = 4
finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)
hero.child[resCP].field[resSpent].value += finalvalue - 12
]]></eval>
</component>