I am trying to make a mechanic that will apply its cost towards the Rewards from Hindrances. This way a more powerful race can be purchased at character creation (if you take sufficient Hindrances, that is).
This is the code that I have come up with so far. Either my code is not good enough or the timing is off. Either one could be the problem (maybe both).
This is the code that I have come up with so far. Either my code is not good enough or the timing is off. Either one could be the problem (maybe both).
Code:
~declare variables that are used to communicate with our caller
var totRPcost as number
var existRP as number
totRPcost = 0
existRP = 0
foreach bootstrap in this where "RacialProp.?"
existRP += 1
nexteach
if (existRP > 0) then
foreach bootstrap in this where "RacialProp.?"
totRPcost += eachthing.field[raceCstVal].value
nexteach
endif
hero.child[resHinder].field[resMax].value -= totRPcost