"Destroy on startup" box?

Get help using Construct 2

Post » Sun Aug 03, 2014 5:53 am

Hey there!

Remember that box nearly every object had in its parameters in Construct Classic, "destroy on startup"? Is there anything similar to that in Construct 2, without having to add an event to individually destroy every object I want to be destroyed on startup?

I've searched the forums and the web for an answer to this, and I'm surprised that it looks like no one ever asked this question before...

Thank you in advance can tell me!
B
11
S
3
G
3
Posts: 206
Reputation: 2,379

Post » Sun Aug 03, 2014 6:27 am

why do you have them on the layout if your just going to destroy them? if its so you can spawn that object just make a new layout that you put everything that you need to spawn. But there's lots of different ways you can do something like this you could put them in a family and then destroy that family on start up or you could give them instance variables and set it to something and have it destroy blah if IV=Blah-blah
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Sun Aug 03, 2014 8:09 pm

Thanks for the ideas. Though I still think it'd be simpler by just ticking a "destroy on startup" box. Putting objects on a different layout doesn't destroy them, and if ever they're all part of a family, but that some objects in that family need to stay on screen, I can't just delete them all.

I wonder why that option doesn't exist anymore...
B
11
S
3
G
3
Posts: 206
Reputation: 2,379

Post » Sun Aug 03, 2014 8:59 pm

On Start of layout > Destroy [Object]
B
34
S
9
G
3
Posts: 493
Reputation: 4,067

Post » Sun Aug 03, 2014 9:17 pm

Yeah, well... that is a bit long if you've got many objects to destroy.
B
11
S
3
G
3
Posts: 206
Reputation: 2,379

Post » Sun Aug 03, 2014 9:47 pm

The family idea seems a good one if you have the full version.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Aug 03, 2014 9:59 pm

You don't need to destroy them on the 'different' layout, as only one layout exists at a time. That is the common mechanism used.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Sun Aug 03, 2014 10:47 pm

@Kan as blackhornet said you don't need to destroy them if there on another layout . We are telling you that because normally the reason people what to destroy an object at start of layout its because they want to spawn it later . so what we are saying is if that's why you need the feature just don't put the object on the layout make a blank one instead and put the objects there then you just tell C2 to spawn the object whenever you need it without having to destroy it . This is the main way of spawning object so you don't need to destroy unwanted instances . Also to Spawn something in Construct 2 it just has to exist somewhere in your project

if this is not the reason you need to destroy on start of layout tell us but this is the reason most ask
so im not really understanding how ether method would not work for you in fact its better
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Mon Aug 04, 2014 12:17 am

Sorry, for a moment I confused "layout" with "layer". My bad.

And indeed, I can see that an object doesn't get deleted from a project even when you have deleted every instance of it. That could come in handy... (even though it's also a pain to delete every object I want to get rid of permanently one after the other in the project tab)

Well thanks folks. I think I'll go with this then.
B
11
S
3
G
3
Posts: 206
Reputation: 2,379


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests