TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
How to set an actor value without using the actor that is the value
Pages:
1
How to set an actor value without using the actor that is the value
cloa513
Posts: 245
February 13, 2016, 04:59:38 pm
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
February 13, 2016, 06:58:09 pm
What prevents you from adding actor 2 to the actor values of the actor 1s?
https://twitter.com/Rob1221dev
cloa513
Posts: 245
February 14, 2016, 04:31:41 am
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
February 14, 2016, 04:51:46 am
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
February 15, 2016, 06:06:46 pm
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.
Pages:
1