- Joined
- Aug 23, 2014
- Messages
- 208
Command Buttons Stacking |
![]() |
Now you can fix it! Fold unnecessary buttons under top-left corner button and free some space for abilities.
Bonus: hidden buttons are not activated when you press their shortcuts on the keyboard. You can assign a skill shortcut to the vacant key.
Note: these changes will apply to all units and all players, use wisely!
[thread=261633]View tutorial[/thread] or Download DEMO
How to use?
1. Make a copy of Units\CommandFunc.txt file from war3.mpq
2. Open it with Notepad
3. Change lines "Buttonpos=X,Y" to "Buttonpos=-2147483648,-2147483648" for all command buttons you want to stack.
4. Save file
5. Import file in your map
6. Change imported file full path to "Units\CommandFunc.txt" (Right click -> Modify File Properties... -> check Use custom path -> type new path in enabled textbox -> OK)
7. Save map and test how it works!
How to define stacking type?
1. Open Object Editor in World Editor (F6)
2. Open Units tab
3. Select: Standart Units -> Human -> Melee -> Buildings -> Guard Tower (hgtw)*
3.5 Copy it if you want use standart Guard Tower in map later.
4. Modify Standart Guard Tower:
- for Type A stacking you must keep tower attack ability. (when you select tower, you must see Attack button)
- for Type B stacking you must set Movement - Speed Base to 1 (or higher value). (when you select tower, you must see Move button)
4.5 You can change different values to make tower more "dummy", but keep in mind:
- Stats - Is a Building must be TRUE
- If you changing attack, watch attack availability in command card.
- Guard Tower must be visible for all players. However, you can replace model with dummy and make it unselectable with Locust.
5. Place edited Guard Tower on the map.
6. Change ownership of placed Guard Tower to Neutral Passive. (so it will not interfere normal gameplay)
7. Save map and test it!
*If you find an object that overrides Guard Tower, please write it in comments.
Warning! Stacking order is always set to Type A after loading saved game. Keep it in mind if your map uses standart Save/Load.
Important info
- Stacking order depends on placed on the map units at the game start.
- Stacking order does not change during the game.
- Buttons stacking works properly only in 0,0 slot of command card (top-left). Attempts to stack two command buttons in other slots led to crashes.
- Minimal value for start stacking buttons is "Buttonpos=-2147483648,-2147483648" (closer to 0 values lead to crashes in some situations, still not sure what effect have closer to -inf values).
- Hidden in the stack buttons can not be activated via shortcuts. Only displayed buttons work.
- This method changes command card for all units and all players.
- It seems that this method does not cause game crashes. Nevertheless, I advise to use it with caution as all "hacks".
Button stacking order from uppermost to the bottom for the normal unit
Type A |
|
|
|
|
|
Position |
abilities | |||||||||
Type B |
|
|
|
Position |
|
|
abilities |
Button stacking order for stationary unit (Movement - Speed Base = 0)
Type A |
|
|
|
abilities | ||||||
Type B |
|
|
|
abilities |
Button stacking order for unit without attacks (Combat - Attacks Enabled = None)
Type A |
|
|
|
Position |
abilities | |||||
Type B |
|
|
|
Position |
abilities |
Button stacking order for unit with hidden attacks (Combat - Attack 1&2 - Show UI = false)
Type A |
|
|
|
|
Position |
abilities | |||||||
Type B |
|
|
|
Position |
|
abilities |
[CmdMove]
Art=CommandMove
Buttonpos=-2147483648,-2147483648
[CmdAttack]
Art=CommandAttack
Buttonpos=-2147483648,-2147483648
[CmdAttackGround]
Art=CommandAttackGround
Buttonpos=-2147483648,-2147483648
[CmdBuild]
Art=CommandBasicStruct
Buttonpos=0,2
[CmdBuildHuman]
Art=CommandBasicStructHuman
Buttonpos=0,2
[CmdBuildOrc]
Art=CommandBasicStructOrc
Buttonpos=0,2
[CmdBuildNightElf]
Art=CommandBasicStructNightElf
Buttonpos=0,2
[CmdBuildUndead]
Art=CommandBasicStructUndead
Buttonpos=0,2
[CmdCancel]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelBuild]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelTrain]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelRevive]
Art=CommandCancel
ButtonPos=3,2
[CmdHoldPos]
Art=CommandHoldPosition
Buttonpos=-2147483648,-2147483648
[CmdPatrol]
Art=CommandPatrol
Buttonpos=-2147483648,-2147483648
[CmdPurchase]
Art=CommandPurchase
Buttonpos=0,0
[CmdRally]
Art=CommandRally
Buttonpos=3,1
PlacementModel=UI\Feedback\RallyPoint\RallyPoint.mdl
[CmdSelectSkill]
Art=CommandNewSkill
Buttonpos=-2147483648,-2147483648
[CmdStop]
Art=CommandStop
Buttonpos=-2147483648,-2147483648
//[CmdUnivAgi]
//Art=
//Buttonpos=2,0
//[CmdUnivInt]
//Art=
//Buttonpos=1,0
//[CmdUnivStr]
//Art=
//Buttonpos=0,0
Art=CommandMove
Buttonpos=-2147483648,-2147483648
[CmdAttack]
Art=CommandAttack
Buttonpos=-2147483648,-2147483648
[CmdAttackGround]
Art=CommandAttackGround
Buttonpos=-2147483648,-2147483648
[CmdBuild]
Art=CommandBasicStruct
Buttonpos=0,2
[CmdBuildHuman]
Art=CommandBasicStructHuman
Buttonpos=0,2
[CmdBuildOrc]
Art=CommandBasicStructOrc
Buttonpos=0,2
[CmdBuildNightElf]
Art=CommandBasicStructNightElf
Buttonpos=0,2
[CmdBuildUndead]
Art=CommandBasicStructUndead
Buttonpos=0,2
[CmdCancel]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelBuild]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelTrain]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelRevive]
Art=CommandCancel
ButtonPos=3,2
[CmdHoldPos]
Art=CommandHoldPosition
Buttonpos=-2147483648,-2147483648
[CmdPatrol]
Art=CommandPatrol
Buttonpos=-2147483648,-2147483648
[CmdPurchase]
Art=CommandPurchase
Buttonpos=0,0
[CmdRally]
Art=CommandRally
Buttonpos=3,1
PlacementModel=UI\Feedback\RallyPoint\RallyPoint.mdl
[CmdSelectSkill]
Art=CommandNewSkill
Buttonpos=-2147483648,-2147483648
[CmdStop]
Art=CommandStop
Buttonpos=-2147483648,-2147483648
//[CmdUnivAgi]
//Art=
//Buttonpos=2,0
//[CmdUnivInt]
//Art=
//Buttonpos=1,0
//[CmdUnivStr]
//Art=
//Buttonpos=0,0
What can you do with it?
AZERTY friendly spell layout for 8 spells
|
Layout with 11 free slots (10+1 for heroes)
| |||
![]() | ![]() | Configure as you wish! | ||
What do you think about this discovery?
After a bit of playing with large values in imported Units\CommandFunc.txt I received a very interesting result:

