System Arrow Key Movement

U are a noob

Mega Super Ultra Cool Member
Reaction score
152
Arrow Key System v1.00
This System was created by Uareanoob.
In this system unlike others it moves a unit forward instead of north east west and south.
Also in this system you may put in double tap actions for when you double tap a key.
Down key is not used in this system but is prepared for you if you want to use it.
Code:
Key Up
    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
        Set AKS_UpKey[(Player number of (Triggering player))] = True
Code:
Key Up 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
        Set AKS_UpKey[(Player number of (Triggering player))] = False
        Custom script:   set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is selected by (Triggering player)) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Stop
Code:
Key Left
    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
        Set AKS_LeftTurn[(Player number of (Triggering player))] = True
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_LeftOn2[(Player number of (Triggering player))] Equal to True
                    Then - Actions
                        Set AKS_LeftOn[(Player number of (Triggering player))] = True
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_LeftOn[(Player number of (Triggering player))] Equal to False
                    Then - Actions
                        Set AKS_LeftTime[(Player number of (Triggering player))] = (In-game time of day)
                        Set AKS_LeftOn2[(Player number of (Triggering player))] = True
                        Set AKS_Newcast[(Player number of (Triggering player))] = (In-game time of day)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_LeftOn[(Player number of (Triggering player))] Equal to True
                    Then - Actions
                        Set AKS_LeftTime2[(Player number of (Triggering player))] = (In-game time of day)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (AKS_LeftTime2[(Player number of (Triggering player))] - AKS_LeftTime[(Player number of (Triggering player))]) Less than or equal to 0.01
                                (AKS_Newcast[(Player number of (Triggering player))] - AKS_Lastcast[(Player number of (Triggering player))]) Greater than or equal to 0.05
                            Then - Actions
                                -------- This is where you put actions if you double tap the button. --------
                            Else - Actions
                    Else - Actions
            Else - Actions
        Wait 0.10 seconds
        Set AKS_LeftOn[(Player number of (Triggering player))] = False
        Set AKS_LeftOn2[(Player number of (Triggering player))] = False
Code:
Key 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
        Set AKS_LeftTurn[(Player number of (Triggering player))] = False
Code:
Key Right
    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
        Set AKS_RightTurn[(Player number of (Triggering player))] = True
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_RightOn2[(Player number of (Triggering player))] Equal to True
                    Then - Actions
                        Set AKS_RightOn[(Player number of (Triggering player))] = True
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_RightOn[(Player number of (Triggering player))] Equal to False
                    Then - Actions
                        Set AKS_RightTime[(Player number of (Triggering player))] = (In-game time of day)
                        Set AKS_RightOn2[(Player number of (Triggering player))] = True
                        Set AKS_Newcast[(Player number of (Triggering player))] = (In-game time of day)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_RightOn[(Player number of (Triggering player))] Equal to True
                    Then - Actions
                        Set AKS_RightTime2[(Player number of (Triggering player))] = (In-game time of day)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (AKS_RightTime2[(Player number of (Triggering player))] - AKS_RightTime[(Player number of (Triggering player))]) Less than or equal to 0.01
                                (AKS_Newcast[(Player number of (Triggering player))] - AKS_Lastcast[(Player number of (Triggering player))]) Greater than or equal to 0.05
                            Then - Actions
                                -------- This is where you put actions if you double tap the button. --------
                            Else - Actions
                    Else - Actions
            Else - Actions
        Wait 0.10 seconds
        Set AKS_RightOn[(Player number of (Triggering player))] = False
        Set AKS_RightOn2[(Player number of (Triggering player))] = False
Code:
Key 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
        Set AKS_RightTurn[(Player number of (Triggering player))] = False
Code:
Key Down
    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
        Set AKS_DownKey[(Player number of (Triggering player))] = True
Code:
Key Down 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
        Set AKS_DownKey[(Player number of (Triggering player))] = False
