Page 1 of 1
SetAttributeBaseValue - append attribute
Posted: Fri Sep 18, 2009 5:44 pm
by Havoc
Hey there,
How can I make SetAttributeBaseValue append to a given attribute instead of a base value?
I.e, If I was trying to make a stone that would add 50 Strength to a character who already has 25 Strength to make 75 strength?
I realize I can do this with the SetAttributeTemporaryMod, but I need to have it applied to the base value.
Thanks in advance!
Re: SetAttributeBaseValue - append attribute
Posted: Sat Sep 19, 2009 12:08 am
by Yukiko
Wouldn't SetAttributeBaseValue(who, ATTRIBUTE, GetAttributeBaseValue(who, ATTRIBUTE) + Amount_to_increase)); work? Just remember that Amount_to_Increase is in tenths. So to increase by 50 whole points Amount_to_Increase would be set to 500.
Re: SetAttributeBaseValue - append attribute
Posted: Sat Sep 19, 2009 12:29 am
by Havoc
function HumanRaceSelect (character)
SetAttributeBaseValue(character, "strength", GetAttributeBaseValue(character, "strength") + 500));
//RecalcVitals(character);
//SendSysMessage(character, "You are now a Human. Go forth, and find your way, but be careful - not all dangers can be faced alone.");
return 1;
endfunction
Here's a snippet of the code I'm working with, as you can see it's fairly basic; ecompile gives me an error in the function, and it won't compile.
Re: SetAttributeBaseValue - append attribute
Posted: Sat Sep 19, 2009 4:08 am
by Pierce
There is one bracket to much
Code: Select all
SetAttributeBaseValue(character, "strength", GetAttributeBaseValue(character, "strength") + 500);
Re: SetAttributeBaseValue - append attribute
Posted: Sat Sep 19, 2009 4:29 am
by Yukiko
That'll teach me to script while under the influence.
Sorry Havoc!
Re: SetAttributeBaseValue - append attribute
Posted: Sat Sep 19, 2009 7:49 am
by Havoc
Thanks a ton! I honestly think I should have noticed that, but thanks for the help Pierce and Yukiko!
Re: SetAttributeBaseValue - append attribute
Posted: Sun Sep 20, 2009 1:30 am
by Pierce
Yukiko wrote:That'll teach me to script while under the influence.
Under influence of what?
Havoc wrote:Thanks a ton! I honestly think I should have noticed that
Just from my own experience: If the ecompiler gives you a cryptic error, its 80 % of the time a bracket. One missing or one too much
The last 19 % is a semicolon missing. The rest is more specific

Re: SetAttributeBaseValue - append attribute
Posted: Sun Sep 20, 2009 8:22 am
by Yukiko
Under influence of what?
Something called Lone Star Beer.
It's an inexpensive brew they have here in Texas. Just think of it as the real Alamo Beer you see Hank Hill drinking on King of the Hill. I had way too many the otheright.
*chuckles*
Oh and just because I'm feeling ornery, them thar things is called "parenthesis" not braces.
*grins*