• 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.

Hiding movement commands

Status
Not open for further replies.
Level 7
Joined
May 11, 2010
Messages
278
Every unit with a movement speed automatically has the "move, patrol, hold position, stop" commands on their command card.
In my map I'm using an arrow key based movement system, and as such these commands are redundant. I want them to not be displayed on the command card.
I know this can be achieved by setting the movement speed of the unit to 0. And technically this should be a great solution as with the arrow key movement system i'm using "set unit X/Y" to move the unit, so it doesn't need a movement speed, right?
Here's where it gets weird. When i set the movement speed of the unit to 0 and try moving about, the selection circle, shadow image and healthbar of the unit moves, but the model itself is left in the same place. it's like the unit is moved but the graphical representation of it is left behind.
So that doesn't really work.

How would you suggest going about hiding the movement-related commands from a units command card? I've considered using a dummy unit that doesn't move, but if I do, you won't have the selection circle around your unit and i'd like that as it adds some extra visual clarity as to where your character is.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Try doing this, might work.

  • Events
  • Condition
  • Actions
    • Custom script: call SetPlayerAbilityAvailable(whichPlayer,'Amov',false)
    • Custom script: call SetPlayerAbilityAvailable(whichPlayer,'Aatk',false)
 
The problem is that units with a movement speed of 0 are considered stationary. And for stationary units (including buildings), the SetUnitX/Y natives bug.

If you want to deactivate the junk commands, add the "ward" tag to the unit in the object editor. This will basicly hide it's entire command card. The user can only give "smart" order to the unit then (i.e. right click to move), which can be intercepted by triggers.
The beauty about this: you can still make the unit move and give orders via trigger. It only hides the command card.
 
Level 7
Joined
May 11, 2010
Messages
278
Do you know what the rawcode of those abilities are?
There are some ways to go around this but I want to do it nicely.

nope.

Try doing this, might work.

  • Events
  • Condition
  • Actions
    • Custom script: call SetPlayerAbilityAvailable(whichPlayer,'Amov',false)
    • Custom script: call SetPlayerAbilityAvailable(whichPlayer,'Aatk',false)

Are you sure those scripts are correct?
  • Set TempPlayer = Player 1 (Red)
  • Custom script: call SetPlayerAbilityAvailable(udg_TempPlayer,'Amov',false)
  • Custom script: call SetPlayerAbilityAvailable(udg_TempPlayer,'Aatk',false)
Nothing seems to happen when this trigger is run.

The problem is that units with a movement speed of 0 are considered stationary. And for stationary units (including buildings), the SetUnitX/Y natives bug.

If you want to deactivate the junk commands, add the "ward" tag to the unit in the object editor. This will basicly hide it's entire command card. The user can only give "smart" order to the unit then (i.e. right click to move), which can be intercepted by triggers.
The beauty about this: you can still make the unit move and give orders via trigger. It only hides the command card.

Okay. I didn't know that.
The problem with the ward tag is that I still want hero spells to be visible on the command card :p
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Are you sure those scripts are correct?
  • Set TempPlayer = Player 1 (Red)
  • Custom script: call SetPlayerAbilityAvailable(udg_TempPlayer,'Amov',false)
  • Custom script: call SetPlayerAbilityAvailable(udg_TempPlayer,'Aatk',false)
Nothing seems to happen when this trigger is run.
I'm sure that it's correct, but I was unsure if it would work. That result means it didn't lol :D
 
The problem is that units with a movement speed of 0 are considered stationary. And for stationary units (including buildings), the SetUnitX/Y natives bug.

If you want to deactivate the junk commands, add the "ward" tag to the unit in the object editor. This will basicly hide it's entire command card. The user can only give "smart" order to the unit then (i.e. right click to move), which can be intercepted by triggers.
The beauty about this: you can still make the unit move and give orders via trigger. It only hides the command card.
Want to know another beauty about this method? You can still trigger-order abilities/commands from the unit even though they're hidden.


Reply to chobibo's method:
That actually disables every normal command in the UI except for stop funny enough.... It seems even Hold position uses the move ability. Sadly it doesn't hide the abilities however it disables your entire army/all units so technically its another type of pause all units.


Shoto here is what I suggest, do the extra work and use a dummy unit with 0 move speed. Set a special effect onto the units that highlights them like when normally selected. If de-select then destroy it, then re-make it when selected again. There'll be slight delays depending on the host of the game. A few extra things to get the feature you want exactly, and the few extra things aren't that hard to do.

It's simply because this has been a thing almost every mapmaker has stumbled upon and there is simply no secret/hack/bug/exploit to bypass the default commands/abilities on unit command cards besides setting movement speed to 0 or ward classification.
 
Okay. I didn't know that.
The problem with the ward tag is that I still want hero spells to be visible on the command card :p
In that case, you are screwed royally. ;)

However, you can apply a rather complicated workaround to at least visually disguise those abilities:
- Catch all move, patrol, attack, stop and hold orders and instantly overwrite these orders if they occur by issueing a new order via abilities in a hidden spellbook
- Change the icon and tooltip of those spells to the abilities inside the hidden spellbook (there was a way to do that, iirc ... you should use the search function; I think it requires editing and importing a textfile or replacing some entries in game interface)
- Catch all "smart" orders and overwrite them if neccesary
- make sure to turn off the trigger that "redirects" the orders to the abilities in case you apply attack/stop/walk orders to the unit via script and then turn it on again.

So basicly, make move/attack/patrol/hold position and stop dummy abilities to cast other abilities.
There's three downsides to this, though:
1) obviously, the abilities need to match the target mode of the command; so make the replacement for move a ground-targeting spell, make attack a unit&ground targeting spell, etc.
2) It applies to all units in the game; so these five spells would be universal for every other player aswell.
3) Those spells can't have a cooldown.

You can also just overwrite the icons and tooltips to a fully black icon and a blank tooltip to just "hide" them visually. You still need to catch the orders, though.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Just a sec... I will upload my concept within one hour.
I am almost sure that this will work perfectly.

EDIT:
Well it is not yet finished and need some polishing but this seems to be right to me.
This system redirects order strings from your dummy (that you have selected) to your hero.
This means that the portrait is your dummy equal as is all the data next to the portrait.
So you need a system that adjusts damage and armor to make it look better.

But here is the map so far.
 

Attachments

  • Custom Movement System.w3x
    22.9 KB · Views: 46
Last edited:
Level 7
Joined
Aug 23, 2014
Messages
208
How would you suggest going about hiding the movement-related commands from a units command card?
You can also try experimental command buttons collapsing from the lab subforum.
It can replace all standart buttons with one in top-left side of command card (Attack/Move/Stop button, based on your map and unit).
However this workaround will collapse command cards for all players and all units.
 
Level 7
Joined
May 11, 2010
Messages
278
You can also try experimental command buttons collapsing from the lab subforum.
It can replace all standart buttons with one in top-left side of command card (Attack/Move/Stop button, based on your map and unit).
However this workaround will collapse command cards for all players and all units.

Interesting. Took a look at the post, might try it out sometime when working on another project.
 
Status
Not open for further replies.
Top