| 07-11-2005, 04:05 PM | #1 |
I want to lock a unit's Z value, making the unit fly in the same Z height ALWAYS, and then I want to kill the unit if it comes close to an elevation in the terrain where the unit's Z is equal to the height of the elevation... Is this possible? |
| 07-11-2005, 08:40 PM | #2 |
Yes this is possible, I did this in trigger i made awhile ago here we go: make 2 variables: tempPoint and tempReal set tempPoint = position of unit (the unit u want to keepflying at a certian height) custom script: set udg_tempReal = GetLocationZ(udg_tempPoint) custom script: RemoveLocation(udg_tempPoint) - to prevent leaks then tempReal will equal the terrain height. all u need to do is set the flying height of a unit to units flying height - tempReal, and u'll have to do this periodicaly like every 0.1 s if u want it to look good. Then to kill the unit if it gets to close to the ground all u need to do is have periodic event - like every 0.25 seconds condition - unit's (whatever unit) height is less than or equal to 0 this could be done in one or two triggers if u need the actuall triggering done for u then just ask. |
| 07-13-2005, 05:44 AM | #3 |
Thanks a lot! I will try this and will post some feedback to you. I wan to do this by myself because I will never be a jass guru If i ask people to do the triggering for me. Thanx for offering help at that level anyway. |
