Jump to content

RegisterForUpdate Question


bluemarvin

Recommended Posts

OK, so struggling to wrap my head around this.

 

Let's say I have a menu system with two choices.

 

Choosing the first choice causes something to happen every 24 hours game time. So, for the sake of argument, let's say I choose Option 1 from the menu and via RegisterForUpdateGameTime(24) I have the program give the player a health potion every 24 hours via an Event OnUpdateGameTime.

 

Now let's say if I select Option 2 from that menu, it causes me to get a mana potion every 5 hours game time. So again, via RegisterForUpdateGameTime(5) ad Event OnUpdateGameTime.

 

BUT, and here's the kicker.... what happens if someone selects Option 1 and then ALSO Option 2?

 

How does the script know which OnUpdateGameTime applies to which Register?

Link to comment
Share on other sites

I think that both the registrations will keep working, so you'll receive a potion every 5 hours and then 1 every 24.

 

This could cause papyrus slowdowns.

 

One thing you can do is unregister the item/quest/whatever right after the button is pressed.

 

This way, if it's the first time you press the button nothing happens. If you already made a choice, the old one will be erased and replaced with the new registration?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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