PenUltima Online

It is currently Thu Aug 28, 2008 3:16 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: AttributeIntrinsicMod, AttributeTemporaryMod questions
PostPosted: Sat May 26, 2007 8:47 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1118
Location: Southern Central USA
I feel like a newbie asking this but I have no idea what the difference between these two are.

I might infer that the intrinsic mod is applied from an equipped item and then temp mod maybe by some other means but I'd rather know what their intended use is.

Thanks.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 17, 2007 1:47 am 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 538
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 1:50 am 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1118
Location: Southern Central USA
OK. That sounds reasonable.

After reading my question again I see I had the idea backwards.

Temp is for transient boosts/drops as you said like on items and intrinsic is more of a permanent mod based on something about the character that gives them an extra boost or deficiency such as race or gender.

Thanks OnG.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl