(My New Jump Map) - Need help fixing a trigger
Posted: Sun May 01, 2011 5:04 pm
As you know, I created a map that requires you to jump through / over things and will only kill you if your hero's flying height (jumping height) is close to the enemy unit's flying height. Well, I created the trigger and by the looks of it, it should be working. Well, it's not working exactly as planned.
Red Events Time - Every 0.05 seconds of game time Conditions Actions Unit Group - Pick every unit in (Units within 50.00 of (Position of JUMP_Hero[1]) matching ((Unit-type of (Matching unit)) Not equal to Sylvanas Windrunner)) and do (Actions) Loop - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Current flying height of (Picked unit)) Greater than ((Current flying height of JUMP_Hero[1]) - 15.00) (Current flying height of (Picked unit)) Less than ((Current flying height of JUMP_Hero[1]) + 15.00) Then - Actions Unit - Kill JUMP_Hero[1] Else - Actions
The "if then else" checks if the Hero's flying height is within flying range (15 pixels heigher / 15 pixels lower) of the picked (enemy) units.
I tested this trigger out, and it seems like it works half-half. I can walk under a unit when the unit is in the air, I can jump over them sucessfully, and I cannot walk into them if they're on the ground because I will die. However, when I fly into them, nothing happens whatsoever.
I also managed to fix the problem where the enemy unit's flying height wasn't changing. It turns out that when you make the unit's flying height change to flying height X over "2.00", 2.00 turns out to be 0.02 seconds. It has to be "200.00" to classify as 2 seconds.
EDIT:: I found out that the reason it is bugging is because when you change a unit's flying height to X over X seconds, it takes X seconds for the height to change to the specified value, but the value itself changes instantly. I found this out by creating a trigger that tells you the flying height of a unit (a knight in this case) every 0.20 seconds. I made a trigger that would change the rifleman's height to 500 over 4 seconds, and then bring it back down to 0 over 4 seconds, and then repeat this sequence. Well, the trigger that tells the flying height of the rifleman every 0.20 seconds returned "0" for 4 seconds, and then instantly changed to "500" and would return "500" for another 4 seconds. So what I see is that while the unit's flying height is adjusting over 4 seconds, the flying height value itself changes instantly.
Do you know any other triggers I could use to refer to the visible flying height of the unit, rather than the value that changes instantly?
Red Events Time - Every 0.05 seconds of game time Conditions Actions Unit Group - Pick every unit in (Units within 50.00 of (Position of JUMP_Hero[1]) matching ((Unit-type of (Matching unit)) Not equal to Sylvanas Windrunner)) and do (Actions) Loop - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Current flying height of (Picked unit)) Greater than ((Current flying height of JUMP_Hero[1]) - 15.00) (Current flying height of (Picked unit)) Less than ((Current flying height of JUMP_Hero[1]) + 15.00) Then - Actions Unit - Kill JUMP_Hero[1] Else - Actions
I tested this trigger out, and it seems like it works half-half. I can walk under a unit when the unit is in the air, I can jump over them sucessfully, and I cannot walk into them if they're on the ground because I will die. However, when I fly into them, nothing happens whatsoever.
I also managed to fix the problem where the enemy unit's flying height wasn't changing. It turns out that when you make the unit's flying height change to flying height X over "2.00", 2.00 turns out to be 0.02 seconds. It has to be "200.00" to classify as 2 seconds.
EDIT:: I found out that the reason it is bugging is because when you change a unit's flying height to X over X seconds, it takes X seconds for the height to change to the specified value, but the value itself changes instantly. I found this out by creating a trigger that tells you the flying height of a unit (a knight in this case) every 0.20 seconds. I made a trigger that would change the rifleman's height to 500 over 4 seconds, and then bring it back down to 0 over 4 seconds, and then repeat this sequence. Well, the trigger that tells the flying height of the rifleman every 0.20 seconds returned "0" for 4 seconds, and then instantly changed to "500" and would return "500" for another 4 seconds. So what I see is that while the unit's flying height is adjusting over 4 seconds, the flying height value itself changes instantly.
Do you know any other triggers I could use to refer to the visible flying height of the unit, rather than the value that changes instantly?