How do I fix this?

Just started using Construct 2? Post your questions here

Post » Tue Dec 08, 2015 7:44 am

I've got these two events that aren't working correctly. Well the first one does but the second one not so much.

First the player attains a Hyper Orb and it turns a Global Variable to 1. Once it's 1, then the next event follows with the actions. But the actions are not being executed correctly. The first 4 actions of the second event are executed then the rest do not. The game just stays in a Timescale of 0. What am I doing wrong? It all looks logical, at least from my perspective....

Image
Risk Rocket now available on Google Play
Image
B
35
S
15
G
6
Posts: 337
Reputation: 6,275

Post » Tue Dec 08, 2015 3:02 pm

I wonder what would happen If you set the timescale to 0.01 rather than 0 and the wait t0 0.04 rather than 4 ...and why...
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,782

Post » Tue Dec 08, 2015 3:22 pm

Yup - you've asked the event to wait 4 second at a timescale of zero.... Try setting object time scales instead of system time scale.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
69
S
18
G
65
Posts: 2,195
Reputation: 41,465

Post » Fri Dec 18, 2015 6:14 am

Ah, thanks you guys!

Also, I wanted to add a skip button to skip the introduction to the game, basically ignore the entirety of the 2nd event. When the skip button is pressed the skip button is destroyed and the Hyper Orb Action is set to 3. That doesn't stop the 2nd event from executing. Should I basically put:

HyperOrbAction= 3 > Instruction Text Destroy
Instruction Text Is Inside Layout TimeScale set - 1

Does that make sense?
Risk Rocket now available on Google Play
Image
B
35
S
15
G
6
Posts: 337
Reputation: 6,275

Post » Fri Jan 29, 2016 11:13 am

It's because you're checking the var just once when you trigger the whole event, so it continues running regardless of the value of HyperOrbAction, you can break your events into sub-events and check the var status after every wait before continuing to the other actions, or you can add your own timer var (just a number that you add 1 to every second) and then you'll have more control over it, for example, instead of putting wait for 4 seconds, you do this, set var timer to 4 and another action after that system/wait for trigger("timer"), on your counter event when it reaches 0, you signal the wait trigger ("timer"), then if you want to stop counting, just set the timer to 0 or -1.
Btw, the internal wait action will also continue counting and executing the event if you'll restart the layout, which is also annoying at times, that's why I always do my own timer, or use stuff like on fade ended, on audio ended, on animation ended, etc.
Image
B
67
S
26
G
12
Posts: 511
Reputation: 11,974


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests