Jump to content

How to make a one-time timer script?


Anbeegod

Recommended Posts

Posted

Same as the topic.

 

The script that sets a variable after a certain follower accompanies the player for a day.

Posted

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.

 

Posted

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.

Posted

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.

Archived

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

  • Recently Browsing   0 members

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