- Joined
- Apr 1, 2010
- Messages
- 289
here is a efficient way to do collision for projectiles that i just thought of.
There are various ways to create a collision detection system, the big problem is lag here is relativity a lagless way,
when you create your dummies in the Object editor, give them a melee attack and then set the attack range between 10-90 the larger the range the bigger the collision of the projectile will be.
You will need to create an ability based off of Root and give it to the projectile. what this will do is make the projectile act like a building, the unit will not give chase to units, but it will still have flying height.
then just create a trigger like the following
if you are using a system where the projectiles collide with each other, first set their target type to something no other unit can attack and then enable the projectiles to attack other projectiles.
Also you will need to add
the best way would be to use a damage detection sys, heal the damage dealt by the projectile and compare the height of the units (it would be GetLocationZ(udg_P) + Unit Flying height(udg_dummy) and if the absolute value of the difference between the two heights is >= 5 then have it do its effect.
edit: feel free to comment.
There are various ways to create a collision detection system, the big problem is lag here is relativity a lagless way,
when you create your dummies in the Object editor, give them a melee attack and then set the attack range between 10-90 the larger the range the bigger the collision of the projectile will be.
You will need to create an ability based off of Root and give it to the projectile. what this will do is make the projectile act like a building, the unit will not give chase to units, but it will still have flying height.
then just create a trigger like the following
-
Collisions
-
Events
- Unit - A unit Is attacked
-
Conditions
- (Unit-type of (Attacking unit)) Equal to Projectile
-
Actions
- Unit - Cause (Attacking) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
- Unit - Kill (Attacking unit)
-
Events
if you are using a system where the projectiles collide with each other, first set their target type to something no other unit can attack and then enable the projectiles to attack other projectiles.
Also you will need to add
- Custom script: call UnitRemoveAbillity(udg_dummy, 'Aloc')
the best way would be to use a damage detection sys, heal the damage dealt by the projectile and compare the height of the units (it would be GetLocationZ(udg_P) + Unit Flying height(udg_dummy) and if the absolute value of the difference between the two heights is >= 5 then have it do its effect.
edit: feel free to comment.
Last edited: