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!
SetAttributeBaseValue - append attribute
Moderator: POL Developer
Re: SetAttributeBaseValue - append attribute
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
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.
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
There is one bracket to much
Code: Select all
SetAttributeBaseValue(character, "strength", GetAttributeBaseValue(character, "strength") + 500);
Re: SetAttributeBaseValue - append attribute
That'll teach me to script while under the influence.
Sorry Havoc!
Sorry Havoc!
Re: SetAttributeBaseValue - append attribute
Thanks a ton! I honestly think I should have noticed that, but thanks for the help Pierce and Yukiko!
Re: SetAttributeBaseValue - append attribute
Under influence of what?Yukiko wrote:That'll teach me to script while under the influence.
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 muchHavoc wrote:Thanks a ton! I honestly think I should have noticed that
The last 19 % is a semicolon missing. The rest is more specific
Re: SetAttributeBaseValue - append attribute
Something called Lone Star Beer.Under influence of what?
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*