How do I simplify this (instance var) ?

Get help using Construct 2

Post » Tue Aug 30, 2016 3:49 pm

Hi. How can I simplify this event sheet so I don't have to clone some events and change the instance variables of two objects for everyone ?
I have 2 sprites that have a instance variable called "nr".
What I am trying to do is this event/condition:
If Moving_Platform_Metal instance var ("nr") is the same with the MovingPlatform_Lever instance variable ("nr") > do this


https://www.dropbox.com/s/aj2m5w7giubtg ... l.jpg?dl=0
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Tue Aug 30, 2016 3:58 pm

System Compare 2? If moving_platform_metal.nr = moving_platform_lever.nr then do this. Probably one event for all of that.
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Tue Aug 30, 2016 7:17 pm

I've tried that but is not working. I think I have to add something more to it ....
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Tue Aug 30, 2016 7:29 pm

Can both NRs be something other than 1,2,3,4?
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Tue Aug 30, 2016 7:35 pm

Just numbers, from 1 to 10
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Tue Aug 30, 2016 7:37 pm

Does the same pattern follow for 5 to 10? There's no reason that "compare two numbers" shouldn't work in that case.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Tue Aug 30, 2016 7:51 pm

Hmm, I don't know what's wrong then, if I don't find the problem I will just clone all the events and replace the numbers, from 1 to 10.
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Tue Aug 30, 2016 9:56 pm

You shouldn't have to add any more to it, which bit is not working? Run it in debug and see if the variables are as you expected.
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Thu Sep 01, 2016 2:46 pm

Here is a reproduction of what I have in my project.

https://www.dropbox.com/s/a6qv3uzabgf2t ... .capx?dl=0
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Thu Sep 01, 2016 2:52 pm

You need a "For each" MovingPlatform at event 87, then drag the current event as a subevent. To do the setup, you need to pick each object individually, so you can then pick the corresponding Level.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 59 guests