Jump to content
Nexus Mods Official Soundtrack - The Sounds of Modding ×

triggering a script when the player levels up


TheBlob2

Recommended Posts

This quest script should do it:

int iOldLvl
int iNewLvl

Begin GameMode

    ; For initialization purposes if the variable is empty. The first level is 1.
    If iOldLvl == 0
        Set iOldLvl to 1
    EndIf
    
    ; Retrieve the player's level.
    Set iNewLvl to Player.GetLevel
    
    ; Has the player gained a level since last time?
    If iNewLvl > iOldLvl
        Set iOldLvl to iNewLvl
        MessageBoxEx "You have just levelled up!"
    EndIf
End

It will show a message (note that MessageBoxEx is an NVSE function) everytime you gain a level.

 

If you want only a specific level to trigger an event, you can set iOldLvl to that level, change the condition to iNewLvl == iOldLvl, and put a StopQuest command after the message.

Link to comment
Share on other sites

  On 6/17/2015 at 9:02 PM, TheBlob2 said:

 

  On 6/17/2015 at 6:48 PM, Fallout2AM said:

You probably could make good use of MenuMode 1027

I don't want the script to trigger when the player is in the level up menu, I want to to trigger right after they have allocated their skill points and picked a perk etc, then the script triggers

 

 

You can still make good use of it.

Link to comment
Share on other sites

  On 6/18/2015 at 9:27 AM, luthienanarion said:

Set a flag variable in MenuMode 1027 and check the value of it in GameMode.

 

This is the solution for doing something once the player is out of the menu.

 

I use MenuMode 1027 regularly for tracking player levels and doing stuff with that info.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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