How to set an actor value without using the actor that is the value

cloa513

  • Posts: 245
Situation- I have a lot of instances of actors of two types (actor1 and actor2) pre-placed on scene- I don't add them at runtime as its slow- much quicker to place them all on scene and then later kill the unneeded ones.  I want to set a subset of actor1 to have actor value of the one instance of actor2 selected by having a common attribute value . It doesn't need to be quick for actor1 (could take a second) but  my alternative code has actor2  burdened by having it some information transfer (set attribute, trigger event) when it is created- it becomes non-responsive- naturally annoying.  How do I do this with just code in Actor1?

rob1221

  • *
  • Posts: 9473
What prevents you from adding actor 2 to the actor values of the actor 1s?

cloa513

  • Posts: 245
That it is going to add multiple  actor 1 to different subsets of actor 2 by player choice- they are action buttons.  I thought I would go for this- I don't know if 0.1 second is enough delay. 

gurigraphics

  • Posts: 690
Running this list the code can lead to problems.
You can divide it into modules, each for one thing.
And solve the problems that appeared one by one.

For this you can use custom triggers events.
And run this in the proper sequence, time and with the appropriate amount of elements.

0.1 second is usually sufficient only to set variables .

cloa513

  • Posts: 245
Thanks for reply. I get what you are saying but given that Stencyl only has two levels of attributes- game and local-  you really have to put a lot into individual behaviors and its seem strange to have multiple of the same type of events. I am putting some events onto the actor itself.