Jump to content

How to make a one-time timer script?


Anbeegod

Recommended Posts

Hello.

 

Question: do you know how to create scripts, how to attach them to the game objects?

 

If yes, then you just need to use:

RegisterForSingleUpdateGameTime(<number of hours>)

And maybe calculate the "number of hours" depending on the current game time (so if the follower starts to follow at 11PM, it will not register, but if it will start at, let's say, 11 AM, then it will be OK.)

 

 

If no, then it is a little bit more complex, because the way you may want to do it are endless.

Only vanilla followers: just extend the Follower ReferenceAlias in the DialogueFollower quest with a script

Followers from other mods: you need your own quest to keep your followers, and then assign the actual actor inside a custom crated ReferenceAlias that will run the script.

 

Link to comment

If you use RegisterForUpdateGameTime when you don't want it running any longer (once it has triggered what you want) you need to unregister it using UnregisterForUpdateGameTime or it will continue doing whatever you set it to do. If you just want it to do it once and that is all you can use RegisterForSingleUpdateGameTime instead and once it has triggered it will automatically unregister itself.

Link to comment

If you use RegisterForUpdateGameTime when you don't want it running any longer (once it has triggered what you want) you need to unregister it using UnregisterForUpdateGameTime or it will continue doing whatever you set it to do. If you just want it to do it once and that is all you can use RegisterForSingleUpdateGameTime instead and once it has triggered it will automatically unregister itself.

 

Excellent point. My bad.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use