Igor Q. 519 Posted December 16, 2019 Would it be possible to add an event listener that says On [Object] added to Storage. Anytime I add an object to the storage, I can cause a trigger to occur. Thanks! @Houp Share this post Link to post Share on other sites
0 Indomitus 388 Posted December 17, 2019 You can use the ON CREATE event for the storage. I just tested with an Entity Storage, and it triggered once for every item I added it to. (I set up an event listener to watch for animals being spawned, and add the storage to each one. In On Create I had it output a simple message each time. I dropped a cube into the scenario, and started adding animals.) Share this post Link to post Share on other sites
0 Igor Q. 519 Posted December 17, 2019 (edited) 4 hours ago, Indomitus said: You can use the ON CREATE event for the storage. I just tested with an Entity Storage, and it triggered once for every item I added it to. (I set up an event listener to watch for animals being spawned, and add the storage to each one. In On Create I had it output a simple message each time. I dropped a cube into the scenario, and started adding animals.) Right, but I want to be able to reference the object being added. For example, every time an object that is added to that storage, I want to set the values (for that object) to have X variable, Y variable and Z variable. It's similar to how we have player roles now with auto equipping items. Edited December 17, 2019 by Igor Q. Share this post Link to post Share on other sites
0 Indomitus 388 Posted December 17, 2019 (edited) 5 hours ago, Igor Q. said: Right, but I want to be able to reference the object being added. For example, every time an object that is added to that storage, I want to set the values (for that object) to have X variable, Y variable and Z variable. It's similar to how we have player roles now with auto equipping items. STORAGE OWNER. It triggers every time something is added. This means that specific entity or logic will be available to reference right from the creation of that instance of the Storage. It's basically a template of itself, and the scripts run in each separate instance on whatever you attach them to, not in the original. Edited December 17, 2019 by Indomitus 1 Share this post Link to post Share on other sites
0 jchob 354 Posted December 24, 2019 Hm, that would be a lot easier. Why don''t you use a label with your objects along with a Storage? Then you can get the variables from Storage that are "connected" to the label inside of entity. I'm pretty sure you know that, or I don't understand what are you really saying Share this post Link to post Share on other sites
Would it be possible to add an event listener that says
On [Object] added to Storage.
Anytime I add an object to the storage, I can cause a trigger to occur.
Thanks!
@Houp
Share this post
Link to post
Share on other sites