Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

Option 1 - Check if the menu is currently open

UI.IsMenuOpen("Sleep/Wait Menu")

http://www.creationkit.com/index.php?title=IsMenuOpen_-_UI

http://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
EndEvent
Posted (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 by irswat
  • Recently Browsing   0 members

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