Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
UmbralHero
Junior Member
 
Join Date: May 2013
Location: Planet Boulder
Posts: 5

Old May 5th, 2013, 10:10 AM
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
UmbralHero is offline   #1 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old May 7th, 2013, 09:04 AM
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
All of the stuff that starts with a "~" is just there for us to read and explain what's going on, the program completely ignores it. So looking at only the actual code we'd need to change a few things. I think this is probably something about what you're looking to do:

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"]
Finally you should make sure to change the "Base Value" field from "2" to "-2" to fit your needs and set the Display sequence to something appropriate (usually 5 to put it at the bottom of the list of traits).

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)
zarlor is offline   #2 Reply With Quote
UmbralHero
Junior Member
 
Join Date: May 2013
Location: Planet Boulder
Posts: 5

Old May 7th, 2013, 11:17 AM
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.
UmbralHero is offline   #3 Reply With Quote
UmbralHero
Junior Member
 
Join Date: May 2013
Location: Planet Boulder
Posts: 5

Old May 7th, 2013, 11:41 AM
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.
UmbralHero is offline   #4 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old May 7th, 2013, 11:47 AM
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)
zarlor is offline   #5 Reply With Quote
UmbralHero
Junior Member
 
Join Date: May 2013
Location: Planet Boulder
Posts: 5

Old May 9th, 2013, 07:27 AM
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.
UmbralHero is offline   #6 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old May 9th, 2013, 08:08 AM
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)
zarlor is offline   #7 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old May 13th, 2013, 05:50 AM
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)
zarlor is offline   #8 Reply With Quote
UmbralHero
Junior Member
 
Join Date: May 2013
Location: Planet Boulder
Posts: 5

Old May 15th, 2013, 04:36 PM
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
UmbralHero is offline   #9 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,556

Old May 15th, 2013, 08:43 PM
And every programmer reading that says to themselves "Wow, and that NEVER happens to me!"
CapedCrusader is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:28 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.