Event Begin Play or something else?

EDIT: This was Resolved!

What I need to do it to be able to re set a variable based of if a container is still on after a server restart.

My question is does Event Begin Play only trigger when something is place or does it also play again when the server is restarted so that I can reset a variable or a timer? Or if not what is the best event to do this with?

Thanks!

Depending on what you are trying to achieve, you might want to use the Event BPUnstasis if you can… to avoid processing stuff if there is no player in the vicinity of the container.

Well I actually just figured out I can set my Variables to save, so thats one issue, but I still have a couple.

Basically I have a Sap Tap that I have added stuff too and it adds sap every so often to the inventory. The issue is created by the fact that all the sap is technically generated on inventory refresh which is normally only done when accessing the inventory. I need the inventory to refresh frequently enough by itself that it can be seen by an S+ Puller.

I had a timer set to refresh the inventory every 15 seconds which was initiated by Event Begin Play. On Unstasis would work, but do I need to turn of the timer when in stasis again or does it auto turn off?

timers automatically pause when going into stasis. Use the unstasis event to unpause it

Thanks, that is good to know.

Now I have another question if you happen to know. Its Kinda unrelated and if you don’t know ill make another post, but I have a this structure that requires gas by default and I set it up to be able to swap to use electric… and it works. The issue is it only detects nearby junction boxes if the structure is set to accept electric, before the junction box is powered. Anyway to make it refresh the search of a junction box?

Thanks either way.

You could set an overlap on a timer that searches for the junction box. Thats how the poop/egg collection mods do it. Overlap searches for any “droppeditemgenerics” then moves them to the proper inventory

I tried that, I did a sphere overlap filtered to junctionboxes then I casted to the junctiobox and then I tried to get the is powered variable, but it just returned false. It didn’t fail to cast is just doesnt seem to be powered or something like that.

I got it, Someone on the Discord pointed me in the right direction… Thanks for the help!