I use TemporaryMods for applying skill or stat related temporary changes - eg an equipped item that gives a skill boost, or a spell that boosts your strength.
GetAttributeTemporaryMod( character, attrname );
and
SetAttributeTemporaryMod( character, attrname, tempmod_tenths );
They work as you'd expect them to except that they are 10 times their actual value. eg This allows you to have a 9.6 boost but still keep it as an integer because you store it as 96.
I use GetAttributeIntrinsicMod for my race related changes.
Eg a human has a permanent +10 applied to their swordsmanship skill. (All my various races have skill bonuses and penalties.)
Like TempMods, IntrinsicMods are also used in 10ths meaning you always set a value 10 times the real value you want.
Because you don't have a SetAttributeIntrinsicMod you might wonder how to use it. Well, it's always a value you calculate so it's easy enough to just retrieve it.
First of all edit your attributes.cfg file. I will just show Swordsmanship, but every stat or skill you want to have an intrinsicmod needs to be modified in the same way:
Code:
Attribute Alchemy
{
desc Swordsmanship
script
GetIntrinsicModFunction intrinsicmods:IntrinModSwordsmanship
}
In a script called intrinsicmods.src I have the following:
Code:
program IntrinMods()
return 1;
endprogram
exported function IntrinModSwordsmanship(character)
return GetAttIntrinsicMod(character, "Swordsmanship");
endfunction
There is one of those exported functions for each and every stat and skill you want to have an intrinsicmod for.
I have a common function that actually calculates the intrinsic mod amount. In it's simplest form it is:
Code:
function GetAttIntrinsicMod(character, attributeid)
var race := GetObjProperty(character, "racename");
case ( race )
"Human":
case ( attributeid )
"Swordsmanship": change := 10;
default: change := 0;
endcase
endcase
return change * 10;
endfunction
If you have these in place, then GetAttributeIntrinsicMod on a human mobile for the swordsmanship skill will return 100.
GetAttributeBaseValue + GetAttributeTemporaryMod + GetAttributeIntrinsicMod = GetAttribute
They are all 10 times their real value except for GetAttribute which automatically adds all the others together, divides it by 10 and turns it into an integer.
Eg for a human swordsman with skill 98.4 with an intrinsic mod of 10 and a weapon with a tempmod of 8:
GetAttributeBaseValue == 984
GetAttributeTemporaryMod == 80
GetAttributeIntrinsicMod == 100
GetAttribute == 116
I also use the GetAttributeIntrinsicMod to set the stat or skill cap higher, thus giving that race an effective boost all the way.
In scripts skill checking you can want to know several things:
GetAttributeBaseValue - no problem, just remember it's 10 times the real value.
GetAttribute - the total and effective skill of the player with all buffs and bonuses applied automatically.
Sometimes, however I want to know the GetAttributeBaseValue PLUS the GetAttributeIntrinsicMod (eg when there is a minimum skill required and you don't want them to cheat with buffs). I wrote a short function to handle this:
Code:
function GetBaseAttributeRaceMod(character, attributeid)
return GetAttributeBaseValue(character, attributeid) + GetAttributeIntrinsicMod(character, attributeid);
endfunction