RedxYeti Posted November 24, 2021 Share Posted November 24, 2021 Event OnUpdate() Bool bIsInventoryMenuOpen = UI.IsMenuOpen("Crafting Menu") If bIsInventoryMenuOpen == True RegisterForSingleUpdate(2) Game.AdvanceSkill("alchemy", 18) Else UnregisterForUpdate() EndIf EndEvent So im using this to add skills while the player is at a crafting table. The problem is, after an extended amount of time, say 5-10 minutes, the backlog of updates comes flooding in to the point where its like 3-4 updates a second. is there a better way to make the updates run at a more consistent time? I dont want to use game time because everyone uses a different timescale. any ideas? Link to comment Share on other sites More sharing options...
dylbill Posted November 25, 2021 Share Posted November 25, 2021 I've also noticed that the OnUpdate event doesn't work reliably while in menus. Instead, I would try a while loop: Function AdvanceSkillInMenu() While UI.IsMenuOpen("Crafting Menu") Game.AdvanceSkill("alchemy", 18) Utility.WaitMenuMode(2) EndWhile EndFunction Link to comment Share on other sites More sharing options...
RedxYeti Posted November 26, 2021 Author Share Posted November 26, 2021 I've also noticed that the OnUpdate event doesn't work reliably while in menus. Instead, I would try a while loop: Function AdvanceSkillInMenu() While UI.IsMenuOpen("Crafting Menu") Game.AdvanceSkill("alchemy", 18) Utility.WaitMenuMode(2) EndWhile EndFunction Thank you for your reply, ive been using a while since i read your message but it was still stacking. I finally figured out, the game must reactivate the crafting tables after a certain amount of time to see if the player is at them. I found out with a message box and sure enough, after a set amount of time the message box would show up. Event OnActivate(ObjectReference ReferenceAlias) if (PlayerRef.GetSitState() != 3) debug.messagebox("player is sitting already") else Registerforsingleupdate(1) endif endeventthanks for your help im using a while and the menu wait as well :thumbsup: sorry it took so long to reply :tongue: I looked for so long for a reason my code was running twice, I was certain something in my mod was activating it twice. now i can finally remove the onupdate. Link to comment Share on other sites More sharing options...
dylbill Posted November 26, 2021 Share Posted November 26, 2021 Gotcha. No worries, glad you got it working. Link to comment Share on other sites More sharing options...
Recommended Posts