HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

kill unit by passing on them with a heavy machine

04-29-2006, 02:04 AM#1
Exilus
i would like to kill ennemies by squishing them, my map has a huge vehicle and i would like it to instantly-kill units the machine roll on.

i was thinking about making a trigger wich would create invisible units with immolation and very short life every 0.05 seconds right in front of the Vehicle with condition: "current order of "Huge Vehicle"= Move", so, when the unit moved, the little units with immolation appeared and vanished. but i fear it wont work perfectly or that it will cause huge Leak.


Any OTHER ways to do this?
(note: The vehicle must not kill units when its not moving,and it must not kill units behind or on sides of the vehicle)
(note2:The vehicle is unique on the map, so i can use it with the "Specific unit" events.)
04-29-2006, 02:36 AM#2
Deathdragon
I can't think of a better condition than current order = move, but I think the damage would be much easier to control with a unit-damage area (radius= collusion/2 & polar offset ~ 100, facing of vehicle) this would also allow the vehicle to get credit for kills if need-be.

You could also set the damage proportional to the movement speed of the vehicle. This would make slower speeds not necessarily kill and would cause the demage to go to zero when the vehicle stops. (Brainstorming: I haven't tried it yet)
04-29-2006, 05:07 AM#3
Immoralis
do you have aim or msn, i can make this for you
04-29-2006, 12:48 PM#4
Earth-Fury
Quote:
Originally Posted by Exilus
i would like to kill ennemies by squishing them, my map has a huge vehicle and i would like it to instantly-kill units the machine roll on.

i was thinking about making a trigger wich would create invisible units with immolation and very short life every 0.05 seconds right in front of the Vehicle with condition: "current order of "Huge Vehicle"= Move", so, when the unit moved, the little units with immolation appeared and vanished. but i fear it wont work perfectly or that it will cause huge Leak.


Any OTHER ways to do this?
(note: The vehicle must not kill units when its not moving,and it must not kill units behind or on sides of the vehicle)
(note2:The vehicle is unique on the map, so i can use it with the "Specific unit" events.)

store the vehicles moving status in a global boolean. When its orderd to move, set it to true. Orderd to stop, set it to false.

Then, with a periodic trigger, make the boolean variable the condition, use polar projection to project a point infront of the tank, select units within X of the point, and kill them. (remember to clean up your leaks!)
04-29-2006, 03:42 PM#5
shadow1500
There is no good way to find if a unit is moving or standing, because if its issued to attack or cast a spell, it will move to the target until its within range, best way is to have a periodic trigger that checks if the last location of the machine is a lareger than a certain distance from the current location, if it is, then kill all units infront.
04-29-2006, 04:01 PM#6
Earth-Fury
Quote:
Originally Posted by shadow1500
There is no good way to find if a unit is moving or standing, because if its issued to attack or cast a spell, it will move to the target until its within range, best way is to have a periodic trigger that checks if the last location of the machine is a lareger than a certain distance from the current location, if it is, then kill all units infront.

Thats a pretty darn good way x) Store its location in a variable and check it against its currenct location on a periodic trigger. if the X any Y dont match, then project a point and kill the units.
04-29-2006, 04:06 PM#7
Exilus
Quote:
Originally Posted by Earth-Fury
store the vehicles moving status in a global boolean. When its orderd to move, set it to true. Orderd to stop, set it to false.

Then, with a periodic trigger, make the boolean variable the condition, use polar projection to project a point infront of the tank, select units within X of the point, and kill them. (remember to clean up your leaks!)


this does not work: The program only cosider "Order Stop" as being valid if i MYSELF clicked "Stop". i added a test message to test when bolean is activated and desactivated, it says "Bolean ON" when i ask it to move, but it doesn't say "Bolean OFF" when it reached location...it only says it when i click STOP myself. the units still die when they come in front of the stationary vehicle.
04-29-2006, 04:11 PM#8
Exilus
Quote:
Originally Posted by shadow1500
There is no good way to find if a unit is moving or standing, because if its issued to attack or cast a spell, it will move to the target until its within range, best way is to have a periodic trigger that checks if the last location of the machine is a lareger than a certain distance from the current location, if it is, then kill all units infront.


how do you check the previous location of the machine? you can check its current location and all the units around it, but im not sure if you can check its location X seconds ago...
04-29-2006, 04:14 PM#9
Earth-Fury
Quote:
Originally Posted by Exilus
how do you check the previous location of the machine? you can check its current location and all the units around it, but im not sure if you can check its location X seconds ago...

Store its current location in a variable at the END of your periodic trigger, so that the next time it runs, the locaton of the unit when the periodic trigger last fired will be acssesable. Then you just have to compare the X and Y of the position of the unit with the stored variable.
04-29-2006, 04:14 PM#10
blu_da_noob
Every X seconds (periodic) you set previousloc = currentloc and set currentloc = GetUnitLoc(unit). Or equivalent thereof.
04-29-2006, 04:40 PM#11
Captain Griffen
Remember also to destroy it after you use it.

Custom Script: call RemoveLocation (udg_POINTVARIABLE)