HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Drowning

02-03-2006, 08:43 AM#1
Lord Kass
Can anyone help me in making a trigger that drowns or kills unit when they are tossed in the water?
02-03-2006, 09:15 AM#2
Jacek
Tossed in water? You mean elevator or what?
02-03-2006, 10:33 AM#3
Lord Kass
toss in my map is an ability that throws a unit in the targeted point
02-03-2006, 10:42 AM#4
player_72985
simplest thing I could think of would be to have regions setup on the water, then when a unit "enters" the water, wait about one second then Kill the unit.
Code:
Event:
Unit Enters <region>

Condition:
None

Action:
Wait 1.00 Seconds
Unit - Kill <Entering> Unit

Something "close" to that I would think, hope it works.
02-03-2006, 10:53 AM#5
Lord Kass
The code is ok but I want is if a unit enters any water. Making Enters a region is bad if the water is not rectangular in shape or square. And is it possible if a unit enters a water, there will be effects and the unit will slowly sink in the water and then die.
02-03-2006, 11:03 AM#6
Anitarf
war3 pathing doesn't allow units to go into dep water anyway, unless they're amphibious. Also, I don't think you can sink a unit below water level.
02-03-2006, 11:24 AM#7
Erdrik
Quote:
Originally Posted by Anitarf
war3 pathing doesn't allow units to go into dep water anyway, unless they're amphibious.
...
there are plenty of ways to get non amphibius units in deep water... morphing is one...

anywho, I am interesting in this as well. I would perfer a way to detect if a unit is on sea pathable terrain, rather than cramming my map with extra regions...
02-03-2006, 12:30 PM#8
Chuckle_Brother
Just check if a point is water, I think you can use the environment check to see if its an amphibious point, and just kill the unit then....also since you are tossing a unit it wont have a pathing value yet, so you can kill it before touchdown.
02-03-2006, 12:52 PM#9
Immoralis
Quote:
Originally Posted by Anitarf
war3 pathing doesn't allow units to go into dep water anyway, unless they're amphibious. Also, I don't think you can sink a unit below water level.

you can also use the "move unit instantly" to move units into deep water.
02-03-2006, 04:11 PM#10
Anitarf
Quote:
Originally Posted by Immoralis
you can also use the "move unit instantly" to move units into deep water.
As far as I know, that action doesn't override pathing; unit simply won't move to unpathable terrain.
02-03-2006, 04:22 PM#11
Lord Kass
what should i do?
02-03-2006, 04:33 PM#12
Anitarf
I suppose you could change in miscdata.txt at which depth water becomes unpathable (at least, I think that can be modified there...), so it is pathable for ground units no matter the depth. All that's left to figure out is, when a unit is in the water too deep. As far as I know, GetLocationZ doesn't measure below water level, it gives the level of the water as height, so I'm still without an idea on how to do that.
02-03-2006, 05:10 PM#13
Chuckle_Brother
The unit is being tossed, he said so himself, to do that he needs to remove the unit's pathing....so getting the unit there is no problem at all.
02-03-2006, 07:00 PM#14
qwertyui
I thought aloc ability overrides pathing... Can be wrong though.

And i know of no other way of solving your problem except putting regions over the whole water mass.

However, an interesting thing to note here is that you can have more than 1 rectangle in a region. You need to do some JASS triggerring for it, but you can construct all kinds of complex region shapes. That works pretty well for static regions that are never meant to be altered in any way.
02-03-2006, 07:11 PM#15
Erdrik
Just add this If/ Then/ Else function at the point where you are going to kill the unit within the trigger:
Attached Images
File type: jpgtemp_trigger.jpg (48.7 KB)