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

[Trigger] Arrow Key Movement Issues

Status
Not open for further replies.
Hello dear Hivers! 8)

I have another problem again...I've made a little demo arrow key movement system (it should support 6 player and one one of their unit's)

the system "works as it should" BUT....

here comes the problem, it's a bit hard to explain but I'll try.

as any player hits ant arrow key the player starts controlling all the units on the map, the units move correctly, but every player can control them even (enemy units) but only on Bnet, it doesn't seem to appear in single player.

It's really hard to explain, so here is the demo map.


  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to Arthas 0001 <gen>, offset by (0.00, 0.00) using The unit's rotation
      • Camera - Lock camera target for Player 2 (Blue) to Arthas 0037 <gen>, offset by (0.00, 0.00) using The unit's rotation
      • Camera - Lock camera target for Player 3 (Teal) to Arthas 0039 <gen>, offset by (0.00, 0.00) using The unit's rotation
      • Camera - Lock camera target for Player 4 (Purple) to Arthas 0040 <gen>, offset by (0.00, 0.00) using The unit's rotation
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
          • Trigger - Add to Move UP <gen> the event (Player - (Player((Integer A))) Presses the Up Arrow key)
          • Trigger - Add to Move UP stop <gen> the event (Player - (Player((Integer A))) Releases the Up Arrow key)
          • -------- - --------
          • Trigger - Add to Move Left <gen> the event (Player - (Player((Integer A))) Presses the Left Arrow key)
          • Trigger - Add to Move Left stop <gen> the event (Player - (Player((Integer A))) Releases the Left Arrow key)
          • -------- - --------
          • Trigger - Add to Move Right <gen> the event (Player - (Player((Integer A))) Presses the Right Arrow key)
          • Trigger - Add to Move Right stop <gen> the event (Player - (Player((Integer A))) Releases the Right Arrow key)
          • -------- - --------
          • Trigger - Add to Move DOWN <gen> the event (Player - (Player((Integer A))) Presses the Down Arrow key)
          • -------- - --------
  • Move UP
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Move UP Execution <gen>
  • Move UP stop
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off Move UP Execution <gen>
  • Move UP Execution
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Move_Group_Up = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is selected by (Player((Integer A)))) Equal to True) and ((Owner of (Matching unit)) Equal to (Player((Integer A)))))))
          • Unit Group - Pick every unit in Move_Group_Up and do (Actions)
            • Loop - Actions
              • Set Move_Up_Location_Unit = (Position of (Picked unit))
              • Set Move_Up_Location[(Player number of (Player((Integer A))))] = Move_Up_Location_Unit
              • Unit - Order (Picked unit) to Move To (Move_Up_Location[(Player number of (Player((Integer A))))] offset by 50.00 towards (Facing of (Picked unit)) degrees)
          • Custom script: call DestroyGroup(udg_Move_Group_Up)
          • Custom script: call RemoveLocation(udg_Move_Up_Location_Unit)
---------

  • Move DOWN
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Move_Group_Down = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is selected by (Player((Integer A)))) Equal to True) and ((Owner of (Matching unit)) Equal to (Player((Integer A)))))))
          • Unit Group - Pick every unit in Move_Group_Down and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face ((Facing of (Picked unit)) - 180.00) over 0.00 seconds
          • Custom script: call DestroyGroup(udg_Move_Group_Down)
-------------

  • Move Right
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Move Right Execution <gen>
  • Move Right stop
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off Move Right Execution <gen>
  • Move Right Execution
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Move_Group_Right = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is selected by (Player((Integer A)))) Equal to True) and ((Owner of (Matching unit)) Equal to (Player((Integer A)))))))
          • Unit Group - Pick every unit in Move_Group_Right and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face ((Facing of (Picked unit)) - 45.00) over 0.00 seconds
          • Custom script: call DestroyGroup(udg_Move_Group_Right)
------------

  • Move Left
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Move Left Execution <gen>
  • Move Left stop
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off Move Left Execution <gen>
  • Move Left Execution
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Move_Group_Left = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is selected by (Player((Integer A)))) Equal to True) and ((Owner of (Matching unit)) Equal to (Player((Integer A)))))))
          • Unit Group - Pick every unit in Move_Group_Left and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face ((Facing of (Picked unit)) - 315.00) over 0.00 seconds
          • Custom script: call DestroyGroup(udg_Move_Group_Left)


Edit: that camera lock isn't finished, and as I said it's a demo ;)
 

Attachments

  • Hit Attack System.w3x
    20.7 KB · Views: 61
Level 6
Joined
Oct 31, 2008
Messages
229
Yes ive seen it thats why i deleted the post

EDIT:Ok i get it. It malfunctions in lan also. Try to rework the move system in dfrent triggers so it works for every player differently (i know it might be big but its the best i can think for now)
 
Level 17
Joined
Mar 17, 2009
Messages
1,349
So basically, even if you don't select the other heroes in a lan game, they move all together? :S

Oh btw, avoid using Integer A ;)

EDIT:
You leak :p
  • Unit - Order (Picked unit) to Move To (Move_Up_Location[(Player number of (Player((Integer A))))] offset by 50.00 towards (Facing of (Picked unit)) degrees)
Polar Projections leak twice ;)
 
Status
Not open for further replies.
Top