I would Regions under all the lava/water and do a trigger.
make a behaviour that does like -life as a % periodically
trigger 1
event
Unit enter region
condition
region = water region
unit type of unit is = to (so u can only affect specific units)
action
apply behaviour to triggering unit
trigger 2
event
unit leaves region
action
remove behaviour
Open up the campaign map and take a look. You can do this by going Open > Campaign, where you'll find a list of all the Campaign maps. You can look and see how it works :)
@Pkol: Go
Thanks pkol mate that's a smart idea, but will take much time to find out.
Regions aren't good here, because the lava is raising =)
That's supposed to be simply one point saying "takes damage from lava" or "lava kills units" or so...
I was looking for you. In the tosh campaign they do:
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Ally, Enemy, Air, Missile, Dead, Hidden, Invulnerable, with at most Any Amount) and do (Actions)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Ground height at (Position of (Picked unit))) <= 8.5
Then
Unit - Add 1 Lava Damage to (Picked unit) from player P03_LAVA (this being the behaviour)
Else
Thanks Torrak, but i know that solution. Unfortunately there's one difference between my map and that campaign map: My Map has "height positions" where in one region is lava and in an other regions is no lava... so units that aren't in that region where the lava is, would die, too, if they were at the given height. Hope you understand the problem =)
The only way i think you can do it then is to region the lava in, and then check if the units are on said lava regions.
Regions are very versatile with shapes, you can always do multiple shapes to make 1 lava zone, if there is high gorund in the middle of them.
Alternatively, if there is less highground then lava ground it may be considerably easier to do unit leaves region <high ground>. Also if the lava moves up and down (as in sometimes its not there) a simple boolean can be added and then condition lavaison == true then run the kill trigger otherwise dont run it
On the blizzard map they dont use regions because the lava is across the entie map. However you say your map only has lava at points. So regions is your only option.
If the lava raises just to a set point and deraises this can still be done easily setting a boolean variable to be true when the lava raises and then when it deraises set it to false. And then the unit enters region trigger can be conditions to check if lava is raised.
If your lava raises and gets higher and higher then you need to add blizzards method into the region triggers aswell. So you would Region the lava areas. and then when killing the units check for their height based on the lavas current height. (and because any region that has no lava is not targetted them units are fine.) When you modify the lava height each time you would set a variable, and then when the unit enters region it first checks if lava is on and then when it kills the units it would check if they are lower than the lava height variable.
Hi SC2-Mappers, the title already says it... how can i make a unit get damage from water/lava?
Greetings Pehape
@pehape:
I would Regions under all the lava/water and do a trigger.
make a behaviour that does like -life as a % periodically
trigger 1
event
Unit enter region
condition
region = water region
unit type of unit is = to (so u can only affect specific units)
action
apply behaviour to triggering unit
trigger 2
event
unit leaves region
action
remove behaviour
@Torrak: Go
Open up the campaign map and take a look. You can do this by going Open > Campaign, where you'll find a list of all the Campaign maps. You can look and see how it works :)
@Pkol: Go Thanks pkol mate that's a smart idea, but will take much time to find out. Regions aren't good here, because the lava is raising =) That's supposed to be simply one point saying "takes damage from lava" or "lava kills units" or so...
Greetings pehape
@pehape:
I was looking for you. In the tosh campaign they do:
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Ally, Enemy, Air, Missile, Dead, Hidden, Invulnerable, with at most Any Amount) and do (Actions)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Ground height at (Position of (Picked unit))) <= 8.5
Then
Unit - Add 1 Lava Damage to (Picked unit) from player P03_LAVA (this being the behaviour)
Else
Thanks Torrak, but i know that solution. Unfortunately there's one difference between my map and that campaign map: My Map has "height positions" where in one region is lava and in an other regions is no lava... so units that aren't in that region where the lava is, would die, too, if they were at the given height. Hope you understand the problem =)
Greetings Pehape
The only way i think you can do it then is to region the lava in, and then check if the units are on said lava regions.
Regions are very versatile with shapes, you can always do multiple shapes to make 1 lava zone, if there is high gorund in the middle of them.
Alternatively, if there is less highground then lava ground it may be considerably easier to do unit leaves region <high ground>. Also if the lava moves up and down (as in sometimes its not there) a simple boolean can be added and then condition lavaison == true then run the kill trigger otherwise dont run it
@Torrak: Go As said before: Regions aren't a solution, because the lava is raising... I thought about this before...
Greetings Pehape
On the blizzard map they dont use regions because the lava is across the entie map. However you say your map only has lava at points. So regions is your only option.
If the lava raises just to a set point and deraises this can still be done easily setting a boolean variable to be true when the lava raises and then when it deraises set it to false. And then the unit enters region trigger can be conditions to check if lava is raised.
If your lava raises and gets higher and higher then you need to add blizzards method into the region triggers aswell. So you would Region the lava areas. and then when killing the units check for their height based on the lavas current height. (and because any region that has no lava is not targetted them units are fine.) When you modify the lava height each time you would set a variable, and then when the unit enters region it first checks if lava is on and then when it kills the units it would check if they are lower than the lava height variable.
I think thats it, will try it and tell ya what happened.
EDIT: Works as supposed. Thanks =)