• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Make mouse can't move unit.

Status
Not open for further replies.
Level 4
Joined
Aug 3, 2011
Messages
222
you can't disable the ability to move by right click but there is ways around it. I will show the most easy way.

order unit to stop every time its ordered to move.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Stop

it's fail. that keyboard movement using ordering the unit.
 
Level 5
Joined
Sep 28, 2010
Messages
75
This should do, BUT it will require JassNewGenPack.
If you already have it, then it's fine.

But units will STILL auto-acquire (auto-attack) enemies if they have attack enabled. I have no solution for that except for adding unit classification worker or setting Attack - Targets allowed to Self.
 

Attachments

  • StopMovement.w3x
    25.7 KB · Views: 89
Level 5
Joined
Sep 28, 2010
Messages
75
I have came up with a better understandable Jass (non-JGNP) version of the same file in my last post. The vJass version is because i directly ripped the system out of my map.
Anyway, before copy and pasting the two triggers into your map, be sure that "Automatically create unknown variables when pasting triggers" is checked.

To check it, in the main window of your world editor, go to File > Preferences... , select the General tab and check the box "Automatically create unknown variables when pasting triggers". You can then copy both triggers into your map.

Delete the trigger "Variable Creator" after you paste it into your map.
 

Attachments

  • StopMovementJass.w3m
    16.7 KB · Views: 66
Level 4
Joined
Aug 3, 2011
Messages
222
You mean to say the unit still moves when targeting a location?

could you tell me what you did to put the system into your map?
Because the test map works for me.

Erm.. you're misunderstanding my broken english...

your JASS is work perfectly but it's also disabled the keyboard movement system i used, because it's also moving the unit with ordering the unit.

Any ideas?
 
Level 5
Joined
Sep 28, 2010
Messages
75
ohh i see!
I have now implemented a variable that controls the unit moving.
it is called "StopMovement_Enabled" (in Jass, it is called udg_StopMovement_Enabled)
You must re-implement the system again.

When it is set to true by default. Whenever your movement system issues the
  • Unit - Issue Order Targeting a Point
action, just set StopMovement_Enabled to false and then to True after that.

Example:
  • Set StopMovement_Enabled = False
  • Unit - Order (Your unit) to Move To (Your point)
  • Set StopMovement_Enabled = True
EDIT: forgot to attach the map, lol.
 

Attachments

  • StopMovementJass.w3m
    17.2 KB · Views: 66
Last edited:
Level 4
Joined
Aug 3, 2011
Messages
222
ohh i see!
I have now implemented a variable that controls the unit moving.
it is called "StopMovement_Enabled" (in Jass, it is called udg_StopMovement_Enabled)
You must re-implement the system again.

When it is set to true by default. Whenever your movement system issues the
  • Unit - Issue Order Targeting a Point
action, just set StopMovement_Enabled to false and then to True after that.

Example:
  • Set StopMovement_Enabled = False
  • Unit - Order (Your unit) to Move To (Your point)
  • Set StopMovement_Enabled = True
EDIT: forgot to attach the map, lol.

ok , thanks.... (getting and ready do it to MUI -.-)
 
Level 4
Joined
Aug 3, 2011
Messages
222
ohh i see!
I have now implemented a variable that controls the unit moving.
it is called "StopMovement_Enabled" (in Jass, it is called udg_StopMovement_Enabled)
You must re-implement the system again.

When it is set to true by default. Whenever your movement system issues the
  • Unit - Issue Order Targeting a Point
action, just set StopMovement_Enabled to false and then to True after that.

Example:
  • Set StopMovement_Enabled = False
  • Unit - Order (Your unit) to Move To (Your point)
  • Set StopMovement_Enabled = True
EDIT: forgot to attach the map, lol.

oh no , is't vJASS?
 
Level 5
Joined
Sep 28, 2010
Messages
75
oh no , is't vJASS?

No, no. This is just the GUI part you can do by yourself. The system will just do the rest.
Let me explain: The example i gave you is in GUI. By setting StopMovement_Enabled to [highlight]true/false[/code], it will [highlight]enable/disable[/code] my system, allowing your movement system to move your unit.

If you still don't understand I'll gladly make it simpler.
 
Level 4
Joined
Aug 3, 2011
Messages
222
No, no. This is just the GUI part you can do by yourself. The system will just do the rest.
Let me explain: The example i gave you is in GUI. By setting StopMovement_Enabled to [highlight]true/false[/code], it will [highlight]enable/disable[/code] my system, allowing your movement system to move your unit.

If you still don't understand I'll gladly make it simpler.

nope , it's perfect , and it's not vJASS.

i getting eror because i forget to remove the old 1 (your trigger) and just paste the newest and save. caused eror. this problem is solved now , just a thanks
 
Status
Not open for further replies.
Top