As you can see part of the standard buttons removed from the panel. Proof map: View attachment TestCmdButtons.w3x
It happened when I set Buttonpos to extremely low values -9999999999,-9999999999. It seems that buttons with this values doesn't displayed on the panel. After some experimentation I found what only "Move" button can not be removed from panel. Also I noticed that hidden buttons doesn't react on shortcuts.
At first glance, the game does not crash when selecting a unit. But most likely, this method has pitfalls, as all hacks. Need more testing to find them. (Found literally two hours ago)
[CmdMove]
Art=CommandMove
Buttonpos=0,0
[CmdAttack]
Art=CommandAttack
Buttonpos=1,0
[CmdAttackGround]
Art=CommandAttackGround
Buttonpos=1,0
[CmdBuild]
Art=CommandBasicStruct
Buttonpos=0,2
[CmdBuildHuman]
Art=CommandBasicStructHuman
Buttonpos=0,2
[CmdBuildOrc]
Art=CommandBasicStructOrc
Buttonpos=0,2
[CmdBuildNightElf]
Art=CommandBasicStructNightElf
Buttonpos=0,2
[CmdBuildUndead]
Art=CommandBasicStructUndead
Buttonpos=0,2
[CmdCancel]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelBuild]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelTrain]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelRevive]
Art=CommandCancel
ButtonPos=3,2
[CmdHoldPos]
Art=CommandHoldPosition
Buttonpos=-9999999999,-9999999999
[CmdPatrol]
Art=CommandPatrol
Buttonpos=-9999999999,-9999999999
[CmdPurchase]
Art=CommandPurchase
Buttonpos=0,0
[CmdRally]
Art=CommandRally
Buttonpos=3,1
PlacementModel=UI\Feedback\RallyPoint\RallyPoint.mdl
[CmdSelectSkill]
Art=CommandNewSkill
Buttonpos=3,0
[CmdStop]
Art=CommandStop
Buttonpos=-9999999999,-9999999999
//[CmdUnivAgi]
//Art=
//Buttonpos=2,0
//[CmdUnivInt]
//Art=
//Buttonpos=1,0
//[CmdUnivStr]
//Art=
//Buttonpos=0,0
Art=CommandMove
Buttonpos=0,0
[CmdAttack]
Art=CommandAttack
Buttonpos=1,0
[CmdAttackGround]
Art=CommandAttackGround
Buttonpos=1,0
[CmdBuild]
Art=CommandBasicStruct
Buttonpos=0,2
[CmdBuildHuman]
Art=CommandBasicStructHuman
Buttonpos=0,2
[CmdBuildOrc]
Art=CommandBasicStructOrc
Buttonpos=0,2
[CmdBuildNightElf]
Art=CommandBasicStructNightElf
Buttonpos=0,2
[CmdBuildUndead]
Art=CommandBasicStructUndead
Buttonpos=0,2
[CmdCancel]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelBuild]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelTrain]
Art=CommandCancel
ButtonPos=3,2
[CmdCancelRevive]
Art=CommandCancel
ButtonPos=3,2
[CmdHoldPos]
Art=CommandHoldPosition
Buttonpos=-9999999999,-9999999999
[CmdPatrol]
Art=CommandPatrol
Buttonpos=-9999999999,-9999999999
[CmdPurchase]
Art=CommandPurchase
Buttonpos=0,0
[CmdRally]
Art=CommandRally
Buttonpos=3,1
PlacementModel=UI\Feedback\RallyPoint\RallyPoint.mdl
[CmdSelectSkill]
Art=CommandNewSkill
Buttonpos=3,0
[CmdStop]
Art=CommandStop
Buttonpos=-9999999999,-9999999999
//[CmdUnivAgi]
//Art=
//Buttonpos=2,0
//[CmdUnivInt]
//Art=
//Buttonpos=1,0
//[CmdUnivStr]
//Art=
//Buttonpos=0,0
Found a way to hide ALL standart command buttons! Proof map: View attachment HideAllCmdButtons.w3x (for demonstration purposes there are all command buttons hidden, even Hero Abilities and Cancel)
If you set "Buttonpos=9999999999,-9999999999" to button in "Units/CommandFunc.txt" it will dissapear from command card of all units!
Side effect: hidden buttons can not be activated via shortcuts. Thus it is possible to make Friendly Fire protection with removing attack button.
[CmdPatrol]
Art=CommandPatrol
Buttonpos=9999999999,-9999999999
Art=CommandPatrol
Buttonpos=9999999999,-9999999999
Command Button | Name in CommandFunc.txt | Can hide? |
Move[td][CmdMove] | Yes | |
Attack[td][CmdAttack] | Yes | |
Attack Ground | [CmdAttackGround] | Yes |
Build Structure | [CmdBuild] | World Editor |
Build Structure | [CmdBuildHuman] | World Editor |
Build Structure | [CmdBuildOrc] | World Editor |
Create Building | [CmdBuildNightElf] | World Editor |
Summon Building | [CmdBuildUndead] | World Editor |
Cancel (in Spellbook, etc) | [CmdCancel] | Yes |
Cancel | [CmdCancelBuild] | Yes |
Cancel | [CmdCancelTrain] | Yes |
Cancel | [CmdCancelRevive] | Yes |
Hold Position | [CmdHoldPos] | Yes |
Patrol | [CmdPatrol] | Yes |
Didn't find what is it | [CmdPurchase] | ??? |
Set Rally Point | [CmdRally] | World Editor |
Hero Abilities | [CmdSelectSkill] | Yes |
Stop | [CmdStop] | Yes |
Keep in mind that these changes affect all units on the map.
Also, I do not recommend removing cancel buttons, because it disables ESC button and may be frustrating in some cases.
UPD: Interesting. When it tested from JNGP multiplayer emulation everything works fine, but in normal warcraft III game it causes memory error and game close when selecting a unit. Hmm... Looks like big positive values in Buttonpos makes game adress something into wrong memory section. So this approach is too dangerous.
Extreme values also repeat standart button layout, so you can stack all 5(7?) unit command buttons into any position.
Buttonpos=X,Y
Also, this approach doesn't crash my game yet. So maybe it's safe (still need more tests).
Buttonpos=X,Y
-2147483648 | -2147483647 | -2147483646 | -2147483645 | X / Y |
-2147483648 | ||||
-2147483647 | ||||
-2147483646 |
After some experimentation with extreme values of 32-bit integer I found something interesting. Buttons with low values are not sorted automatically. They overlap eachother. The uppermost icon depends on some unknow yet reasons (suspect that it depends on first loaded in the memory unit, if it can move - first will be Move, if it can only attack - Attack). Some facts:
- If there are guard tower (or any other building of this type) at the beginning of the map, icons will be: Attack for battle units, and Stop for units without attack.
- If there are only units (even stationary with attacks), uppermost icon will be Move, and Stop for stationary units.
- Uppermost icons are same for all players and they depend on the placed on the map objects.
- Icons order will be fixed during the game, even if you build guard tower with starting top Move button. However, if you Save and then Load game with builded towers, your uppermost icon will be Attack.
- If a player has Attack orders on the top: units with hidden attack (Show UI - false) will have Stop button at the top; siege units with hidden siege attacks will have Attack Ground button at the top, but it doesn't interactive (you can not select area for AoE attacks, just like in normal map); stationary units with hidden attack will have all 12 slots free (just like in normal map).
- If there are guard tower (or any other building of this type) at the beginning of the map, icons will be: Attack for battle units, and Stop for units without attack.
- If there are only units (even stationary with attacks), uppermost icon will be Move, and Stop for stationary units.
- Uppermost icons are same for all players and they depend on the placed on the map objects.
- Icons order will be fixed during the game, even if you build guard tower with starting top Move button. However, if you Save and then Load game with builded towers, your uppermost icon will be Attack.
- If a player has Attack orders on the top: units with hidden attack (Show UI - false) will have Stop button at the top; siege units with hidden siege attacks will have Attack Ground button at the top, but it doesn't interactive (you can not select area for AoE attacks, just like in normal map); stationary units with hidden attack will have all 12 slots free (just like in normal map).
Attachments
Last edited: