• 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

If statements and Racial Custom Specials

AndrewD2

Well-known member
I'll start off with my code:

Final/10000
Code:
      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)
 
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)
     
debug "Before if statement"     
if (#hasability[rcSanPulSo] <> 0) then
 debug "In if statement"
      field[abValue].value += 10

      field[livename].text =  "Fast Movement: +" & field[abValue].value
      field[abSumm].text = "+" & field[abValue].value & " feet to speed, unless heavily loaded."

      ~ If we fail the test for being speedy, get out
      if (hero.tagis[Encumbered.Light] + hero.tagis[Encumbered.Medium] = 0) then
        perform assign[Helper.SpcDisable]
        done
        endif

      ~ We passed, so add to our base speed.
      hero.child[Speed].field[tSpeed].value += field[abValue].value
endif

debug "Out of if statement"

This class ability improves on a racial ability the character options from an R Cust Special choice at creation. So I created an if statement that checks for the special. I have the special chosen, but I still don't enter the if statement when the condition is true. I figured #hasability would be the right macro, but maybe I'm going to have to use something else?

Any ideas guys?
Andrew
 
HasAbility and HasFeat tags are placed VERY late in timing and are useless for anything that is not just running a Valid/Pre-Req scripts. Note that is what #hasfeat[] and #hasability[] are actually checking is tags on the hero.

To see if something is live use childlives instead:
Code:
~ If Racial Custom is live on hero then proceed 
if (hero.childlives[rcSanPulSo] <> 0) then

The above does not worry about Tags on the hero and instead checks to see if the Thing is a live Pick on the hero.
 
Code:
      field[livename].text =  "Fast Movement: +" & field[abValue].value
      field[abSumm].text = "+" & field[abValue].value & " feet to speed, unless heavily loaded."
For the above to make sure its always correct I would not put hard-coded "+" signs instead use the signed() function to make it always be correct just encase later it applies a negative you would get +-2 instead of -2.
Code:
field[livename].text =  "Fast Movement: " & signed(field[abValue].value)
field[abSumm].text = signed(field[abValue].value) & " feet to speed, unless heavily loaded."
 
Thanks for the info Shadow, as for the plus signs, it was just copied straight out of the Barbarian fast movement, but I will make that change. Thanks again.
 
New problem with this special. One of these if statements grant blindesense but I'm not sure i can do a bootstrap condition based on having a selection made (I'm pretty sure that happens too late). Is there a way to get this on? I'm thinking I might be able to hide it if it doesn't match the right clan chosen, but on the other hand I think that would hide it even if they got it from another source. Any ideas?
 
Blindsense like allot of Things are coded to Hide themselves if they have no value. So you can safely bootstrap the Blindsense without a condition and only if you increase the abValue above zero should it show up.
 
Back
Top