• 🏆 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!

[ GUI ] Moving With Arrow Keys v.2.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
hi,i am Back! :grin:
wow its been a long since i left the Hive.

Here my Movement System :

  • Moving unit
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
      • Player - Player 10 (Light Blue) Selects a unit
      • Player - Player 11 (Dark Green) Selects a unit
      • Player - Player 12 (Brown) Selects a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Not equal to Moving_units[(Player number of (Triggering player))]
          • (Owner of (Triggering unit)) Equal to (Triggering player)
        • Then - Actions
          • -------- The Moving Unit --------
          • Set Moving_units[(Player number of (Triggering player))] = (Triggering unit)
        • Else - Actions
  • Moving With Arrows
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- use ( Integer ) instead of ( Player number of Triggering player ) Because we are using ( Every # ) Timer Event --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Moving_units[(Integer A)] Not equal to No unit
            • Then - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Camera : From here you can change Distance , Angle , Rotation ETC --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • Camera - Lock camera target for (Owner of Moving_units[(Integer A)]) to Moving_units[(Integer A)], offset by (0.00, 0.00) using Default rotation
              • Camera - Set (Owner of Moving_units[(Integer A)])'s camera Distance to target to 1000.00 over 0.10 seconds
              • Camera - Set (Owner of Moving_units[(Integer A)])'s camera Angle of attack to -20.00 over 0.10 seconds
              • Camera - Set (Owner of Moving_units[(Integer A)])'s camera Rotation to (Facing of Moving_units[(Integer A)]) over 0.30 seconds
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Control_Boolean1[(Integer A)] Equal to True
                • Then - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Moving Forword --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set Leak_point[1] = (Position of Moving_units[(Integer A)])
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- [ Changing this will change Moving Distance ] --------
                  • Set Leak_point[2] = (Leak_point[1] offset by 20.00 towards (Facing of Moving_units[(Integer A)]) degrees)
                  • Unit - Order Moving_units[(Integer A)] to Move To Leak_point[2]
                  • -------- Removing Leaks Points --------
                  • Custom script: call RemoveLocation(udg_Leak_point[1])
                  • Custom script: call RemoveLocation(udg_Leak_point[2])
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                • Else - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- This is to make the unit Turn Right/Left while moving Forword --------
                  • Animation - Change Moving_units[(Integer A)] turn speed to (Default turn speed of Moving_units[(Integer A)])
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
            • Else - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- use ( Integer ) instead of ( Player number of Triggering player ) Because we are using ( Every # ) Timer Event --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • For each (Integer A) from 1 to 12, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Moving_units[(Integer A)] Not equal to No unit
                    • Then - Actions
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Control_Boolean2[(Integer A)] Equal to True
                        • Then - Actions
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- Looking Right --------
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- [ changing this will change the Looking Speed ] --------
                          • Set Looking_Speed_Right_Left[1] = ((Facing of Moving_units[(Integer A)]) - 15.00)
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • Unit - Make Moving_units[(Integer A)] face Looking_Speed_Right_Left[1] over 0.00 seconds
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                        • Else - Actions
                    • Else - Actions
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- use ( Integer ) instead of ( Player number of Triggering player ) Because we are using ( Every # ) Timer Event --------
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • For each (Integer A) from 1 to 12, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Moving_units[(Integer A)] Not equal to No unit
                            • Then - Actions
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Control_Boolean3[(Integer A)] Equal to True
                                • Then - Actions
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- Looking Left --------
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- [ Changing this will change the Looking speed ] --------
                                  • Set Looking_Speed_Right_Left[2] = ((Facing of Moving_units[(Integer A)]) + 15.00)
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • Unit - Make Moving_units[(Integer A)] face Looking_Speed_Right_Left[2] over 0.00 seconds
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                                • Else - Actions
                            • Else - Actions
  • Move Forward Press
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
      • Player - Player 2 (Blue) Presses the Up Arrow key
      • Player - Player 3 (Teal) Presses the Up Arrow key
      • Player - Player 4 (Purple) Presses the Up Arrow key
      • Player - Player 5 (Yellow) Presses the Up Arrow key
      • Player - Player 6 (Orange) Presses the Up Arrow key
      • Player - Player 7 (Green) Presses the Up Arrow key
      • Player - Player 8 (Pink) Presses the Up Arrow key
      • Player - Player 9 (Gray) Presses the Up Arrow key
      • Player - Player 10 (Light Blue) Presses the Up Arrow key
      • Player - Player 11 (Dark Green) Presses the Up Arrow key
      • Player - Player 12 (Brown) Presses the Up Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Press Up Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This is to make the unit Turn Right/Left while moving Forward --------
      • Animation - Change Moving_units[(Player number of (Triggering player))] turn speed to 0.10
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Control_Boolean1[(Player number of (Triggering player))] = True
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
  • Move Forward Release
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
      • Player - Player 2 (Blue) Releases the Up Arrow key
      • Player - Player 3 (Teal) Releases the Up Arrow key
      • Player - Player 4 (Purple) Releases the Up Arrow key
      • Player - Player 5 (Yellow) Releases the Up Arrow key
      • Player - Player 6 (Orange) Releases the Up Arrow key
      • Player - Player 7 (Green) Releases the Up Arrow key
      • Player - Player 8 (Pink) Releases the Up Arrow key
      • Player - Player 9 (Gray) Releases the Up Arrow key
      • Player - Player 10 (Light Blue) Releases the Up Arrow key
      • Player - Player 11 (Dark Green) Releases the Up Arrow key
      • Player - Player 12 (Brown) Releases the Up Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Release Up Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Control_Boolean1[(Player number of (Triggering player))] = False
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This make the Unit Stop Immediately when Release --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Moving_units[(Player number of (Triggering player))] Not equal to No unit
        • Then - Actions
          • Set Leak_point[5] = (Position of Moving_units[(Player number of (Triggering player))])
          • Unit - Move Moving_units[(Player number of (Triggering player))] instantly to Leak_point[5]
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Removing Leaks Points --------
          • Custom script: call RemoveLocation(udg_Leak_point[5])
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
        • Else - Actions
  • Lock Right Press
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
      • Player - Player 2 (Blue) Presses the Right Arrow key
      • Player - Player 3 (Teal) Presses the Right Arrow key
      • Player - Player 4 (Purple) Presses the Right Arrow key
      • Player - Player 5 (Yellow) Presses the Right Arrow key
      • Player - Player 6 (Orange) Presses the Right Arrow key
      • Player - Player 7 (Green) Presses the Right Arrow key
      • Player - Player 8 (Pink) Presses the Right Arrow key
      • Player - Player 9 (Gray) Presses the Right Arrow key
      • Player - Player 10 (Light Blue) Presses the Right Arrow key
      • Player - Player 11 (Dark Green) Presses the Right Arrow key
      • Player - Player 12 (Brown) Presses the Right Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Press Right Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Control_Boolean2[(Player number of (Triggering player))] = True
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
  • Look Right Release
    • Events
      • Player - Player 1 (Red) Releases the Right Arrow key
      • Player - Player 2 (Blue) Releases the Right Arrow key
      • Player - Player 3 (Teal) Releases the Right Arrow key
      • Player - Player 4 (Purple) Releases the Right Arrow key
      • Player - Player 5 (Yellow) Releases the Right Arrow key
      • Player - Player 6 (Orange) Releases the Right Arrow key
      • Player - Player 7 (Green) Releases the Right Arrow key
      • Player - Player 8 (Pink) Releases the Right Arrow key
      • Player - Player 9 (Gray) Releases the Right Arrow key
      • Player - Player 10 (Light Blue) Releases the Right Arrow key
      • Player - Player 11 (Dark Green) Releases the Right Arrow key
      • Player - Player 12 (Brown) Releases the Right Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Release Right Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Control_Boolean2[(Player number of (Triggering player))] = False
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This will make the Unit Look Right Slightly --------
      • Unit - Make Moving_units[(Player number of (Triggering player))] face ((Facing of Moving_units[(Player number of (Triggering player))]) - 15.00) over 0.00 seconds
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
  • Look Left Press
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
      • Player - Player 2 (Blue) Presses the Left Arrow key
      • Player - Player 3 (Teal) Presses the Left Arrow key
      • Player - Player 4 (Purple) Presses the Left Arrow key
      • Player - Player 5 (Yellow) Presses the Left Arrow key
      • Player - Player 6 (Orange) Presses the Left Arrow key
      • Player - Player 7 (Green) Presses the Left Arrow key
      • Player - Player 8 (Pink) Presses the Left Arrow key
      • Player - Player 9 (Gray) Presses the Left Arrow key
      • Player - Player 10 (Light Blue) Presses the Left Arrow key
      • Player - Player 11 (Dark Green) Presses the Left Arrow key
      • Player - Player 12 (Brown) Presses the Left Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Press Left Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Control_Boolean3[(Player number of (Triggering player))] = True
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
  • Look Left Release
    • Events
      • Player - Player 1 (Red) Releases the Left Arrow key
      • Player - Player 2 (Blue) Releases the Left Arrow key
      • Player - Player 3 (Teal) Releases the Left Arrow key
      • Player - Player 4 (Purple) Releases the Left Arrow key
      • Player - Player 5 (Yellow) Releases the Left Arrow key
      • Player - Player 6 (Orange) Releases the Left Arrow key
      • Player - Player 7 (Green) Releases the Left Arrow key
      • Player - Player 8 (Pink) Releases the Left Arrow key
      • Player - Player 9 (Gray) Releases the Left Arrow key
      • Player - Player 10 (Light Blue) Releases the Left Arrow key
      • Player - Player 11 (Dark Green) Releases the Left Arrow key
      • Player - Player 12 (Brown) Releases the Left Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Release Left Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Control_Boolean3[(Player number of (Triggering player))] = False
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This will make the Unit Look Left Slightly --------
      • Unit - Make Moving_units[(Player number of (Triggering player))] face ((Facing of Moving_units[(Player number of (Triggering player))]) + 15.00) over 0.00 seconds
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
  • Look Behind Press
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
      • Player - Player 2 (Blue) Presses the Down Arrow key
      • Player - Player 3 (Teal) Presses the Down Arrow key
      • Player - Player 4 (Purple) Presses the Down Arrow key
      • Player - Player 5 (Yellow) Presses the Down Arrow key
      • Player - Player 6 (Orange) Presses the Down Arrow key
      • Player - Player 7 (Green) Presses the Down Arrow key
      • Player - Player 8 (Pink) Presses the Down Arrow key
      • Player - Player 9 (Gray) Presses the Down Arrow key
      • Player - Player 10 (Light Blue) Presses the Down Arrow key
      • Player - Player 11 (Dark Green) Presses the Down Arrow key
      • Player - Player 12 (Brown) Presses the Down Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Press Down Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Control_Boolean4[(Player number of (Triggering player))] = True
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------

  • Look Behind Release
    • Events
      • Player - Player 1 (Red) Releases the Down Arrow key
      • Player - Player 2 (Blue) Releases the Down Arrow key
      • Player - Player 3 (Teal) Releases the Down Arrow key
      • Player - Player 4 (Purple) Releases the Down Arrow key
      • Player - Player 5 (Yellow) Releases the Down Arrow key
      • Player - Player 6 (Orange) Releases the Down Arrow key
      • Player - Player 7 (Green) Releases the Down Arrow key
      • Player - Player 8 (Pink) Releases the Down Arrow key
      • Player - Player 9 (Gray) Releases the Down Arrow key
      • Player - Player 10 (Light Blue) Releases the Down Arrow key
      • Player - Player 11 (Dark Green) Releases the Down Arrow key
      • Player - Player 12 (Brown) Releases the Down Arrow key
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When a Player Release Down Arrow Key --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Moving_units[(Integer A)] Not equal to No unit
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Control_Boolean4[(Integer A)] Equal to True
                • Then - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Looking Behind --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set Leak_point[6] = (Position of Moving_units[(Integer A)])
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- [Changing this will change Moving Distance after looking behind ] --------
                  • Set Leak_point[7] = (Leak_point[6] offset by -100.00 towards (Facing of Moving_units[(Integer A)]) degrees)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set Control_Boolean4[(Player number of (Triggering player))] = False
                  • Unit - Order Moving_units[(Integer A)] to Move To Leak_point[7]
                  • -------- Removing Leaks Points --------
                  • Custom script: call RemoveLocation(udg_Leak_point[6])
                  • Custom script: call RemoveLocation(udg_Leak_point[7])
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                • Else - Actions
            • Else - Actions

1.0 = change from 70 triggers to 10 ROFL!
1.1 = Fix Leaks
2.0 = fixed many things


Thanks to Kingz.

Enjoy

Keywords:
arrow , key, move, forward, left, right, behind, with, system
Contents

Move Unit With Arrows Keys v.2.00 (Map)

Reviews
18:17, 7th Dec 2009 TriggerHappy: Review for Spell We do not need any more of these. There are already like 5 of them. Status Rejected

Moderator

M

Moderator

18:17, 7th Dec 2009
TriggerHappy:


Review for Spell

We do not need any more of these. There are
already like 5 of them.

Status

Rejected
 
How could a movement system which you have well condensed here possibly require 70 triggers?


Anyways, you might want to consider throwing in camera control while your at it (basically move the camera with the unit to get a third or first person perspective, could be easily added into your move trigger) to give your system some more appeal (and to account for the masses of lazy people who wouldn't do this themselves).
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
I guess you should add some more stuff if you ask me, i got some ideas for it that would make it really nice:

-trails, if you are moving with cursors and have this enabled, moving through shallow water would cause some effects to be spawned(water splashing). Could aply for dirt also.

-adding strafe on/off option, meaning you can use some keys to strafe your character.

-adding camera option as WherewolfTherewolf suggested, possibly an option that is turned on/off easily.

-if i think of something else i will let you know.

If you need help with that PM me.

EDIT:
This system had more than 70 trigs as far as i remember, you used to use 9*12 + 3 triggers in the system, totaling a bunch of 111 triggers.
 
here is the short version of the player press .... or relaise .... : (JASS)
JASS:
function Trig_Arrows_LEFT_DOWN takes nothing returns nothing
	set udg_KM_Left[GetPlayerId(GetTriggerPlayer())+1] = true
endfunction

function Trig_Arrows_LEFT_UP takes nothing returns nothing
	set udg_KM_Left[GetPlayerId(GetTriggerPlayer())+1] = false
endfunction

function Trig_Arrows_RIGHT_DOWN takes nothing returns nothing
	set udg_KM_Right[GetPlayerId(GetTriggerPlayer())+1] = true
endfunction

function Trig_Arrows_RIGHT_UP takes nothing returns nothing
	set udg_KM_Right[GetPlayerId(GetTriggerPlayer())+1] = false
endfunction

function Trig_Arrows_DOWN_DOWN takes nothing returns nothing
	set udg_KM_Down[GetPlayerId(GetTriggerPlayer())+1] = true
endfunction

function Trig_Arrows_DOWN_UP takes nothing returns nothing
	set udg_KM_Down[GetPlayerId(GetTriggerPlayer())+1] = false
endfunction

function Trig_Arrows_UP_DOWN takes nothing returns nothing
	set udg_KM_Up[GetPlayerId(GetTriggerPlayer())+1] = true
endfunction

function Trig_Arrows_UP_UP takes nothing returns nothing
	set udg_KM_Up[GetPlayerId(GetTriggerPlayer())+1] = false
endfunction

function Trig_Arrows_CreateTrigger takes code actionFunc, playerevent eventId returns nothing
	local trigger t = CreateTrigger()
	local integer PlayerId = 0
	call TriggerAddAction(t, actionFunc)
	loop
		exitwhen PlayerId > 11
		call TriggerRegisterPlayerEvent(t, Player(PlayerId), eventId)
		set PlayerId = PlayerId + 1
	endloop
	set t = null
endfunction

//===========================================================================
function InitTrig_Arrows takes nothing returns nothing
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_LEFT_DOWN, EVENT_PLAYER_ARROW_LEFT_DOWN)
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_LEFT_UP, EVENT_PLAYER_ARROW_LEFT_UP)
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_RIGHT_DOWN, EVENT_PLAYER_ARROW_RIGHT_DOWN)
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_RIGHT_UP, EVENT_PLAYER_ARROW_RIGHT_UP)
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_DOWN_DOWN, EVENT_PLAYER_ARROW_DOWN_DOWN)
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_DOWN_UP, EVENT_PLAYER_ARROW_DOWN_UP)
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_UP_DOWN, EVENT_PLAYER_ARROW_UP_DOWN)
	call Trig_Arrows_CreateTrigger(function Trig_Arrows_UP_UP, EVENT_PLAYER_ARROW_UP_UP)
endfunction
 
Level 5
Joined
Mar 19, 2009
Messages
10
sry for the late answer

-adding strafe on/off option, meaning you can use some keys to strafe your character.
sry but what do u mean by that? xD [my bad English >.<]

-trails, if you are moving with cursors and have this enabled, moving through shallow water would cause some effects to be spawned(water splashing). Could aply for dirt also.
i have tried to make trails but i think its cant be done:

1.there its no terrain for the water so i cant add splash :/
2.there its no Good Special effect for Terrains like dirt.

i think i found a good special effect for lava xD
-adding camera option as WherewolfTherewolf suggested, possibly an option that is turned on/off easily.
i have added a way to turn it on/off
 
Level 8
Joined
Mar 3, 2009
Messages
327
strafing would be being able to move sideways and backwards with your character facing the same direction
itd be really cool if you could add that... like wherewolf said it could be useful for heaps of games with a first person camera.

Also, could you make the camera height match the height of the unit when it's moving over higher ground? itd be much more useful for my map ^^
 
Top