• 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

Swim Speed adjustment

AndrewD2

Well-known member
So I'm working on an adjustment that sets a swim speed, seemed simple enough.

Code:
      ~if we're not active, just get out now
      doneif (field[pIsOn].value = 0)

      ~ Set our swim speed
      var speed as number
      speed = hero.child[Speed].field[tSpeedMod].value / 2
      hero.child[xSwim].field[abValue].value = maximum(hero.child[xSwim].field[abValue].value, speed)

But no luck, I've run it at First/10000 (which is where the movement adjustment already runs) and I've run it at Final/14000 which is where a template that adjustments movement runs it.

Any suggestions?

Andrew
 
hero.child[Speed].field[tSpeedMod].value is not calculated until Final actually. I usually use "Final/10000" for it as that is calculated after all other modifications. Using that your code will work.

Your code otherwise seems like it would work but here is a way of reducing the code:
Code:
~if we're not active, just get out now
doneif (field[pIsOn].value = 0)

~ Set our swim speed to half our modified speed
#applybonus[abValue,hero.child[xSwim],hero.child[Speed].field[tSpeedMod].value / 2]

Applybonus macro has the code to set the maximum value of existing or the one we feed it and abValue is just another field just like any bonus is. Just an FYI is all.
 
thanks Shadow, still not sure why it wasn't working for me. Climb worked fine, but swim didn't, now it does cest la vie
 
Back
Top