Jump to content
  • 0
Sign in to follow this  
Igor Q.

Editor Request - Entity/Logic Storage

Question

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

4 replies to this bug / suggestion

Recommended Posts

  • 0

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
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 by Igor Q.

Share this post


Link to post
Share on other sites
  • 0
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 by Indomitus
  • Like 1

Share this post


Link to post
Share on other sites
  • 0

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×