irswat Posted September 21, 2016 Share Posted September 21, 2016 I need to detect whether a player is waiting, how long they are waiting, what time they start waiting, things of this nature, but I couldn't find an OnWait() event. Does any one know if one exists? Link to comment Share on other sites More sharing options...
irswat Posted September 21, 2016 Author Share Posted September 21, 2016 (edited) is there a wait State? Edited September 21, 2016 by irswat Link to comment Share on other sites More sharing options...
irswat Posted September 21, 2016 Author Share Posted September 21, 2016 I have a check in a script that needs to run 2 times a day. If I player waits more than 13 hours the logic that triggers this check fails and I need to handle the exception in this case. I'm thinking I could do something like if it's daytime, and the check from the night before hasn't happened then call the check from the night before. However this may fail if someone has one of those mods that allows for people to wait up to 31 days. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 21, 2016 Share Posted September 21, 2016 Option 1 - Check if the menu is currently open UI.IsMenuOpen("Sleep/Wait Menu")http://www.creationkit.com/index.php?title=IsMenuOpen_-_UIhttp://www.creationkit.com/index.php?title=UI_Script#Valid_Menu_Names Option 2 - Catch when the menu opens and closes Event OnInit() RegisterForMenu("Sleep/Wait Menu") EndEvent Event OnMenuOpen(String MenuName) If MenuName == "Sleep/Wait Menu" ;do something EndIf EndEvent Event OnMenuClose(String MenuName) If MenuName == "Sleep/Wait Menu" ;do something EndIf EndEventhttp://www.creationkit.com/index.php?title=OnMenuOpen_-_Formhttp://www.creationkit.com/index.php?title=OnMenuClose_-_Formhttp://www.creationkit.com/index.php?title=RegisterForMenu_-_Form Link to comment Share on other sites More sharing options...
lofgren Posted September 21, 2016 Share Posted September 21, 2016 Or when your check runs, just check to see if it has been more than 12 hours since it last ran. Link to comment Share on other sites More sharing options...
irswat Posted September 21, 2016 Author Share Posted September 21, 2016 (edited) I came up with a similar solution. I created two boolean flags NightTimeCheck and DayTimeCheck. If the check is true before the function that resets the flag is called then that means the exception has been detected...I think.EDIT: That worked. Edited September 21, 2016 by irswat Link to comment Share on other sites More sharing options...
Recommended Posts