Instance destroy problems

Get help using Construct 2

Post » Sat Feb 01, 2014 4:52 am

Hi guys,

I ran into a serrious problem, which Im not able to solve. The thing is, I want to have on all instances of Enemy pinned another sprites (same sprites, like fire or smoke) well, good and easy so far, problem comes when I want to destroy an Enemy and destroy the sprite pinned on him. Right now, the destruction of Enemy will destroy all second sprites pinned on other instances of Enemy. But I want to destroy Enemy instance and only one sprite attached to that particular instance, without destroying every instance of sprite attached to Enemy instances.

Hope it is not too confusing.

Im new to Construct and I must say its pretty awesome so far. Im not good in programming so please if there is some solution, make it easy to understand.

Thanks in advance
Try my creations on newgrounds or Google play, feedback highly appreciated!

ImageImage
B
9
S
1
Posts: 73
Reputation: 785

Post » Sat Feb 01, 2014 7:12 am

I make an event that looks for any smoke that is not pinned, and destroy it.

That way when the object it was attached to is destroyed, the orphaned smoke is taken care of.
B
233
S
62
G
33
Posts: 902
Reputation: 40,398

Post » Sat Feb 01, 2014 7:27 am

Do you run it every tick, Paradox?
B
34
S
9
G
3
Posts: 493
Reputation: 4,067

Post » Sat Feb 01, 2014 11:42 am

I thought about this, but I kind of lost myself in the middle. I tried to make an event, when Sprite is not pinned -> destroy sprite, but there is no unpinned event trigger. How did you do that Paradox?
Try my creations on newgrounds or Google play, feedback highly appreciated!

ImageImage
B
9
S
1
Posts: 73
Reputation: 785

Post » Wed Feb 05, 2014 6:38 pm

It checks every tick, it's an if/then statement. If there is no unpinned sprite, nothing happens.
B
233
S
62
G
33
Posts: 902
Reputation: 40,398

Post » Wed Feb 05, 2014 6:51 pm

Use the is pinned condition, right click and choose invert to make the is not pinned condition.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Feb 06, 2014 12:31 am

Ok, Ill try that, not used to programming, so Im sorry to bother you with something easy as this.

Anyway big thank you guys :)

Try my creations on newgrounds or Google play, feedback highly appreciated!

ImageImage
B
9
S
1
Posts: 73
Reputation: 785

Post » Thu Feb 06, 2014 3:02 pm

August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882


Return to How do I....?

Who is online

Users browsing this forum: beohs and 9 guests