overlapping families

Get help using Construct 2

Post » Thu Sep 21, 2017 3:36 pm

darkrealos wrote:@tarek2 ahh sorry i should of mention it is on for each family. so that it selects each unit and the code does work in a sense because ive done it where it overlaps with 1 or 2 units and it takes the correct amount of hits to kill them the problem is that they hit all the objects at the same time instead of hitting them 1 at a time :) and the on collision wont work as they will keep fighting each other to someone dies so i need it to continue on every 2 seconds which it does :)



I see what you mean now, and also I see that dop2000 gave you a really good solution
one thing I I will add to the dop2000 example I hope you don't mind is that you don't need the "For each" in this case other ways it will happen the same thing that you trying to avoid

Example:

Health 80
Every Hit = Takes 5 from health

So if three Humans overlap one Demon the Human will take damage 5 x3 =15 each hit you will fix this by removing the "for each" unless you wanna that to happen

capx >> all credits goes to dop2000

https://www.dropbox.com/s/7t882fw34ekelt8/Overlapping%20Families%20Pick%20One.capx?dl=0


Drag the Humans and vice-versa and place them between the enemies to see them taking damage
B
39
S
22
G
76
Posts: 285
Reputation: 42,186

Post » Thu Sep 21, 2017 5:06 pm

@darkrealos

You know what forget about my capx will not work either sorry for that, I just noticed that if you place three different groups of one Demon Vs one Human then this will happen:

Two of that group of three will be waiting until that random pick>> it picks one from that group, meaning that Two of the groups it can be (Human overlapping Demon) and both of them not getting hit for several seconds because the pick random didn't pick them yet so they can be there fighting each other but not getting Damage.

so basically this is a bigger problem than it looks jeje so now the question is how exactly you wanna to happen and how your game will be working, example:

will it be different groups of Demons vs Humans fighting far from each other example first group here and another group at a farther distance if so how you wanna resolve the hittings Damages pick every 2 secs Random from each group independently or just pick one (demon and one human) from all the objects and apply the damage, you need to be more concrete here because there are many scenarios that can happen that can break the logic that you wanted in the first place
B
39
S
22
G
76
Posts: 285
Reputation: 42,186

Post » Sat Sep 23, 2017 1:51 pm

@dop2000 thanks for the reply i did think about using the UID to target :)
ill give it a try at some point thanks :)
B
19
S
6
Posts: 143
Reputation: 1,835

Previous

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 24 guests