Macro (Slash Command): Difference between revisions

From Homecoming Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{SlashCommandArticle
{{SlashCommandArticle
|command=macro
|command=macro
|options=name "command"
|options=name command
|note=''name'' should be replaced with a character string to describe the macro, such as ''GO'' or ''Cheer''.
|note=Create a macro.


''command'' should be one or more [[Slash Commands]].  The "" (quotation) marks are not required, except around the ''command'' parameter when using more than one command.}}
 
*'''name''' should be replaced with a character, word, or phrase to describe the macro, such as ''GO'' or ''Cheer''. The name will appear on the macro button itself.
*'''command''' should be one or more [[Slash Commands]].   
*The parameters (''name'' or ''command'') must be enclosed within quotation marks (" ") if either contains a blank space.}}
{{clr}}
{{clr}}
== Introduction to Macro Commands ==
== Introduction to Macro Commands ==
Line 68: Line 71:
(This text was adapted from mudflapgirl's [[https://www.reddit.com/r/Cityofheroes/comments/c0tu6u/howto_macro_icons/|| post on Reddit]])
(This text was adapted from mudflapgirl's [[https://www.reddit.com/r/Cityofheroes/comments/c0tu6u/howto_macro_icons/|| post on Reddit]])


You can give your macros ''icons'' instead of having it be a grey circle with words with the [[macro_image]] command. The format for the command is:
You can give your macros ''icons'' instead of having it be a grey circle with words with the {{slashcommand|macro_image}} command. The format for the command is:


<code>/macro_image "Image_Name" "Tooltip Text" "Command"</code>
<code>/macro_image "Image_Name" "Tooltip Text" "Command"</code>
Line 129: Line 132:


ADVANCED TIP: By using macros stored in text files in combination with the {{slashcommand|bind_load_file}} and {{slashcommand|Macroslot}} commands, complex rotating text macros can be created (very similar to text binds). This allows one macro to replace another macro in the same power tray slot. Basically, it lets the same button do different things on each click. For more information see https://forums.homecomingservers.com/topic/35087-introducing-text-macros/  
ADVANCED TIP: By using macros stored in text files in combination with the {{slashcommand|bind_load_file}} and {{slashcommand|Macroslot}} commands, complex rotating text macros can be created (very similar to text binds). This allows one macro to replace another macro in the same power tray slot. Basically, it lets the same button do different things on each click. For more information see https://forums.homecomingservers.com/topic/35087-introducing-text-macros/  
== See Also ==
* [[The Incomplete and Unofficial Guide to /bind]]




{{Navbox Binds}}
{{Navbox Binds}}
 
[[Category:Bind Commands]]
[[Category:Slash Commands]]
[[Category:Slash Commands]]

Latest revision as of 20:04, 1 August 2023

/macro name command

Create a macro.


  • name should be replaced with a character, word, or phrase to describe the macro, such as GO or Cheer. The name will appear on the macro button itself.
  • command should be one or more Slash Commands.
  • The parameters (name or command) must be enclosed within quotation marks (" ") if either contains a blank space.


Introduction to Macro Commands

Macros in City of Heroes/Villains are an excellent way to bind frequently used powers, actions, or text in a simple button, just like any power button. Macros are very flexible, making for a near endless variety of options. But, macros are not a way to set up complex attack chains. Checking this guide, as well as some helpful links, hopefully you, too, can master this medium of control.

Names and Icons

Names can be anything you wish, although only a limited amount of text can be shown in the macro icon. However, the full text always appears in tooltips. The icon appears as a generic grey button with your text overlaid. After creating a macro, the name cannot be changed, although the command string may be edited by right clicking the icon and selecting "Edit".

Alternatively, pet command icons can be used. In this case, the name of the original pet command will show up in tooltips. To use this trick as a character without pets, begin in a gladiator match at the Arena. When using the pet command window (turn this on in options if you don't already have it), you can drag the icons to your power tray and then edit it the same as a grey-icon macro.

Commands

Anything that can be used as a slash command can be bound as a macro. Remember that when binding or macroing commands, the slash is assumed, and not typed out. To utilize multiple commands using one macro, type two dollar signs <$$> between the commands.

For a more detailed explanation, please read The Incomplete and Unofficial Guide to /bind. Everything in that article concerning slash commands applies to macros as well.

Creating a Macro

The basic syntax for a Macro command is as follows:
/macro "macro name" "command"

For this example, we will create an elaborate macro that will

/macro dom "emote bowdown$$local You're making me mad!$$powexec_name domination$$cc 2"

Using simple commands, you can create a long string of actions. However, take care creating these, as editing complex macros can be difficult.

Additional Examples

All of the following are valid uses of the /macro.

/macro GO local Let's go, team!

Note the lack of quotation marks: There is only one command, so they are unnecessary.
Creates a macro labeled GO that causes the character to say "Let's go team!" on the local channel.

/macro SG "sgmode"

Note the quotation marks: Even if there is only one command, you can still use quotes to enclose the command.
Creates a button for your power tray that toggles SG mode on and off.

/macro getfunky "petsay_all <em dance>"

This macro will cause all of a Mastermind's pets to perform random dance emotes. The full name will not display on the icon, but the tooltip will show the complete label.

/macro TP "team Bringing $target close to me!$$powexec_name recall friend"

Creates a macro called TP. It will cause your character to name their current target on the team channel and use the recall friend power aimed at this target.

/Macro Slappy "e slap$$e smack"

Note the quotation marks: There are two commands, so they must be enclosed in quotes.
Only one animation can be triggered by a single use of a macro, but in certain combinations, a macro like this will alternate between emotes as you activate the macro over and over. In this case, you will alternate between backhand and fronthand slaps. Most combinations of emotes will not work this way. Those combinations which do work are usually very closely related.

/macro Bat "e batsmash$$powexec_name Brawl"

In this case, an emote animation is coming into conflict with a power animation. There are very few powers in the game whose animations can be overwritten by an emote. It requires trial and error to find out if a power can be overwritten. What will happen in the case of this example is that the batsmash animation will play if the Brawl power is not ready or if you have no target, but if Brawl is ready and you have a valid target in range, you will see the Brawl animation and not the batsmash animation.

Adding icons to your macro

(This text was adapted from mudflapgirl's [post on Reddit])

You can give your macros icons instead of having it be a grey circle with words with the /macro_image command. The format for the command is:

/macro_image "Image_Name" "Tooltip Text" "Command"

A 'Tooltip' is the text that appears when the mouse pointer hovers over the icon.

For example, a costume change macro is created with

/macro_image "Inherent_KnightsBastion" "Costume 2" "cc 1"

This can also be used to open custom popmenu commands.

/macro_image "Teleport_LongRangeTeleport" "Teleports" "popmenu Teleports"


You can put whatever you want in there though. Masterminds can have

/macro_image "PetCommand_Action_Bodyguard" "Bodyguard" "petcom_all follow defensive"

/macro_image "PetCommand_Action_Dismiss" "Dismiss" "petcom_all dismiss"

if they want to complete the set.


The icons have to be 32x32 and in the game files to fit properly - you can't use a square of your face or anything. To find them, you'll need to download a .pigg viewer and find the icons. At least on Homecoming i25+, powers are in stage1b.pigg, texture_library/GUI/Icons/Powers. I don't know where inspiration or enhancement icons are because I found what I liked in powers and stopped looking, but "Inspiration_Damage_Lvl_4" is the big damage insp, so you might be able to figure a couple out.

[This Google sheet contains a lot of the icons that are in the game].

[guides from Shenanigunner have some information as well] see [forum post]

The Macro image (Slash Command) page includes tables with the icons from the above two sources. The tables contain updated versions of several icons and also add a number of missing icons, from both the original live game data and from the Homecoming game data.

Storing and Transferring Macros

There is an undocumented and unsupported way to store multiple macros in a text file. Not only is this useful for documenting macros, but it also allows you to easily import the same macros onto different characters.

There is no way for the game to save macros to a text file for you, so you'll have to do it manually. Open a plain text editor (Notepad on Windows or TextEdit on Mac) and type in your macros. You're going to write one, long command line, and string the different macros together. The command string must always start with double dollar signs ($$). This tells the game there are more commands to come. The double dollar signs ($$) also separate one macro from another. After that just type in your macro commands as you normally would in game and save the file.

For example, let's say I have these 3 macros I want saved:

/macro Hi "emote wave"
/macro Yes "emote thumbsup"
/macro Dance "emote dance"

In the text file, string the commands together like this:

$$macro Hi "emote wave"$$macro Yes "emote thumbsup"$$macro Dance "emote dance"

Save the text file in your binds directory/folder or anywhere you like. The limit on how many macros you may store in a text file is unknown. However, each individual macro is limited to 255 characters.


How To Load Saved Macros

Just use the /bind_load_file command to tell the game to import all of your macros. In the chat window, type:

/bind_load_file z:\Applications\COH\binds\Macros.txt (or whatever the name and path of your macro text file is) 

Your macros will instantly be added to the first available slots in your power trays.


ADVANCED TIP: By using macros stored in text files in combination with the /bind_load_file and /Macroslot commands, complex rotating text macros can be created (very similar to text binds). This allows one macro to replace another macro in the same power tray slot. Basically, it lets the same button do different things on each click. For more information see https://forums.homecomingservers.com/topic/35087-introducing-text-macros/

See Also