How do I restart my events on Layout restart

Get help using Construct 2

Post » Thu Mar 03, 2016 9:46 pm

I am setting the 8 direction movement values via a variable and I set them when the player is created. Same for the enemy movement. It all works well until the player is killed, and restarts the layout. None of the 8 direction values are restarted with the layout restart. How would I go about adding the variables to the instances again? Thanks!
B
6
Posts: 30
Reputation: 310

Post » Fri Mar 04, 2016 3:14 am

Anyone?
B
6
Posts: 30
Reputation: 310

Post » Fri Mar 04, 2016 3:20 am

Set it to On start of layout? Not sure what are you doing there exactly. Some screenshot or capx would clear the things out.
Image
B
30
S
16
G
55
Posts: 864
Reputation: 31,907

Post » Fri Mar 04, 2016 4:14 am

On start of layout create player ... Should give you your basic player information ...
B
9
S
3
Posts: 56
Reputation: 801

Post » Fri Mar 04, 2016 5:05 am

Message: jaybien can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hmm, nope create player at start of layout doesn't work. : /

Here's the capx
htt ps://w w w .dropbox.com/sh/n5c5exiggbo6z6i/AAAhYvAa_geOPH_Mr7SCAJz2a?dl=0
B
6
Posts: 30
Reputation: 310

Post » Fri Mar 04, 2016 5:29 am

In your capx Change "On Created" to "On Start of Layout"

Then add the action

System | Set PlayerHP 3

Image

Seems when you killed the player, you were not resetting the global variable "PlayerHP" back to 3
Image Image Image
B
60
S
19
G
6
Posts: 325
Reputation: 7,920

Post » Fri Mar 04, 2016 7:17 am

Ah yep, that nailed it. I overlooked that. Thank you facecjf. I really appreciate it!
B
6
Posts: 30
Reputation: 310

Post » Fri Mar 04, 2016 3:17 pm

jaybien wrote:Ah yep, that nailed it. I overlooked that. Thank you facecjf. I really appreciate it!


No problem! Good luck.
Image Image Image
B
60
S
19
G
6
Posts: 325
Reputation: 7,920


Return to How do I....?

Who is online

Users browsing this forum: alajajm and 18 guests