A question only for Advance People on Construct2

Get help using Construct 2

Post » Tue Apr 07, 2015 3:33 am

Ok heres the question>>> When my character has collision with any object and I want that object to get destroy just until the end of the Layout <<How do I make that object spawn in the exact position it was before it had collision with my character when I start the game from the begining again >>> Cause I already put the option Global to that object to "Yes" in the Object Type Properties and all the time when I start the game the object its not there anymore <<< All I want to know its how to make that object appear again but not before the end of the Layout but just exactly when I restart that same level from the begining<<< ThankZ!!!!
B
6
Posts: 9
Reputation: 302

Post » Tue Apr 07, 2015 5:08 am

Are you referring to their original position when layout starts or their new position of where they collided with player?

If its original then simply use an "On-start-of-layout" event to spawn them all where they belong each time layout starts/restarts.

If your referring to new collided position you will need to use a global variable for each that stores their x,y coordinates prior to destroying them and reloads using this data at start/restart of layout...

But this begs the question of why your restarting the same layout in your gameplay... depending on your goal you could simulate a restart by moving player and only set things collided with to invisible keeping their current position until the simulated restart when they were set back visible...
B
41
S
8
G
3
Posts: 546
Reputation: 5,110

Post » Tue Apr 07, 2015 11:20 am

I'm referring to their original position when layout starts ,,,, Ok heres the thing lets see I have 50 butterflies on the Layout but I just want to destroy every one I got collision withit and keepit that way until I restart the layout from zero I mean from the start menu or from the map choosing that same level again<<< But I dont want any butterflies appear again just when I lose a Life<<<<But Only when I restart the whole Layout<<< You give a good answer about the invible part but I used an instance with that after I lose a life it will appear again and If I used a Global I think it will destroy all the Butterflies each time I lose a Life <<< ThankZ !!!!! chrisinfinger <<<<
B
6
Posts: 9
Reputation: 302

Post » Tue Apr 07, 2015 11:22 am

chrisinfinger wrote:Are you referring to their original position when layout starts or their new position of where they collided with player?

If its original then simply use an "On-start-of-layout" event to spawn them all where they belong each time layout starts/restarts.

If your referring to new collided position you will need to use a global variable for each that stores their x,y coordinates prior to destroying them and reloads using this data at start/restart of layout...

But this begs the question of why your restarting the same layout in your gameplay... depending on your goal you could simulate a restart by moving player and only set things collided with to invisible keeping their current position until the simulated restart when they were set back visible...


I'm referring to their original position when layout starts ,,,, Ok heres the thing lets see I have 50 butterflies on the Layout but I just want to destroy every one I got collision withit and keepit that way until I restart the layout from zero I mean from the start menu or from the map choosing that same level again<<< But I dont want any butterflies appear again just when I lose a Life<<<<But Only when I restart the whole Layout<<< You give a good answer about the invible part but I used an instance with that after I lose a life it will appear again and If I used a Global I think it will destroy all the Butterflies each time I lose a Life <<< ThankZ !!!!! chrisinfinger <<<<
B
6
Posts: 9
Reputation: 302

Post » Tue Apr 07, 2015 11:32 am

Can you give me a better hint on this one >>> If its original then simply use an "On-start-of-layout" event to spawn them all where they belong each time layout starts/restarts.
B
6
Posts: 9
Reputation: 302

Post » Tue Apr 07, 2015 1:54 pm

I think you're looking for the Persist behavior:
www (dot) scirra.com/manual/161/persist
B
3
Posts: 6
Reputation: 183

Post » Tue Apr 07, 2015 3:17 pm

Objects like sprites reappear as they are in the scirra editor, when you restart the layout / come back to the layout, as long as you don't give them the persist behavior or some kind of saving/loading.

1076 wrote:I think you're looking for the Persist behavior:
www (dot) scirra.com/manual/161/persist

No, persist would mean that if it is destroyed, it will stay destroyed, even if you restart the layout.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
20
S
9
G
1
Posts: 786
Reputation: 3,729

Post » Tue Apr 07, 2015 3:25 pm

mindfaQ wrote:Objects like sprites reappear as they are in the scirra editor, when you restart the layout / come back to the layout, as long as you don't give them the persist behavior or some kind of saving/loading.

1076 wrote:I think you're looking for the Persist behavior:
www (dot) scirra.com/manual/161/persist

No, persist would mean that if it is destroyed, it will stay destroyed, even if you restart the layout.


so lets see If I put Global option to "YES" to the butterflie object then How do I take out that persist option,, or how do I know its persist << cause remember Im not making a Globa Variable to the butterflie on the Evenst sheets but only in the option of that object <<<<
B
6
Posts: 9
Reputation: 302

Post » Tue Apr 07, 2015 3:42 pm

1076 wrote:I think you're looking for the Persist behavior:
www (dot) scirra.com/manual/161/persist


Thanks for the link BOTH OF YOU GUYS !!!!!
B
6
Posts: 9
Reputation: 302


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests