Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Savage Worlds (http://forums.wolflair.com/forumdisplay.php?f=59)
-   -   Script Question (http://forums.wolflair.com/showthread.php?t=58421)

Tizzar May 14th, 2017 09:10 AM

Script Question
 
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.

jfrazierjr May 14th, 2017 10:45 AM

Quote:

Originally Posted by Tizzar (Post 249904)
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.

Tizzar 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

jfrazierjr May 14th, 2017 04:09 PM

Quote:

Originally Posted by Tizzar (Post 249912)
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?

zarlor 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.

Tizzar 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

zarlor 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.

Paragon 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.

Tizzar 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.

CapedCrusader 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



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

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