A with X Collisioning A', making A' have X

For questions about using Classic.

Post » Thu Feb 03, 2011 8:39 pm

I want to make an event that makes an uninfected family member get infected when it collides with an infected member of the same family.

So I have something like:
If Enemy psn == 1
>Enemy collides Enemy: Enemy psn = 1

But apparently it just sets psn=1 for the already poisoned enemy... how can I solve this?
B
22
S
3
G
6
Posts: 59
Reputation: 4,450

Post » Thu Feb 03, 2011 10:22 pm

I had a play with the idea and found a way that works

http://dl.dropbox.com/u/1487524/Scirra/ ... icking.cap
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Fri Feb 04, 2011 2:46 am

Edit:
Gah! it didn't work on mine, because in the comparison I need to evaluate if enemy psn is different from enemy psn, and apparently it just evaluates agains itself...

I will try making them into two families just to see if it works, but I suppose it won't (I have many different enemy sprites, so that's why the object solution didn't work)
B
22
S
3
G
6
Posts: 59
Reputation: 4,450

Post » Fri Feb 04, 2011 3:40 am

[quote="kirby":3sejqwxo](I have many different enemy sprites, so that's why the object solution didn't work)[/quote:3sejqwxo]
You could fix that by controlling the sprites with a different object than the sprite itself and all sprites use the same object, then the object picking should work.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Fri Feb 04, 2011 3:58 am

Eh? o.o
B
22
S
3
G
6
Posts: 59
Reputation: 4,450

Post » Fri Feb 04, 2011 4:25 am

[url:3y0n5b1p]http://dl.dropbox.com/u/666516/poison.cap[/url:3y0n5b1p]
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Feb 04, 2011 6:15 am

It happens the same thing that happened with the first cap, in the comparison, one is an object, the other is a family. In my game, both are the same family.

PS: Beautiful cap, it doesn't solve my problem, but I'll keep it xDDD
B
22
S
3
G
6
Posts: 59
Reputation: 4,450

Post » Fri Feb 04, 2011 2:13 pm

Both examples run off of what you describe, so all I can suggest is post a cap, and we'll see whats up there.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Feb 04, 2011 6:10 pm

Cap is heavy, and my (stupid) internet will surely fail... let me try to tell you the problem just once before I go somewhere else to upload it, ok?

I have 3 objects (and plan to be more) with different speeds and sprites. They are part of the Enemy family. I have another object called gas. When gas overlaps Enemy, Enemy's private variable psn goes to 1.

I want the poison to be contagious, so when any Enemy (regardless of object/sprite) touches another Enemy (regardless of object/sprite).

Your caps assume a sprite hits a family, so that won't work, since I would have to make 3 events, one for each sprite object, which can be fairly easy now, but not when I put like 15 enemies.

That's why I have a if Enemy that has psn==1 overlaps Enemy, then Enemy psn=1. And the problem is, apparently it just changes the Enemy that already has psn==1.

I'm sorry for not uploading the cap. I will try to make it in another new cap and upload it, thank you very much to everyone that is trying to help me ;___;
B
22
S
3
G
6
Posts: 59
Reputation: 4,450

Post » Fri Feb 04, 2011 7:20 pm

You can do that via two families, but if I were you I would go with multiple instances with different frames.
Families can be a real pain when you start mixing.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests