- Joined
- Jul 18, 2008
- Messages
- 4,863
Ok, I'm trying to make custom projectiles for a map that continue on a straight path, ignoring changes in the Z of the location under them unless the Z is too high causing them to die.
Well it works, to a point.
The problem is that though it works perfectly on flat terrain, when it goes of the edges of cliffs, it gets a sudden jump in altitude that isn't accounted for in the locations Z causing them to make a very ugly vertical climb and then decline.
For an arrow on a straight path, this looks very ugly.
How can I account for this altitude difference?
Here's the system in Wc3 map form
Well it works, to a point.
The problem is that though it works perfectly on flat terrain, when it goes of the edges of cliffs, it gets a sudden jump in altitude that isn't accounted for in the locations Z causing them to make a very ugly vertical climb and then decline.
For an arrow on a straight path, this looks very ugly.
How can I account for this altitude difference?
-
Arrow Movement
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Bb_ArrowGroup and do (Actions)
-
Loop - Actions
- Set P = (Position of (Picked unit))
- Set P2 = (P offset by Bb_ProjectileSpeed towards (Facing of (Picked unit)) degrees)
- -------- Movement --------
- Unit - Move (Picked unit) instantly to P2
- -------- Projectiles Height --------
- Custom script: set udg_Zz_Real = GetLocationZ(udg_P)
- Custom script: set udg_Zz_Real2 = GetLocationZ(udg_P2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Zz_Real2 Not equal to Zz_Real
-
Then - Actions
- Set Zz_Real3 = (Load (Key (Picked unit)) of 0 from Bb_Hash)
- Set Zz_Real4 = (Zz_Real3 - Zz_Real2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Zz_Real4 Less than 0.00
-
Then - Actions
- Unit - Remove (Picked unit) from the game
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Zz_Real4 Greater than or equal to 0.00
-
Then - Actions
- Animation - Change (Picked unit) flying height to (Zz_Real4 + 10.00) at 99999.00
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
- -------- ------------------- --------
- Custom script: call RemoveLocation(udg_P)
- Custom script: call RemoveLocation(udg_P2)
-
Loop - Actions
-
Unit Group - Pick every unit in Bb_ArrowGroup and do (Actions)
-
Events
Here's the system in Wc3 map form