TheBlob2 Posted June 17, 2015 Posted June 17, 2015 I've been trying to figure out how to trigger a certain function but only after the player has leveled up but there doesn't seem to be any obvious ways of doing so
Ladez Posted June 17, 2015 Posted June 17, 2015 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 EndIt 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.
Fallout2AM Posted June 17, 2015 Posted June 17, 2015 You probably could make good use of MenuMode 1027
TheBlob2 Posted June 17, 2015 Author Posted June 17, 2015 On 6/17/2015 at 6:48 PM, Fallout2AM said: You probably could make good use of MenuMode 1027I 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
Fallout2AM Posted June 17, 2015 Posted June 17, 2015 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 1027I 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.
luthienanarion Posted June 18, 2015 Posted June 18, 2015 Set a flag variable in MenuMode 1027 and check the value of it in GameMode.
llamaRCA Posted June 18, 2015 Posted June 18, 2015 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.
Recommended Posts