How do I (Destroy an object forever) RESOLVED

Get help using Construct 2

Post » Mon Jul 07, 2014 3:31 am

Destroy an object;
And when you change the layout;
And return to the layout of the object destroyed even continue a destroyed object.

Can anyone help?
Last edited by Rony Sueliton on Mon Jul 07, 2014 3:28 pm, edited 1 time in total.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Mon Jul 07, 2014 3:34 am

Try making the object you want to destroy global.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Mon Jul 07, 2014 3:46 am

@TheDom, I tried to do but failed because the event has sound, and when it returns to the original layout of the object, the object remains that there just invisible. Being that it is to be destroyed and only be shown the next time the application is opened.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Mon Jul 07, 2014 3:50 am

How is the object being created? on start of layout? Or is it already on the layout at start?
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Mon Jul 07, 2014 4:00 am

@TheDom, The object is created is a button in the second layout, when clicked it is destroyed and beeps.
After returning to the first layout again and go to the second layout, the button is there anyway, and it is to be destroyed for ever since the first time it was clicked.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Mon Jul 07, 2014 4:04 am

I guess that you need to destroy them by yourself using variables. I tried stuffs like this and I get an issue about begining a new game where the objects with persist behavior never came back to the layout.
Try to put a global variable switch and if it's true delete the object (pick by comparaison >> UID) in the event sheet of the layout.
I hope that I helped.
B
4
Posts: 3
Reputation: 208

Post » Mon Jul 07, 2014 9:55 am

The persist behaviour can I think be of help (it maintains the exact state of the object after leaving the layout).

Or you create it at runtime if a variable is equal to something, thus letting you not creating it if you already killed him.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Jul 07, 2014 10:48 am

The example below is this:

destroy.capx


Can anyone help?
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Mon Jul 07, 2014 12:36 pm

Rony Sueliton wrote:The example below is this:

destroy.capx


Can anyone help?


hi
with the help of global variable you can destroy it
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 68
Reputation: 561

Post » Mon Jul 07, 2014 3:28 pm

Thanks for the solution @piuuu, your answer complemented my application. And thanks to everyone who tried to show me the way.
B
11
S
3
G
1
Posts: 105
Reputation: 1,135


Return to How do I....?

Who is online

Users browsing this forum: Solomon and 10 guests