Jump to content

Trigger()


Recommended Posts

Hi, 

In ConduitDispenser.cs, Dispense(), there is line that looks like this:

                Trigger(-1697596308, primaryElement.gameObject);

I've been able to trace this to the event system, and in the GameHashes.cs file found the OnStorageChange event.

I get the idea of eventing, but what is the game using such events for? For example, if I were writing my own custom dispenser, and were to leave the Trigger out, what would the consequence be?

Thank you.

 

Link to comment
Share on other sites

If you leave out the trigger, it will simply not execute code which is subscribed to that event. What that means in practise depends on the object and what components work with it.

This is speculative, but I could imagine that not updating OnStorageChange breaks the resource list or has weird effects on the Dupes e.g. transporting material to it even though it's full. If you want to be sure, you would need to reverse engineer the events used in your case. Although I cannot see why you would want to. Just use the trigger.

Link to comment
Share on other sites

Archived

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

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...