Starting a zone from a chat message
Your event plugin already announces itself in chat:
KoTH * The Japan KoTH has begun!SomaHider can read that announcement and start the zone by itself. There is nothing to connect between the two plugins. SomaHider simply watches chat go by, and when a message looks like the one you showed it, it starts or stops the zone.
Each zone can have two of these:
| Setting | What it does |
|---|---|
start_on_chat | The message that starts the zone. |
stop_on_chat | The message that stops it. |
You do not have to write them by hand. SomaHider can build them from a real message.
Capture a message and turn it into a trigger
Section titled “Capture a message and turn it into a trigger”-
Start listening.
/sh captureSomaHider now writes down every chat message for the next 60 seconds. Run
/sh capture stopif you are done sooner. -
Make the message appear.
Start your event, or wait for it to start on its own. Anything that goes through chat during the 60 seconds is caught.
-
Look at what was caught.
/sh capture listEvery message is listed with a number in front of it. In game you can click a line directly and skip to the next step.
-
Pick the line and the zone.
/sh capture use 3 kothjapon startRead it as: take message number 3, and make it the thing that starts the zone
kothjapon. Usestopat the end instead ofstartfor the closing message.
That is it. The zone now starts whenever that message appears.
Make it work every time, not just once
Section titled “Make it work every time, not just once”There is one catch. SomaHider saved the message exactly as it was, and event announcements usually contain a part that changes from one run to the next.
Take the closing message:
KoTH * The Japan KoTH is over. Fate wins the event.Next week the winner will not be Fate, so the message will be slightly different and the zone will not stop. You need to tell SomaHider that this part can be anything.
Open zones.yml, find your zone, and replace the part that changes with .*:
zones: kothjapon: triggers: start_on_chat: '&6&lKoTH &f* The &7Japan &fKoTH has begun!' stop_on_chat: '&6&lKoTH &f* The &7Japan &fKoTH is over\. &6.* &fwins the event\.'.* means “anything can be here”. The faction name became &6.*, so any winner matches now.
Then apply it:
/sh reloadCheck that it worked
Section titled “Check that it worked”/sh info kothjaponThe zone details include the triggers that are registered. If a trigger is missing here, SomaHider could not read it, and the reason is in the server log.
Keep players from starting your zones
Section titled “Keep players from starting your zones”A trigger is compared against every chat message, and that includes messages players type themselves.
So if your trigger is a plain sentence with no colours in it, any player can copy that sentence into chat and start or stop your zone whenever they feel like it.
SomaHider warns you when this is the case:
zones.yml: zones.arena: triggers.start_on_chat has no color codes, any player could fire it from chatThe fix takes a second: keep at least one colour code from the original announcement in your trigger.
In the example above, &6&lKoTH and &f are colour codes. Players cannot type colour codes into
chat, so a trigger that contains one cannot be faked.
If you deleted them while editing, capture the message again and keep more of it this time.
One thing that will not work
Section titled “One thing that will not work”A zone with always_on: true runs permanently, so there is nothing to start or stop. SomaHider
ignores triggers on such a zone and says so in the log, and /sh capture use refuses it.