Spawning only works when broken?

Get help using Construct 2

Post » Tue Feb 10, 2015 11:54 pm

The event objects were out of order, but the spawning worked up until the third object (Sprite9). Then when I fixed the events, whenever I click on the first object (Sprite28), I get sent back to Title instead of the second object (Sprite8) spawning.
You do not have the required permissions to view the files attached to this post.
B
11
S
4
G
3
Posts: 210
Reputation: 5,318

Post » Wed Feb 11, 2015 12:20 am

Try adding an Else condition first, in events 3, 5, 7
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Feb 11, 2015 12:23 am

If the else solution fails, you could just reverse the order of events 1, 3, 5, and 7. As it is now, you start a cascade effect when you set manual to 1.
Moderator
B
111
S
41
G
20
Posts: 1,586
Reputation: 19,046

Post » Wed Feb 11, 2015 12:24 am

And personally I always like the trigger condition first.. and to reorder the logic accordingly.

edit: and in giving the advice about Else, I was wary that you might be intending some kind of sequential ordering thing.. which it would probably defeat.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Feb 11, 2015 12:31 am

@codah: what should I add to Else? I left them blank and the problem persisted.

@link: this worked!

thanks everyone :)
B
11
S
4
G
3
Posts: 210
Reputation: 5,318

Post » Wed Feb 11, 2015 12:39 am

nickkname wrote:@codah: what should I add to Else? I left them blank and the problem persisted.

@link: this worked!

thanks everyone :)


I guess it doesn't matter any more :D I personally don't like relying on ordering of events so much as I think it can make brittle code, but whatever works for you!
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Feb 11, 2015 1:10 am

Glad to hear it worked.

codah wrote:I personally don't like relying on ordering of events so much as I think it can make brittle code, but whatever works for you!

I absolutely agree, it's really not good practice if it can be avoided. Unfortunately, the triggers in subevents prevent else from working in this case.
Moderator
B
111
S
41
G
20
Posts: 1,586
Reputation: 19,046

Post » Wed Feb 11, 2015 1:29 am

The reason you are experiencing this problem is because the moment you click the left button its going through all the instances of manual before you get to release the left button. So its setting manual to 1 then 2 than 3 really fast. That's why you end up at the title screen. This is also why linkman2004's solution works. Because it gives you enough time for the left button trigger to become false before the code comes back around to check the condition for manual again.
B
31
S
7
G
2
Posts: 100
Reputation: 2,485


Return to How do I....?

Who is online

Users browsing this forum: AllanR, Artpunk, QuantumMMX and 8 guests