A question only for Advance People on Construct2

0 favourites
  • 9 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • 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!!!!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 <<<<

  • 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 <<<<

  • 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.

  • I think you're looking for the Persist behavior:

    www (dot) scirra.com/manual/161/persist

  • 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.

    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.

  • 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.

    > 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 <<<<

  • I think you're looking for the Persist behavior:

    www (dot) scirra.com/manual/161/persist

    Thanks for the link BOTH OF YOU GUYS !!!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)