Placeholders & Message Formatting

Updated 2 months ago

Placeholders & Message Formatting

ScarletHooks allows you to fully customize the format and prefix of all chat and login/logout messages sent to webhooks. This is done via the configuration file (ScarletHooks.cfg) using special placeholders that are replaced with real values at runtime.


Available Placeholders

You can use the following placeholders in your message formats and prefixes:

Placeholder Description Example Value
{playerName} The name of the player sending the message Dracula
{clanName} The name of the player's clan (if any) NightStalkers
{targetName} The name of the whisper message recipient Vlad

Example: Message Formats

Below are the default formats and how placeholders are used:

  • Login Message:

    LoginMessageFormat = {playerName} has joined the game.
    

    Output:
    Dracula has joined the game.

  • Logout Message:

    LogoutMessageFormat = {playerName} has left the game.
    

    Output:
    Dracula has left the game.

  • Global Chat Prefix:

    GlobalPrefix = [Global] {playerName}:
    

    Output:
    [Global] Dracula: Hello everyone!

  • Local Chat Prefix:

    LocalPrefix = [Local] {playerName}:
    

    Output:
    [Local] Dracula: Anyone nearby?

  • Clan Chat Prefix:

    ClanPrefix = [Clan][{clanName}] {playerName}:
    

    Output:
    [Clan][NightStalkers] Dracula: Let's meet at the castle.

  • Whisper Prefix:

    WhisperPrefix = [Whisper to {targetName}] {playerName}:
    

    Output:
    [Whisper to Vlad] Dracula: Watch out!


How to Customize

  1. Open BepInEx/config/ScarletHooks.cfg in a text editor.
  2. Find the relevant format or prefix setting under the [Customization] section.
  3. Edit the string, using any combination of the placeholders above.
  4. Save the file.
  5. Reload settings in-game with .hooks reload settings or restart your server.

Tips

  • You can add any text, around the placeholders.
  • If a placeholder is not available for a certain message type, it will be left as it is.
  • For best results, avoid using curly braces {} for anything other than placeholders.

Troubleshooting

  • If your messages are not formatted as expected, double-check for typos in placeholder names.
  • After editing the config, always reload settings or restart the server.
  • If you use a placeholder that is not supported for a specific message type, it will be ignored.