SYSTEM Wait Problem -.-

Discussion and feedback on Construct 2

Post » Mon Jul 27, 2015 7:31 pm

ImageIf I go to an enemy, I lose a life. If I lose my all lifes, nothing happens. So I wanted this: If I lose all my lifes, my character goes invisible, and I need to wait 0.5 secs, and my character respawns. So. I tested it. I lose all my lifes. My character goes invisible. Wait. Wait 1 sec. Wait 3 secs. Wait 10 secs. And my character is still invisible. After 15 secs, it respawned. WHAT THE HELL IS THAT ??????..... I tested again the game (Not changed anything) and I waiting. I Waited 5 secs, and my character respawned. Testing again, I waiting, and my character respawned after 7 or 8 secs. WHAT THE HELL IS GOING ON ???????
Last edited by DogexOff on Mon Jul 27, 2015 7:51 pm, edited 1 time in total.
B
2
Posts: 4
Reputation: 158

Post » Mon Jul 27, 2015 7:38 pm

You should let us see your work - wait is a commonly misused event.
B
59
S
21
G
9
Posts: 641
Reputation: 9,787

Post » Mon Jul 27, 2015 7:56 pm

I tested it again, and if I lost my lifes, I goes invisible. and nothing happpens. and if I go to the enemy again, then I'm visible. Don't understand.... someone help please
B
2
Posts: 4
Reputation: 158

Post » Mon Jul 27, 2015 8:04 pm

your condition is true every tick, so every tick Slime3 goes invisible add condition "trigger once while true" should solve your problem
Image Image
B
23
S
13
G
135
Posts: 871
Reputation: 70,345

Post » Mon Jul 27, 2015 10:33 pm

I had trouble with "Wait" commands until I started nesting them.

For example:

SYSTEM — Lives = 0 | Slime3 Set invisible
....................................| Wait 0.1
........................................................| Slime3 Set visible


Bad diagram, but I hope you know what I mean to indicate in the editor.

I find the "wait" command only does actions that are nested under it.
B
21
S
5
G
3
Posts: 66
Reputation: 2,848

Post » Tue Jul 28, 2015 2:09 am

@DogexOff, MadSpy is correct. So I won't go on more detail on his work.

I will however mention that it's poor design that your checking every tick for Lives==0. You should check if Lives == 0 only when you lose the life in the first place.

I suggest
On ObjectFoo Collides with character
-- character.life subtract 1
-- If character.life == 0
---- character.setVisible(invisible)
---- wait x
---- character.setVisible(visible)
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Tue Jul 28, 2015 7:34 am

jayderyu wrote:@DogexOff, MadSpy is correct. So I won't go on more detail on his work.

I will however mention that it's poor design that your checking every tick for Lives==0. You should check if Lives == 0 only when you lose the life in the first place.

I suggest
On ObjectFoo Collides with character
-- character.life subtract 1
-- If character.life == 0
---- character.setVisible(invisible)
---- wait x
---- character.setVisible(visible)



Great tip. Thanks cause this helped me out too
Image
B
73
S
20
G
9
Posts: 562
Reputation: 13,903

Post » Wed Jul 29, 2015 11:42 am

Thanks people, now it working! :)
B
2
Posts: 4
Reputation: 158


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests