• 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

Coding an ability that references tSpeedMod

scibat

Well-known member
I am scripting an ability for a monk archetype that allows the monk to gain a Burrow speed equal to his full land speed when activated. I can get everything to work as needed, except that it always uses the Monk's base land speed instead of his full adjusted speed. Here's the code I've been using:

Code:
Final/10000

doneif (tagis[Helper.SpcDisable] <> 0)

field[abValue].value = hero.child[Speed].field[tSpeedMod].value
#value[xBurrow] = field[abValue].value
perform hero.child[xBurrow].assign[Helper.SpcDisable]
perform hero.child[xBurrow].assign[Hide.Special]

if (field[abilActive].value = 0) then
   perform hero.child[xBurrow].assign[Helper.SpcDisable]
   perform hero.child[xBurrow].assign[Hide.Special]
endif

if (field[abilActive].value = 1) then
   perform hero.child[xBurrow].delete[Helper.SpcDisable]
   perform hero.child[xBurrow].delete[Hide.Special]
endif

When activated, it correctly adds Burrowing, but at the base land speed of the monk, and also deactivates correctly. I know tSpeedMod is calculated in Final but perhaps my exact timing is off from where the bonuses are actually added, but that doesn't seem right.
 
Either its your timing or the field. The field is easy to test. So go to Develop->Floating Info Windows->Show Selection Fields. In the new window find "Speed" and check mark it. This then shows you all the "fields" and their current values. Is "tSpeedMod" the one holding the correct speed? If it is then your timing is too early and you will need to increase it.

The issue you may run into is that your running later than the script on the xBurrow. You can do a "new Copy" vs xBurrow to see its timing.

In other thoughts the script you have is not really friendly to other scripts. In example instead of adding to the burrow speed you are setting it. Meaning nothing else could adjust the speed of xBurrow. You are also "setting" the abValue instead of adding to it. Once again this prevents outside scripts from adding to your class feature. What if a feat was suppose to give a +10 bonus to the burrow speed?

Plus you are disabling the xBurrow pick which is over kill as the xBurrow is designed to hide itself unless it has a value.

So here is a slight change to your script that will still allow other scripts (ie adjustments) to affect the xBurrow pick.

Code:
[B][COLOR="Green"]~ If Disabled get out now![/COLOR][/B]
doneif (tagis[Helper.SpcDisable] <> 0)
[B][COLOR="Green"]~ If not active get out now![/COLOR][/B]
doneif (field[abilActive].value <> 1)

[B][COLOR="Green"]~ Add to our abValue[/COLOR][/B]
field[abValue].value += hero.child[Speed].field[tSpeedMod].value

[B][COLOR="Green"]~ Add to our existing Burrow speed[/COLOR][/B]
#value[xBurrow] += field[abValue].value

If you wanted to only have the highest Burrow speed you can use #applybonus[] instead:
Code:
[B][COLOR="Green"]~ If Disabled get out now![/COLOR][/B]
doneif (tagis[Helper.SpcDisable] <> 0)
[B][COLOR="Green"]~ If not active get out now![/COLOR][/B]
doneif (field[abilActive].value <> 1)

[B][COLOR="Green"]~ Add to our abValue[/COLOR][/B]
field[abValue].value += hero.child[Speed].field[tSpeedMod].value

[B][COLOR="Green"]~ Use Burrow's current value or our value which ever is greater[/COLOR][/B]
#applybonus[abValue, hero.child[xBurrow], field[abValue].value]
 
Sorry for the late response, but thank you!

Some very useful info, especially as per xBurrow hiding itself.

Fixing this problem should be cake now, thank you again!
 
I see the issue now.

It *is* the field, but it's odd. This is a Monk archetype and as the monk speed bonus is conditional, the tSpeedMod field isn't a straight number, it is '30 / 50'.

Would I then have to assign that to xBurrow as a field instead of a straight value to make it display properly? Or is that even possible with xBurrow? Would this be better done with adding a reminder in the class ability description to remember to include the monk bonus speed when applicable?
 
Back
Top