Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds

Notices

Reply
 
Thread Tools Display Modes
Tizzar
Junior Member
 
Join Date: Aug 2012
Posts: 15

Old May 14th, 2017, 09:10 AM
Morning,

What script would you use to set a characters attribute to a certain score? Right now I am using "#traitinplay[attrStr] += 9", so if two different characters use this item they both could have a different strength score. I would like to have the item set the characters strength to a fixed score.

I have skimmed through the forum looking for an example to answer my question but I have had no luck. I am pretty new at the scripting side of hero lab so please go easy on my lack of understanding.

Thanks

Jason.
Tizzar is offline   #1 Reply With Quote
jfrazierjr
Senior Member
 
Join Date: Aug 2013
Posts: 123

Old May 14th, 2017, 10:45 AM
Quote:
Originally Posted by Tizzar View Post
Morning,

What script would you use to set a characters attribute to a certain score? Right now I am using "#traitinplay[attrStr] += 9", so if two different characters use this item they both could have a different strength score. I would like to have the item set the characters strength to a fixed score.

I have skimmed through the forum looking for an example to answer my question but I have had no luck. I am pretty new at the scripting side of hero lab so please go easy on my lack of understanding.

Thanks

Jason.
Just set it to a number using = instead of adding(that's what += does).

This will work in the short term, but once the characters natural dice size is higher, they will be restricted to the lower dice with "=".

In order to fix that, you will have to do an if statement(unless that's exactly what the effect is SUPPOSED to do!)

So the question is, which do you need?

you can check out a few racial abilities such as abTough for example for an example used during character creation for specific races. However, this does not deal with the later case where it's conditional(if thats what you need).

Also, check out Power Armor(a few variations), armPowBat and armPowHvy. while they don't add to Str, you can use the syntax in the if statement, add an additional "if"(or not as you need to) and utilize that.

EDIT: oh, and the number for trait adjustments is one half of the dice size. So 2 = d4, 3 = d6, 4 = d8, etc. So if you want the Stength = d10, you put " = 5". A also, be sure to check out http://forums.wolflair.com/showthread.php?t=33740 as there are many examples of various difference script related things in there.

Last edited by jfrazierjr; May 14th, 2017 at 10:51 AM.
jfrazierjr is offline   #2 Reply With Quote
Tizzar
Junior Member
 
Join Date: Aug 2012
Posts: 15

Old May 14th, 2017, 11:08 AM
Thanks for the help!

Ive changed the script to = instead of += but I am still in the same boat I was before.

One character with a str of d6 wears the item and they net out at 12+6
another character with a str of d8 wears the item and nets out at 12+8

#traitinplay[attrStr] = 10

it seems like it is adding to the attribute instead of overriding the attribute?

Jason
Tizzar is offline   #3 Reply With Quote
jfrazierjr
Senior Member
 
Join Date: Aug 2013
Posts: 123

Old May 14th, 2017, 04:09 PM
Quote:
Originally Posted by Tizzar View Post
Thanks for the help!

Ive changed the script to = instead of += but I am still in the same boat I was before.

One character with a str of d6 wears the item and they net out at 12+6
another character with a str of d8 wears the item and nets out at 12+8

#traitinplay[attrStr] = 10

it seems like it is adding to the attribute instead of overriding the attribute?

Jason
Exactly what is the effect you are implementing? If this is a setting book, could you copy the exact item text? I don't know what traitinplay is for, but it seems like you might want to use traitadjust instead(I can't find any mention of traitinplay on the forum, so umm why are you use that "macro"?)

Are you trying to set the players attrStr to d10?
jfrazierjr is offline   #4 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old May 14th, 2017, 05:58 PM
I don't know that I've ever seen #traitinplay in use, either. I've always just used #traitadjust. It sounds like you've got something like a magic item like a belt of giant strength that is supposed to set a flat strength value when equipped and not add to it? The #traitadjust macro is definitely used for adding die steps, though, not setting a trait to a specific value. I think what you're looking for is just to set the trtFinal field, instead.

Still it may just be a timing issue. What did you set the timing of your script to be? If it's too early it may be that you adjustment is happening before other things that would be further modifying the value. You probably need something in the Traits/5000 range or maybe even later, I think.

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
Tizzar
Junior Member
 
Join Date: Aug 2012
Posts: 15

Old May 15th, 2017, 03:30 PM
I am working on a suit of armor that sets the characters strength to 12+6.

my script goes like this:

if (field[grIsEquip].value <> 0) then
#traitinplay[attrStr] = 10
perform #traitadjust[trTough,+,2,"Power Armor"]
perform #traitroll[skStealth,-,6,"Power Armor"]
perform #traitroll[skNotice,+,2,"Power Armor"]
endif

my script experience is pretty limited (almost none existent) so zarlor I understand what trtFinal is I just don't know how to set it.

I pretty much just cruise through others work and try to apply it to my own, a bit of trial and error. I have done a bit of digging on the forums but haven't had any luck finding the answer to my question. I really appreciate you taking time to help.

Jason
Tizzar is offline   #6 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old May 15th, 2017, 04:59 PM
At the top section of an Eval script you'll find a drop down box and a number. Those tell you script when it should run in relation to all of the other things that are going on, the timing. So if that drop down value is set to something like PreTraits, regardless of the number, then very likely other things that will change the value of a trait will still happen. You may want to try changing what is in that drop-down box to Traits instead o Pre-Traits (or whatever it might be) and see if that works.

Timing is kind of an important concept. Think of it in the way you build a character. First you would set the trait to what you pay for with your attribute points, then you have Edges or Hindrances that might change that value, after that you might have a piece of gear that will do something as well, and finally you might have some effect, like Fatigue or Wounds, that would further modify the value. In some cases if you did those things out of order, say applying a modifier for having a piece of gear before a Hindrance, you could accidentally set the wrong value. That's why you have to keep an eye out for those timings sometimes. So try to see if your timing is the problem first and if not we can try some other things instead.

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
Paragon
Senior Member
 
Join Date: Feb 2010
Posts: 874

Old May 16th, 2017, 07:02 AM
Yeah, timing can bork up a number of things, and unless you understand the structure of the program (which I can't claim to) it can sometimes be a bit of a guessing game.
Paragon is offline   #8 Reply With Quote
Tizzar
Junior Member
 
Join Date: Aug 2012
Posts: 15

Old May 16th, 2017, 04:09 PM
Afternoon,

I have changed the timing up a bit as zarlor suggest but it seems to go a bit sideways. I end up just setting the attribute to d12 no matter what the characters initial strength is and d12 seems to be the max. I am a bit lost now. I have put the script back to the way I had it from the beginning and I am able to get my d12+6 but only for a character with a d6 in strength to begin.
Tizzar is offline   #9 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,549

Old June 4th, 2017, 03:26 PM
If you want to set something to a specific value, try this at Traits/4000 (trtFinal is calculated at Traits/3000). This example sets Strength at d10 if it's lower than d10:

Code:
      doneif (tagis[Equipped.Equipped] = 0)
      if (#trait[attrStr] < 5) then
        var bonus as number
        bonus = 5 - #trait[attrStr]
        #trait[attrStr] += bonus
        endif

_
Currently In Development: Savage Pathfinder
Future Development: SWADE Super Powers Companion, SWADE Fantasy Companion
_
Currently Running: Savage Unity Inc. (homebrew multiverse theme)
Setting Files Supported: Deadlands: Reloaded, Flash Gordon, Gaslight, Hellfrost, Interface Zero 2.0, Seven Worlds, Slipstream, Solomon Kane
Future Setting Files: Savage Judge Dredd
CapedCrusader is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

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 07:28 AM.


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