|
Senior Member
Join Date: Feb 2010
Posts: 874
|
I could probably work this out with trial and error, but thought maybe someone would already know.
Setting up my Thin Men, they have an ability that adds to their Toughness, but does so by giving them a bonus equal to half their Agility die. I'm guessing this is an eval script on the ability, but I couldn't quite figure out how it'd be constructed. |
#1 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
I'd take a look at the derived trait for Toughness itself (trTough), since it is calculated by taking 1/2 Vigor. That should give you some idea of a way to use half of something to use as a modifier to add to something else. I always like to work from something that already does something similar to what I want to try and figure out how to do it. (oh, and sorry I don't know how to code it off the top of my head, thus the hint on what I where I would start to try and figure out how to code it.)
Lenny Zimmermann Metairie, LA, USA Data files authored (please let me know if you see any issues with any of these if you have/use them): Official (In the downloader) 50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome Coming Eventually Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me) Last edited by zarlor; August 21st, 2014 at 11:50 AM. |
#2 |
Senior Member
Join Date: Feb 2010
Posts: 874
|
Hey, its more than I had. And I know what you mean; I was all set to ask how you set up Knowledge skills on creatures when I found an example on the lich and didn't need to.
|
#3 |
Senior Member
Join Date: Feb 2010
Posts: 874
|
Okay, I came up with something for this, but its not working. I suspect the problem is that I'm not correctly identifying what the program is storing the variable as here; I'd assumed it was the word "bonus" in the script, but since this isn't working I'm thinking I'm wrong). Just in case the problem is in the timing or other elements, I'll try to include them all:
Phase: Final Priority: 4000 Code:
var bonus as number bonus = #trait[attrAgi] if (bonus >= 6) then bonus = 6 + round(hero.child[attrAgi].field[trtRoll].value / 2,0,-1) endif perform #traitadjust[trTough,+,bonus,"Half Agility"] So, any ideas here? I could, of course, be completely missing the boat since I kind of kitbashed some of the code from the Toughness calculation itself and the Tough As Nails edge together to get this. The test didn't have any objections, but as it is, it doesn't actually seem to do anything. |
#4 |
Senior Member
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797
|
I could be wrong, but you might play around with the Phase and Priority. If you haven't already.
Last edited by jbearwillis; August 23rd, 2014 at 12:51 PM. |
#5 |
Senior Member
Join Date: Feb 2010
Posts: 874
|
I'll give it a try; I did a bit of fiddling with the Timing, but didn't try anything with those two.
|
#6 |
Senior Member
Join Date: Nov 2009
Posts: 891
|
Try Final 5000, without any of the "Before Calc trtFinal".
Evil wins because good rolls poorly .... or the players are not paying enough attention to the game. |
#7 |
Senior Member
Join Date: Feb 2010
Posts: 874
|
|
#8 |
Senior Member
Join Date: Nov 2009
Posts: 891
|
You only have to have something in the timing box if it matters. Most of them that I have seen were in Initialization, Pre-Traits, and Traits. And even then the "before this" or "after that" are not always used.
In the Final stage it is messing with it after the fact. It would not be used to calculate other things (which Toughness isn't anyway), so timing is not an issue. Evil wins because good rolls poorly .... or the players are not paying enough attention to the game. |
#9 |
Senior Member
Join Date: Feb 2010
Posts: 874
|
I'm guessing the problem is it isn't actually doing anything with "bonus" in my original code, so when it gets to that part it doesn't add anything, even though it didn't object to the syntax. I'm just not sure what the problem is.
|
#10 |
|
|