How do I Tell Which Instance gets new direction?

Just started using Construct 2? Post your questions here

Post » Thu Nov 06, 2014 8:01 pm

Hello;

I assume that the second instance of Cogo1 in step 2 (the Cog01 that got created on layer 1) is the one that changes direction.
So when a Cog01 has an energy bigger than 100 it spends 50 energy and creates a new one with energy at 40?

Is there a way to specifically reference the first Cog01 after the next Cog01 is created inside Step 2.

thanks for your time.
You do not have the required permissions to view the files attached to this post.
B
34
S
8
G
3
Posts: 169
Reputation: 3,305

Post » Fri Nov 07, 2014 1:34 pm

It is indeed possible but a bit tricky.
Before you create the new cog (that will see all the actions after the action "Create object" applied to it) set a reference to the "original" cog object.
To do so you can use a local/global variable in which you put the UID value of the original cog.

Then, as a subevent after the new cog creation you use the system condition "Pick all" cog. Add also the condition "Pick cog by UID" and put the variable in which you kept the UID of the original cog.
From now on, in that subevent all the actions apply to the old cog.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Fri Nov 07, 2014 2:58 pm

Thanks Kyatric. I am going to wait til I understand Contruct 2 better before I do stuff with the UIDs and global variables.

yours
Winkr7
B
34
S
8
G
3
Posts: 169
Reputation: 3,305


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests