• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Using the Racial Cost elsewhere

SeeleyOne

Well-known member
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).
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
 
If you can make it instead access the procedure called "InfoRace" and access its value of totRPcost, that should also work. But I have not figured out yet how to access a procedure, or to make one run,
 
I came up with a different approach that works. In each of the Racial Properties I add an eval script, Pre-Traits, 5000, Before Calc trtFinal, that has the following code:
Code:
hero.child[resHinder].field[resMax].value -= this.field[raceCstVal].value
While it would be nice for it to just do it all for us, this method is fine. I had to make up a bunch of Racial Properties anyway so it is not that hard to add that code to them.

For example, for the +1 Strength I made one called Strong, and for +2 Strength I did Very Strong. For the lower Strengths I did Weak and Weakling. A few of the other attributes were more fun, like Dummy and Stupid for Smarts.
 
Cool. I Haven't had a chance to look at it close enough to see if I could add anything to the track you were on here, but it looks like you've at least found one method to work it out. Not that I think I could really come up with a better answer for you, mind you, but if I find some time I'll try to take a closer look as well.
 
Another way that could work is a mechanic that is full of a bunch of if statements, one for each Racial Property that you don't want to make remakes of, that applies the cost if that particular Racial Property is in use. Actually, that is not a bad way to do it, just do the above method for new ones if you don't want to update that mechanic.
 
Back
Top