SetAttributeBaseValue - append attribute

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 098.

Moderator: POL Developer

Post Reply
Havoc
Neophyte Poster
Posts: 34
Joined: Mon Feb 13, 2006 1:35 pm

SetAttributeBaseValue - append attribute

Post by Havoc » Fri Sep 18, 2009 5:44 pm

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!

Yukiko
Distro Developer
Posts: 2736
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SetAttributeBaseValue - append attribute

Post by Yukiko » Sat Sep 19, 2009 12:08 am

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.

Havoc
Neophyte Poster
Posts: 34
Joined: Mon Feb 13, 2006 1:35 pm

Re: SetAttributeBaseValue - append attribute

Post by Havoc » Sat Sep 19, 2009 12:29 am

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.

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: SetAttributeBaseValue - append attribute

Post by Pierce » Sat Sep 19, 2009 4:08 am

There is one bracket to much ;)

Code: Select all

SetAttributeBaseValue(character, "strength", GetAttributeBaseValue(character, "strength") + 500); 

Yukiko
Distro Developer
Posts: 2736
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SetAttributeBaseValue - append attribute

Post by Yukiko » Sat Sep 19, 2009 4:29 am

That'll teach me to script while under the influence.
Sorry Havoc!

Havoc
Neophyte Poster
Posts: 34
Joined: Mon Feb 13, 2006 1:35 pm

Re: SetAttributeBaseValue - append attribute

Post by Havoc » Sat Sep 19, 2009 7:49 am

Thanks a ton! I honestly think I should have noticed that, but thanks for the help Pierce and Yukiko!

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: SetAttributeBaseValue - append attribute

Post by Pierce » Sun Sep 20, 2009 1:30 am

Yukiko wrote:That'll teach me to script while under the influence.
Under influence of what? :D :D :D
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 :D
The last 19 % is a semicolon missing. The rest is more specific ;)

Yukiko
Distro Developer
Posts: 2736
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SetAttributeBaseValue - append attribute

Post by Yukiko » Sun Sep 20, 2009 8:22 am

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*

Post Reply