cancel
Showing results for 
Search instead for 
Did you mean: 

Linking scripts together?

Zbornox
Retired Support

Is it possible to link 2 (or more) scripts together? If so, how?

5 REPLIES 5

Vulture667
Explorer

You can send events between objects. The listen-to commands are in also useful.

ZachTheArtist
Protege

Ive found it more useful to make variables for multiple triggers and then linking those triggers to 1 script, but I need more information on to what you are trying to accomplish in order to give a more informative answer!

 

Draeguns
Protege

I believe I did this once by listening to an event that had the same name as the event in the other script. Then I sent items in the parameter slots.

teerez83
Protege

I prefer sending events to objects. In practice I've run into issues with events stepping on each other. This is because if event A calls Event B and then Event C but Event B takes 10 seconds and Event C takes 5 seconds. Event B will finish after Event C despite being called first. This also has ramifications with listen/connecting events so I find it best to try and process it sequentially. Script A's final step is to send an event to Object1 which is tied to Script B. Event B's final step is to send an event to Object2 which is tied to Script C

So this is something I have been trying to figure out for a while now. Let's say I have 2 triggers I want to do something when the player enter them how would I tell the script which trigger was entered?