Jump to content

[LE] Script to Prevent Skill XP Gains


jucoking

Recommended Posts

I have created a curse on the player which is supposed to prevent normal skyrim leveling by updating every 2 minutes to reset the skilladvance property. It compiles successfully, but doesn't call in-game:

Scriptname Curse extends activemagiceffect

Actor Property PlayerRef Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
    
    If akTarget == Game.GetPlayer()
        RegisterForUpdate(125.0)
    EndIf

EndEvent

Event OnUpdate()

    PlayerRef.SetActorValue(0x00000619, 0.0)
    PlayerRef.SetActorValue(0x00000619C, 0.0)
    PlayerRef.SetActorValue(0x00000619E, 0.0)
    PlayerRef.SetActorValue(0x00000619F, 0.0)
    PlayerRef.SetActorValue(0x00000622, 0.0)
    PlayerRef.SetActorValue(0x00000624, 0.0)
    PlayerRef.SetActorValue(0x00000627, 0.0)
    UnregisterForUpdate()
    RegisterForUpdate(125.0)
 
EndEvent

Each of the "0x000006---" properties in parentheses are for skilladvance progressions and should be set back to zero onupdate, but this is not occurring in-game testing as I still level up.

 

For instance, the first skilladvance "0x00000619" is onehandedskilladvance and should be reset to "0" every 125 seconds, but I end up gaining levels in the one handed skill line anyway.

Edited by jucoking
Link to comment
Share on other sites

Because those actor values, thus their respective Form IDs have been made inactive by Bethesda. You'll need to use the SKSE functions for skill experience manipulation.

 

Example:

ActorValueInfo AlterationSkillAdv = ActorValueInfo.GetActorValueInfoByName("Alteration")
AlterationSkillAdv.SetSkillExperience(0.0)

Alternatively, if you don't want to use SKSE, you can instead revert skills back to a previous level, if a level up occurs, through the use of SetActorValue, using the same code in your post, but using the skill names instead.

To make it even more accurate, you can use the story manager's OnStoryIncreaseSkill.

 

It'll be kind of clunky, because you'll still get skill up notifications, while it magically(hehe) goes back to the previous level. Unfortunately, character levels cannot be reverted/prevented with this method and setting them back can only occur with SKSE.

Edited by Rasikko
Link to comment
Share on other sites

Hmmm...I was afraid of that. After all I had read on it I still wanted to give it a shot anyway. I was hoping to get rid of the notifications and level up benefits altogether, so it looks like I'll be studying SKSE and how to use it until I nail this down. Much thanks yet again, Rasikko.

Link to comment
Share on other sites

Because those actor values, thus their respective Form IDs have been made inactive by Bethesda. You'll need to use the SKSE functions for skill experience manipulation.

 

Example:

ActorValueInfo AlterationSkillAdv = ActorValueInfo.GetActorValueInfoByName("Alteration")
AlterationSkillAdv.SetSkillExperience(0.0)

This compiled successfully for each skill that I wanted to prevent from leveling up, however it doesn't work in-game. Here is the script *fragment* in question:

Event OnUpdate()

     ActorValueInfo OneHandedSkillAdv = ActorValueInfo.GetActorValueInfoByName("OneHanded")
        OneHandedSkillAdv.SetSkillExperience(0.0)
    ActorValueInfo BlockSkillAdv = ActorValueInfo.GetActorValueInfoByName("Block")
        BlockSkillAdv.SetSkillExperience(0.0)
    ActorValueInfo SneakSkillAdv = ActorValueInfo.GetActorValueInfoByName("Sneak")
        SneakSkillAdv.SetSkillExperience(0.0)
    ActorValueInfo DestructionSkillAdv = ActorValueInfo.GetActorValueInfoByName("Destruction")
        DestructionSkillAdv.SetSkillExperience(0.0)
    ActorValueInfo SpeechcraftSkillAdv = ActorValueInfo.GetActorValueInfoByName("Speechcraft")
        SpeechcraftSkillAdv.SetSkillExperience(0.0)
    ActorValueInfo HeavyArmorSkillAdv = ActorValueInfo.GetActorValueInfoByName("HeavyArmor")
        HeavyArmorSkillAdv.SetSkillExperience(0.0)
    ActorValueInfo LightArmorSkillAdv = ActorValueInfo.GetActorValueInfoByName("LightArmor")
        LightArmorSkillAdv.SetSkillExperience(0.0)
    UnregisterForUpdate()
    RegisterForUpdate(125.0)

EndEvent

Also, when I try to access the script properties after compiling this line, I get errors. The properties window still appears, but all properties are gone (even though they still work in-game). Is this normal, or did I install SKSE incorrectly?

Edited by jucoking
Link to comment
Share on other sites

After some days of trying to manipulate the script I have come up short. If anyone has advice on a script (placed on a magiceffect) that PREVENTS skill xp gains please let me know. I have SKSE function, but for some scripts I cannot access the properties window after compiling.

 

Thanks and Merry Christmas :)

Link to comment
Share on other sites

I got it working now, not sure what the problem was exactly...but I moved a bunch of things around...magic effects, scripts, SKSE files...not sure what it was but everything is working and I can open property windows.

 

Thanks again for this script, Rasikko.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...