How do I destroy obiect permamently

Just started using Construct 2? Post your questions here

Post » Tue May 24, 2016 2:47 pm

@fm4fanAT ok thank you for your time
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Tue May 24, 2016 5:38 pm

You just create a save game and load it...

https://www.scirra.com/tutorials/526/ho ... -savegames

If you want objects to remain destroyed when navigating between layouts then give them the persist behaviour.
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

Post » Tue May 24, 2016 7:18 pm

@plinkie i need something like persist but persist works only when game is running
I need load level with destroyed sprites when i turn off and run game again or refresh web game on browser
i know save and load actions but i dont want use this
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Tue May 24, 2016 7:31 pm

fm4fanAT wrote:The save/load captures the exact moment in time - so yes, just save the state off your game after you destroy the object.


Why are the System Actions Load & Save (as mentioned above) no solution for you ?

It sounds to me like 'I want to drive' and 'but i dont want wheels'. What am i exactly missing?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 24, 2016 9:34 pm

@99Instances2Go Because 'save and load 'saves data, timer/clock, so when you save a game when clock in game display 5PM
on load game you see 5PM
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Wed May 25, 2016 12:15 am

That is not nessesarely true. You can exclude objects from beeing saved by the 'no save' behaviour.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed May 25, 2016 8:09 am

@99Instances2Go but that happen on my project and i need save this on array, not on save system
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Wed May 25, 2016 11:30 am

Okay, why dont you do that ?

Use a family for all your objects. Make an array.
Give each object an instance variable containing its name.

Loop trough the famely, store the 'name' on the x axis, and all other things like X,Y,heigh, width, variables, x speed, y speed, everything on the y axis.

Store that array in the local storage.

Retreive it. Make a loop on the x axis.
If value on the x axis = name ... create a certain object and give it all things back that you stored on the y axis

That is a lot of work. And, basecaly you make then you own system load/save. I dont understand why one would/should have to, if its allready there.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed May 25, 2016 12:43 pm

fm4fanAT wrote:Sorry, didn't plan to make the whole capx

For arrays the best tutorial to start is https://www.scirra.com/tutorials/307/ar ... ers/page-1


I needed that laugh HAHAHA!!
Last edited by PixelPower on Wed May 25, 2016 1:36 pm, edited 1 time in total.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Wed May 25, 2016 12:44 pm

if you don't need the xy - and only the is dead/alive it's pretty straight forward (and a small save state).
I prefer the local storage - you can do stuff like save slots, ... and don't run into troubles like it can happen with just load/save.

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

PreviousNext

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests