Problem: Making units under the lava level to take damage
Two things could've gone wrong:
1: calculating the hight of the lava level at a given time, consider that I change the lavahight useing a squareroot curve (over TotalTime seconds)
LavaLow = 8.160. LavaHigh = 8.191. TimeLeft is timeleft till the transition from Low->high is done. My Thought:
WaterHigth = LavaLow + sqrt(something time between 0->1)*(LavaHigh-LavaLow)
Does that looks about right? (The graph at: http://www.wolframalpha.com/input/?i=8.16%2Bsqrt%28x%29*%288.19-8.16%29 indicates that)
Reasoning behind that equation: I make the water go from low->high over TotalTime sec. So I have the min hight plussomething that should be 1 when timeleft is 0 and 0 when timeleft == totaltime and I want that sqrt factor to be something between 0 and 1 and multiply it with the differance. And it should be sqrt because the transition curve. I don't know what "x" i need
2: Compare results
"height of picked unit" > WaterHigth (as above) -> damage taken
Does the "height of unit" return the height at the feet of that unit? If a unit is standing in 0.01 units deep lava, will it count that unit or does it return a unit center-point/origo value?
"Height of picked unit" returns the unit's flying height, not it's world height or even relative height. There's another function that would be more appropriate called "height of point" or "ground height of point" which returns a point's world height. Use "position of unit" for the point and viola! The height of your water depends on the default height level you set when making your map, but it should match up with the function I just mentioned.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi!
Im working on a wc3 warlocks style of map.
Two things could've gone wrong:
LavaLow = 8.160. LavaHigh = 8.191. TimeLeft is timeleft till the transition from Low->high is done. My Thought:
WaterHigth = LavaLow + sqrt(something time between 0->1)*(LavaHigh-LavaLow)
Does that looks about right? (The graph at: http://www.wolframalpha.com/input/?i=8.16%2Bsqrt%28x%29*%288.19-8.16%29 indicates that) Reasoning behind that equation: I make the water go from low->high over TotalTime sec. So I have the min hight plussomething that should be 1 when timeleft is 0 and 0 when timeleft == totaltime and I want that sqrt factor to be something between 0 and 1 and multiply it with the differance. And it should be sqrt because the transition curve. I don't know what "x" i need
"height of picked unit" > WaterHigth (as above) -> damage taken
Does the "height of unit" return the height at the feet of that unit? If a unit is standing in 0.01 units deep lava, will it count that unit or does it return a unit center-point/origo value?
"Height of picked unit" returns the unit's flying height, not it's world height or even relative height. There's another function that would be more appropriate called "height of point" or "ground height of point" which returns a point's world height. Use "position of unit" for the point and viola! The height of your water depends on the default height level you set when making your map, but it should match up with the function I just mentioned.