Code:
Move
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set AKS_PickedPlayer = (Picked player)
                Set AKS_PickedPlayer_Num = (Player number of AKS_PickedPlayer)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                AKS_UpKey[AKS_PickedPlayer_Num] Equal to True
                    Then - Actions
                        Custom script:   set bj_wantDestroyGroup = true
                        Unit Group - Pick every unit in (Units owned by AKS_PickedPlayer matching (((Matching unit) is selected by AKS_PickedPlayer) Equal to True)) and do (Actions)
                            Loop - Actions
                                Set AKS_PickedUnit = (Picked unit)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Current order of AKS_PickedUnit) Not equal to (Order(move))
                                        And - All (Conditions) are true
                                            Conditions
                                                AKS_LeftTurn[AKS_PickedPlayer_Num] Equal to False
                                                AKS_RightTurn[AKS_PickedPlayer_Num] Equal to False
                                    Then - Actions
                                        Set AKS_KeyPickedLoc = (Position of AKS_PickedUnit)
                                        Set AKS_KeyMoveTo = (AKS_KeyPickedLoc offset by 300.00 towards (Facing of AKS_PickedUnit) degrees)
                                        Unit - Order AKS_PickedUnit to Move To AKS_KeyMoveTo
                                        Custom script:   call RemoveLocation (udg_AKS_KeyPickedLoc)
                                        Custom script:   call RemoveLocation (udg_AKS_KeyMoveTo)
                                    Else - Actions
                    Else - Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set AKS_PickedPlayer = (Picked player)
                Set AKS_PickedPlayer_Num = (Player number of AKS_PickedPlayer)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_LeftTurn[AKS_PickedPlayer_Num] Equal to True
                    Then - Actions
                        Custom script:   set bj_wantDestroyGroup = true
                        Unit Group - Pick every unit in (Units owned by AKS_PickedPlayer matching (((Matching unit) is selected by AKS_PickedPlayer) Equal to True)) and do (Actions)
                            Loop - Actions
                                Set AKS_PickedUnit = (Picked unit)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Or - Any (Conditions) are true
                                            Conditions
                                                (Current order of AKS_PickedUnit) Not equal to (Order(move))
                                                (Current order of AKS_PickedUnit) Equal to (Order(stop))
                                    Then - Actions
                                        Unit - Make AKS_PickedUnit face ((Facing of AKS_PickedUnit) + 15.00) over 0.00 seconds
                                    Else - Actions
                                        Unit - Order AKS_PickedUnit to Stop
                                        Unit - Pause AKS_PickedUnit
                                        Custom script:   call SetUnitFacing( udg_AKS_PickedUnit, ( GetUnitFacing(udg_AKS_PickedUnit) + .01 ))
                                        Unit - Unpause AKS_PickedUnit
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AKS_RightTurn[AKS_PickedPlayer_Num] Equal to True
                    Then - Actions
                        Custom script:   set bj_wantDestroyGroup = true
                        Unit Group - Pick every unit in (Units owned by AKS_PickedPlayer matching (((Matching unit) is selected by AKS_PickedPlayer) Equal to True)) and do (Actions)
                            Loop - Actions
                                Set AKS_PickedUnit = (Picked unit)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Or - Any (Conditions) are true
                                            Conditions
                                                (Current order of AKS_PickedUnit) Not equal to (Order(move))
                                                (Current order of AKS_PickedUnit) Equal to (Order(stop))
                                    Then - Actions
                                        Unit - Make AKS_PickedUnit face ((Facing of AKS_PickedUnit) - 15.00) over 0.00 seconds
                                    Else - Actions
                                        Unit - Order AKS_PickedUnit to Stop
                                        Unit - Pause AKS_PickedUnit
                                        Custom script:   call SetUnitFacing( udg_AKS_PickedUnit, ( GetUnitFacing(udg_AKS_PickedUnit) - .01 ))
                                        Unit - Unpause AKS_PickedUnit
                    Else - Actions
I do realize that this code is not perfect and I will make it perfect tomorrow.
 

Attachments

  • AKS By Uareanoob.w3x
    24.8 KB · Views: 320
  • AKS By Uareanoob.jpg
    AKS By Uareanoob.jpg
    194.5 KB · Views: 348

Psiblade94122

In need of sleep
Reaction score
138
Funky XD

i like the system, but i have a few concerns...

First thing first, theres no dubble tap for the up button... but i personaly thing you will add that in later

From my experiences with periodic triggers, running a script that long every milisecond on battle.net would lead to lagg and disconnects, i suggest toneing it down a bit

With the issue order move function, if there is a object obstructing the path, the unit would move around the object instead of crashing into it (witch is always funny to watch XD)

Turning, you have to stop to turn, that gets pretty annoying

its a good system, but like you seid it needs some work.. ill stand nutral on this for now
 

U are a noob

Mega Super Ultra Cool Member
Reaction score
152
Funky XD

i like the system, but i have a few concerns...

First thing first, theres no dubble tap for the up button... but i personaly thing you will add that in later

From my experiences with periodic triggers, running a script that long every milisecond on battle.net would lead to lagg and disconnects, i suggest toneing it down a bit

With the issue order move function, if there is a object obstructing the path, the unit would move around the object instead of crashing into it (witch is always funny to watch XD)

Turning, you have to stop to turn, that gets pretty annoying

its a good system, but like you seid it needs some work.. ill stand nutral on this for now
Periodic is only like that so it can make up for the fact that arrow keys are slow.

Then turning and stopping I can not change its just the way blizzard made it.
 

Psiblade94122

In need of sleep
Reaction score
138
actualy, for the turns, you can instead of makeing a unit face a angle (and have that as your variable) you can make a Real Variable and give at an array of 10 to store every players direction, that way when you push the left and right, if your standing sitll.. you will rotate, but if your holding up, then itll make the turn wile running

as for Periodic triggers, i personaly use them for things like this (if the code gets too long i switch to timers to make a chain) but .01 is wayy too much, reduceing it to around .04 (if memory recalls, tinki seid that was how fast our eyes process immages) else it will lagg like crazy if tested on battle.net
 

U are a noob

Mega Super Ultra Cool Member
Reaction score
152
actualy, for the turns, you can instead of makeing a unit face a angle (and have that as your variable) you can make a Real Variable and give at an array of 10 to store every players direction, that way when you push the left and right, if your standing sitll.. you will rotate, but if your holding up, then itll make the turn wile running

as for Periodic triggers, i personaly use them for things like this (if the code gets too long i switch to timers to make a chain) but .01 is wayy too much, reduceing it to around .04 (if memory recalls, tinki seid that was how fast our eyes process immages) else it will lagg like crazy if tested on battle.net

I did not understand the first part. As for the second part the user can change it to what ever he wants.
 
Reaction score
456
You know what'd be cool. Make it move slower when going upwards a hill, and faster when going downwards.
 
Reaction score
456
The bugs won't appear as long as the code is well written. :)

But it is bad cause you have to check location in front of the unit everytime it moves.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Can't be done in pure GUI... and GetLocationZ() apparently can bug out when used in conjunction with terrain deformations.
 

U are a noob

Mega Super Ultra Cool Member
Reaction score
152
Ok I have come up with a way in GUI to do the hill movement. Still some bugs but I'll post it here so you guys can test it.
 

Attachments

  • AKS2.w3x
    31.6 KB · Views: 220
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top