How do I destroy a single instance on collision

Get help using Construct 2

Post » Thu Apr 09, 2015 7:53 am

Hello there, I am new to Contruct. I used to use Stencyl, and the logics behind both of them are very different. So I am having a bit of hard time for simple things sometimes. Please don't judge. :)

My problem was so simple that I'm helpless. It fits within this little image:
Image
I simply want the "portablestuff" instance to be destroyed. I don't understand why it does not pick the instance that the obkect collided with.
PortableStuff is an object that is spawned then pined by an other object. This event is not a subEvent.
I guess I coud find some work around with some instance variable, but since I'm am learning how Construct works, I would like to understand why this line is not working.

I've looked upon the forum, but each time the problem was different, and not related to mine. So what am I doing wrong ?
B
6
Posts: 10
Reputation: 272

Post » Thu Apr 09, 2015 7:58 am

Do it the other way around.

portablestuff on collision with queen portablestuff Destroy
B
48
S
16
G
9
Posts: 1,097
Reputation: 11,195

Post » Thu Apr 09, 2015 8:00 am

that's odd it should work. have you checked its collision points? you should also check that collisions are enabled and that you dont have conflicting event.


i even made a example project to show that it should work the way you have it https://dl.dropboxusercontent.com/u/512 ... lopix.capx
just use arrow keys to move

and @spongehammer it should work this way(and flipped as you said)
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Thu Apr 09, 2015 8:09 am

SpongeHammer> I tried the other way around, but it is still the same.

Thank you Volkiller, but it seems that I cannot open your project (it says my version is too old but it is release 200, isn't it the latest one ? )
The project is not very big, I checked all events but this is the only one with "portablestuff" in the conditions.
All the event with portablestuff are: spawn, pin, and on collision.
I checked the collision points, but I found nothing unusual with them.

This is what is happening: everything is working as it should, but once one of the portablestfuff instances touches the object queen, every instance of portable stuff is destroyed.

Is it possible that it might be a bug?
I had very strange things happening with an else event that was not working properly with the same project.
I can provide a link to the project if you want.
B
6
Posts: 10
Reputation: 272

Post » Thu Apr 09, 2015 9:18 am

I managed to open your file Volkiller. Thanks.
But indeed, this is exactly what I am doing.
Here is the complete project if someone want to have a look.

Edit: oops it seems that I am not able to publish links for the moment...
nacht. free. fr/test/Antz/test.capx just remove the spaces
B
6
Posts: 10
Reputation: 272

Post » Thu Apr 09, 2015 9:29 am

There is an action within larva..

On pathfinding arrived - portablestuff destroy

This event does not pick an instance of prtable stuff and as such destroys all portablestuff instances.
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 Apr 09, 2015 9:39 am

Wow thank you so much, that's something from previous tests I forgot to delete !
Thanks! Give that man another medal !
I'm sorry that this was all my fault, and since I don't know the software so much I thought I was just using it wrong.
So if you saw something in the code that was not the proper way of doing it please let me know !
Last edited by plopix on Thu Apr 09, 2015 9:53 am, edited 1 time in total.
B
6
Posts: 10
Reputation: 272

Post » Thu Apr 09, 2015 9:50 am

Glad to be able to help!
This is the exact reason why so often is asked to include the capx.
Conflicting actions/events can be easily overlooked.
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


Return to How do I....?

Who is online

Users browsing this forum: David181, evillair, tarek2 and 54 guests