![]() |
Junior Member
Join Date: May 2013
Location: Planet Boulder
Posts: 5
|
Hello world. I'm new to the forums! Now, I've been using the character generator for SW for a long time, and I'm just starting to add my own derived statistic. I can get it to show up, but I can't figure out how to actually DERIVE it from something. If it matters, I'm trying to get a statistic that equals half of the Spirit die -2 for a Mana statistic. Any suggestions???
~Umbra |
![]() |
![]() |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
Sorry to take so long to respond. You just need to set up an Eval Script to handle it. I find looking at examples, but seeing what's going on in other data files, to be helpful.
So in this case, for example, you could do something on the Derived Trait tab and select "New (Copy)" and maybe pick Toughness from the list (2+Half Vigor, so close to what you want with just a different attribute). Then modify the text and name and all to match up what you want it to say for Mana. Then look at the Eval Script that is set on it. It's set to run at Traits/4000 and looks like: Code:
~toughness is 2 plus half the character's Vigor, but we track attributes at ~the half value (2-6), so we add Vigor directly; we get the Vigor by using ~the "#trait" macro ~Note: We must also handle an overage beyond d12 on a +1 per 2 full points basis. ~Note: We ADD the amount in case other effects have already applied adjustments. var bonus as number bonus = #trait[attrVig] if (bonus >= 6) then bonus = 6 + round(hero.child[attrVig].field[trtRoll].value / 2,0,-1) endif perform field[trtBonus].modify[+,bonus,"Half Vigor"] ~equipped armor should add to the Toughness, so we add that from the armor Code:
var bonus as number bonus = #trait[attrSpi] if (bonus >= 6) then bonus = 6 + round(hero.child[attrVig].field[trtRoll].value / 2,0,-1) endif perform field[trtBonus].modify[+,bonus,"Half Spirit"] Hope that helps and welcome to the forums! 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) |
![]() |
![]() |
Junior Member
Join Date: May 2013
Location: Planet Boulder
Posts: 5
|
Thanks, thanks, and thanks! I copied the Toughness eval and it's working perfectly. My eternal gratitude, zarlor.
~Umbra ~sent prematurely... Last edited by UmbralHero; May 9th, 2013 at 07:28 AM. |
![]() |
![]() |
Junior Member
Join Date: May 2013
Location: Planet Boulder
Posts: 5
|
I have it all down, but it still isn't moving from zero. I changed the Base Value to -2 and the display sequence is 5, but it still comes up with zilch. I'll keep messing around with it but I think the code may have an issue with setting a non-integer as a base value.
Last edited by UmbralHero; May 7th, 2013 at 11:43 AM. |
![]() |
![]() |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
Have you tried it with a base value of 0 (or blank)? If that works then you can probably just set that bonus line to something like
bonus = #trait[attrSpi] - 2 I think that might work. 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) |
![]() |
![]() |
Junior Member
Join Date: May 2013
Location: Planet Boulder
Posts: 5
|
Still not getting anything. But I tried making a duplicate of Toughness and calling it something else and it didn't even show up, so I think it might be conflicting with the original code, although I can't tell where. I tried to change the sequence but unless it's a multiple of 1000 it gets angry so I'm not sure what to do. I might just make a custom character sheet and do it manually, but that would really be a pain.
|
![]() |
![]() |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
Works fine for me... Let's see... you copied Toughness, then changed the name to Mana, UniqueID to something unique (say trHRMana), clicked on Eval Scripts, either pasted over what is there with my code above or just replaced every occurrence of attrVig with attrSpi, then scrolled down and deleted the second script that's there (it deals with armor, you won't need it), set an appropriate Short Name, Abbreviation, Base Value of -2, and changed Display sequence to 5?
Did you set a Source? If not it should show up everywhere just fine, if you did then you also need to make sure you character is set to use that source (Character -> Configure Hero). I'm also assuming you either compiled your data file or at least just saved it an restarted Hero Lab. Would that be right? 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) |
![]() |
![]() |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
UmbralHero,
Where you ever able to get this to work? I does work for me, even with a -2 base. I can probably send you something like this in a .user file if you're still having problems with 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) |
![]() |
![]() |
Junior Member
Join Date: May 2013
Location: Planet Boulder
Posts: 5
|
Hey I've been messing around with stuff and I think I originally typed it as AttrSip instead of AttrSpi. I recopied the Toughness block and it's working just fine now. Thanks for your help
![]() "There's a difference between Heroic and Stupid. Still haven't quite figured it out yet." ~Anton |
![]() |
![]() |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,556
|
And every programmer reading that says to themselves "Wow, and that NEVER happens to me!"
|
![]() |
![]() |
![]() |
|
|