Increase a ActorValue by a Float (Skill Leveling)

Post » Fri May 04, 2012 6:08 pm

Hi Community,

my goal is pretty simple: manually increase a skill as if there was a learning or training experience.

The problem is that the methods I used seem to ignore float values.
Of course I can't use integer values because not every using of a skill increases it by 1.

I tried Player.setActorValue and AdvancePCSkill but both will not accept float values.

So how can I get decent skill leveling?

I appreciate any hint.
User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Fri May 04, 2012 9:12 am

Perhaps build a seperate counter to track incremental gains until a full skill point is reached? Example, each joke told is 1/8 of a Speechcraft skillup:

short SkillIncrBegin GameMode    If ;...detect telling jokes        Set SkillIncr to ( SkillIncr + 1 )    EndIf    If Incr >= 8        Player.ModAV Speechcraft 1        Set SkillIncr to 0    EndIfEnd
User avatar
saxon
 
Posts: 3376
Joined: Wed Sep 19, 2007 2:45 am

Post » Fri May 04, 2012 3:39 pm

Look at the OBSE functions with SkillUse in their names. They're the ones dealing with the fractional levels of skill, and use floats.

AdvancePCSkill adds to the number of uses of a skill (e.g casts of a spell, or hits with a weapon) so it's a straight integer counter that's being affected, rather than the level of skill that results from the use. So it's particularly confusing that the SkillLevel functions are all named SkillUse, but that's the way it is.
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Post » Fri May 04, 2012 3:58 pm

Look at the OBSE functions with SkillUse in their names. They're the ones dealing with the fractional levels of skill, and use floats. AdvancePCSkill adds to the number of uses of a skill (e.g casts of a spell, or hits with a weapon) so it's a straight integer counter that's being affected, rather than the level of skill that results from the use. So it's particularly confusing that the SkillLevel functions are all named SkillUse, but that's the way it is.

Hey thanks a lot. I wasn't keen on using OBSE, but anyhow, it is working. :smile:
User avatar
Neliel Kudoh
 
Posts: 3348
Joined: Thu Oct 26, 2006 2:39 am


Return to IV - Oblivion