Member
Join Date: Aug 2009
Posts: 38
|
Ok, I have no problems with most of this, but I am adding a power we have used in our games for some time now and having a slight problem with figuring out the eval script.
The power is: Fleet Cost: 1, 2.5 Each level works similar to Satyr's legs/celerity. Like Satyr's legs and celerity, they stack together. It also adds it's level to the bonus per hit Sprinting allows. (Though I think this will just be in the description. Though it would be nice to see it reflected in the pop up description that shows when you hold the mouse over Land Movement. But that's probably not possible) I cannot figure out what the eval script should be. I copied the script for Celerity for starters (which works perfect for level 1), but how do I add the additional movement for a second level? The end result, if both levels are chosen would be a move of 20/50 (or 22.5/56.25 the way HL does the math) and +4m per hit for Sprinting. Thanks for any who help. Jareth |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Why don't you write out what you have so far - the script that works at level 1, and I'll guide you through modifying that.
|
#2 |
Member
Join Date: Aug 2009
Posts: 38
|
Quote:
~if we're disabled, just get out now doneif (activated = 0) perform hero.child[movLand].field[movWalk].modify[*,1.5,""] perform hero.child[movLand].field[movRun].modify[*,1.5,""] Last edited by Jareth Valar; July 31st, 2012 at 01:06 AM. |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
You don't say exactly what multipliers you want at the higher levels. I'm guessing 1.5x for level 1, 2x for level 2 and 2.5x for level 3.
Okay, see in here where the multiplier is? So, instead of making that a fixed number, let's use a variable. We want that variable's value to be 1/2 our rating + 1, right? 1 * 1/2 + 1 = 1.5 for level 1, 2 * 1/2 + 1 = 2 for level 2, etc. The rating of almost anything other than gear (attributes, skills, adept powers, etc.) in the Shadowrun files is stored as field[trtFinal].value, so here's how to use that: Code:
var speedmult as number speedmult = field[trtFinal].value / 2 speedmult = speedmult + 1 Code:
~if we're disabled, just get out now doneif (activated = 0) var speedmult as number speedmult = field[trtFinal].value / 2 + 1 perform hero.child[movLand].field[movWalk].modify[*,speedmult,""] perform hero.child[movLand].field[movRun].modify[*,speedmult,""] The m/hit for sprinting is stored in field[movSprMult] - it defaults to 2 for normal characters. So, if you wanted to multiply that by the same multiplier: Code:
perform hero.child[movLand].field[movSprMult].modify[*,speedmult,""] |
#4 |
Senior Member
|
Wow I actually followed that!! Thanks for dumbing it down nicely Mathias :o)
|
#5 |
Member
Join Date: Aug 2009
Posts: 38
|
First off, thank you for the help.
I am, however, running into a problem with the script now. I am getting an error. I decided to run what you posted as-is first and modify from there. This is how it is entered: ~if we're disabled, just get out now doneif (activated = 0) var speedmult as number speedmult = field[trtFinal].value / 2 + 1 perform hero.child[movLand].field[movWalk].modify[*,speedmult,""] perform hero.child[movLand].field[movRun].modify[*,speedmult,""] perform hero.child[movLand].field[movSprMult].modify[*,speedmult,""] Now the error I get is: Hero lab was forced to stop compilation after the following errors were detected: Syntax error in ‘eval’ script for Thing ‘ad_Fleet’ (Eval Script ‘#1’) on line 9 -> Only fields configured for history tracking can be affected via the ‘modify’ target reference I am assuming that field[movSprMult] isn't configured to be changed. Is this something that I can do, or is it a 'you guys' thing? |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Oops, I didn't think about that. This:
Code:
hero.child[movLand].field[movSprMult].value *= speedmult |
#7 |
Member
Join Date: Aug 2009
Posts: 38
|
Works perfectly, thank you.
|
#8 |
Member
Join Date: Aug 2009
Posts: 38
|
For those that are interested.
Fleet Cost: .75/2.25 Maximum of 2 levels An adept with this power power can move with increased speed. Increase the character's Walking and Running rates (see Movement, p. 138, SR4) by one-half (round down) its current value with each level. Also, Fleet increases the additional movement granted by a running check. Add the level of Fleet to the default 2m per hit when taking Running tests. And here is the final script: ~if we're disabled, just get out now doneif (activated = 0) var speedmult as number speedmult = field[trtFinal].value / 2 + 1 perform hero.child[movLand].field[movWalk].modify[*,speedmult,""] perform hero.child[movLand].field[movRun].modify[*,speedmult,""] hero.child[movLand].field[movSprMult].value += field[trtFinal].value |
#9 |
|
|