Same action multiple of same object...

Get help using Construct 2

Post » Wed Nov 13, 2013 12:01 pm

I have things flying around the screen, leaving things behind for the player to interact with (be it to destroy or to power up etc) yet only one runs at a time.

In example:
Flying in space, a trash bag comes along, leaving litter behind. These trash bags can keep coming even if one is still around, but only the first (or only one, or latest) on screen actually does the leaving of said litter. I changed it to "For Every <object>" and it still just keeps it as the one trash.

I'm not a great programmer and I've had this trouble before, but for the life of me I can't imagine how the language isn't clear enough to say that EVERY instance of the trash should leave something behind.

If this was Mario, think of it this way: every goomba should move to the left, but when there are more than one, only the first loaded moves until it's destroyed then the next in line moves. This doesn't make any sense.

For the developers: you are selling this to non-programmers, it would be helpful to have an explanation of how this stuff works since normal language doesn't seem to work as well. I'm guessing "for every" means something else than it does in reality. IRL, "for every cup, spill them over." One could easily spill them all, but a computer reads it as "spill one, then the next, then the next." Totally confusing.

I can give my CAPX file if you need to see it in action.
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Wed Nov 13, 2013 12:25 pm

a capx would be nice, because from your text it doesn't become clear what the issue is.

Most people that get started with construct seem to have problems with defining the one instance that should do something instead of them all doing it. If I understand correctly you have the opposite problem.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Nov 13, 2013 12:35 pm

Exactly. I've always had problems with this before, and seeing that people have trouble the other way around blows my mind.

Thanks in advanced for the help. Look at the sheet labeled "Trash"

CAPX:
(N/A)roracle2013-11-13 14:22:46
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Wed Nov 13, 2013 12:38 pm

Forgot to comment my code, I usually take a day out to do that before it gets too big, but I hope it's not too confusing.
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Wed Nov 13, 2013 1:59 pm

Instead of having the system create the bottles, have the trash spawn the bottles and everything works.

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Nov 13, 2013 2:22 pm

I cannot believe I overlooked that.

Your help was impeccable!

B
25
S
6
G
6
Posts: 262
Reputation: 3,690


Return to How do I....?

Who is online

Users browsing this forum: mekonbekon, yippiez and 12 guests