Custom window (Slash Command)

From Homecoming Wiki
Jump to navigation Jump to search

SlashCommand

/custom_window name

This command creates a persistent, macro-holding window.

The /custom_window command, if not setup first, will initially create a temporary custom window that will disappear when the game is restarted. However, the real value of a custom window is that it can be made persistent. Meaning, it will automatically appear for every account on every character, new or old.

Creating the Custom Window

Before using the command, create a text file named custom.window using all lower case letters. You can use any plain text editor app to do this. For example, Notepad (in Windows) or TextEdit (in MacOS).

Syntax

Inside the text file type:

Window "MyCustomWindowName" 0 0 200 100
	Button "ButtonName" "<commands>"
	Open 1
End
  • Window tells the game this is a new window.
    • "MyCustomWindowName" is a user variable that defines the name of the custom window.
    • The first 2 digits define the location of the custom window on the screen, expressed as decimals. These coordinates are dynamically updated as you click and drag the window across the screen, so you really don't have to mess with these.
    • The last 2 numbers define the size of the custom window. The size is dynamically updated as you resize the window in game, so you really don't have to mess with these either.
  • Button tells the game to create a button.
    • "ButtonName" defines the name of the button.
    • "<commands>" are the slash commands to be executed when the button is clicked (without the brackets < >). They follow the same syntax rules as binds or macros.
  • Open 1 makes a button to create a new, blank button while in game.
  • End tells the game this is the end of the custom window script.


Note: In front of the Button and Open 1 commands is a tab character (unicode: U+0009) that is required for the custom window script to function properly.


Save the text file in the following folder (in all lowercase letters):

<COH_INSTALL_DIRECTORY>\data\customwindows\

If the directories/folders do not exist, then create them. If you don't know the location of the COH Install Directory on your hard drive, go in game and in the chat box type:

/bindloadfile \

This will give you the location of the game's default home folder in the Global chat window as part of an error message, but it also points you to the general location of your COH Install Directory.


Now log into the game, and in the chat box type

/custom_window "MyCustomWindowName"

A small box will appear in the upper left corner of the screen. Click on it and the custom window will open.

Drag the custom window to any location on your screen. Grab the edges of the custom window to resize it.


Adding Macros to the Window

Simply drag and drop any macro from your power trays into the custom window and a button will automatically be created with the macro's commands. Alternately, you can use the "Open 1" button in the custom window to create a macro.

Right-clicking on any button within the custom window will allow you to Edit the button's name, Edit the button's commands, or delete the button. You can also drag and drop a button back into your power trays as a macro.


Notes

  • Additional custom windows can be created using the custom_window slash command. Simply use a different name for the new custom window while in game. The new custom window will be automatically added to the custom.window file.
  • There's no command to destroy one of these additional custom windows yet, so you still need to text-edit the file to get rid of them.
  • Custom windows can be made even more valuable by placing Popmenus inside of them using a macro with the /popmenu command.
  • TIP: The custom.window text file requires some very specific formatting to work. It's best to use the custom_window command in game before you attempt to edit the file manually, which in turn will reset the text file you created into the correct format. Then you can use a text editor and just copy/paste the formatting within the corrected file if you want to edit the file manually. Be aware that if the text file is incorrectly formatted, that the custom_window command will completely overwrite it, re-set it, and delete any data already inside the file.
  • If the command string contains spaces, the entire command portion must be enclosed in either quotation marks ("    "), or less-than/greater-than brackets and ampersands (<&    &>). This last option is especially useful if multiple quotation marks are generating errors in the command. For example: Option "Celebrate" <&emote dance$$local "Let's Party!"&> will work, but Option "Celebrate" "emote dance$$local "Let's Party!"" will not.
  • Inspiration and power names with spaces can be used in commands by replacing the spaces with an underscore (for example, Catch_a_Breath).
  • When using a command that sends a message, any spaces in the message portion can be replaced by the HTML code for a non-breaking space &nbsp; in order to avoid enclosing the message in quotation marks.
  • Custom Windows are a publicly undocumented and unsupported feature of the game.


See Also

External Links

This process was first detailed in 2015 by @Leandro here https://www.cohtitan.com/forum/index.php?topic=11080.msg186612#msg186612