• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Changing the height with up/down arrow events

Status
Not open for further replies.
Level 7
Joined
Feb 4, 2005
Messages
289
I can see the Pilot system done by Matildaknights but there are many triggers enageg so i need the simplest way this to be done. I use a unit that morphs into air and in the air you know up arrow moves the map up, down - down etc. How do they make it the unit to change its height with up and down keys events and the map not moving? Well yes i dont use camera like many games including that pilot system was made- seeing the unit from behind and close but if it's needed ok i will do it just tell me how.

Oh and i know the action ofc: (was smth like that i havent opened the editor)
Change the .. unit's height to current height + 10 using arithmetical let's say for Up and

-||- - 10 for down
 
Level 11
Joined
Jul 12, 2005
Messages
764
there's an event like Player presses a button for that.
if you want it to be more effective, create these triggers:

trigger 1/a
event:
player 1 presses the up button
actions:
set UpButtonPressed = true
set WhichUnit = triggering player's currently selected unit (not sure this exists)

trigger 1/b
event:
player 1 presses the down button
actions:
set DownButtonPressed = true
set WhichUnit = triggering player's currently selected unit (not sure this exists)

trigger 2/a
event:
player 1 releases the up button
actions:
set UpButtonPressed = false
set WhichUnit = no unit

trigger 2/b
event:
player 1 releases the down button
actions:
set DownButtonPressed = false
set WhichUnit = no unit

trigger 3
event:
every 0.5 seconds of the game
condition:
UpButtonPressed = true
or
DownButtonIsPressed = true
action
if UpButtonPressed = true
set WhichUnit's Fly height to (current flyheight + 5)
if DownButtonIsPressed = true
set WhichUnit's Fly height to (current flyheight - 5)

so you reqire 5 triggers in total...
note:
this is not multiinstancable!!
 
Status
Not open for further replies.
Top