WIP Do you want to build a campfire - ironmonk108/monks-module-wiki GitHub Wiki
This page will walkthrough various levels of building a campfire, starting at extremely basic, and going well past what's actually needed for your average campfire.
These first few steps are basic options you can use to configure your tile.

- On the Setup tab, remove any existing trigger and add the
Double-Clicktrigger. - Add your images to the
Imagestab. In my example here, the first image is the unlit one, while the second image is the lit one.- If you use this same image order, take the time to swap to the lights layer and turn the light off so that the image and the light are synced.
- Add a Switch Tile Image, targeting the tile itself. For now, leave the
Change tofield onnext. - Add an Activate/Deactivate action; this example Uses Tagger to target a light that has the matching tag
Lighton it. Change theStatedropdown toTogglefor now.
Now the tile image should be synced up with the light and your campfire has a basic on/off button.

What if you don't want your players controlling the campfire from all the way across the map? Then add a Filter Tokens by Distance.
- Add the Filter Tokens by Distance at the top of the action thread; while you can use
Current Tokenat this stage, it should be targeting theTriggering Tokento future proof this action, and just to make it a habit. Leave the other settings of this filter on the defaults for now.

Now we're going to branch the action flow; if there isn't a triggering token close enough to the tile, it will instead send that player a notification.
- Change your Filter Tokens by Distance's
Continue Ifdropdown toAlways Continue. - Add a Check Entity Count into the action list after the distance filter; it needs to be
Current Tokenshere, to tell the action flow to see if aCurrent Tokenexists that made it through the previous filter.- The count field should stay at
> 0. - The
Go Tofield should be the name of a Landing that the action list will go to if the count isn't found. Capitalization and symbols matter.
- The count field should stay at
- Add a Landing at the end of the action thread.
- Check the
Stop When Reached in Codebox on the landing; this makes the landing create an entirely new action thread, instead of being an extension of the original one above it.
- Check the
- Add a Send Notification in the new action thread created by this landing.

For the final beginner step, we're going to add an Auto-Landing that allows the Gamemaster to skip the distance filter so that they can toggle the fire even without controlling a token nearby.
The GM will always start at this landing when triggering the tile in this setup, as it is the first valid auto-landing in this action sequencing for them.
- Add another Landing below the Check Entity Count.
- Name it
_gm; this auto-landing will cause any Gamemaster level users to automatically start in the action list at this point and skip the distance filter. - Leave
Stop When Reached in Codeunchecked this time; this will allow the action thread to continue from above.
- Name it
Adding various filters and jumps to complicate things. The action list view will be imitated using multiple tile windows due to the size limit of the window.

Now let's add different dialogs with options depending on the current state of the campfire.
- Add a Jump to Landing below the
_gmauto-landing. This needs to be named{{tile.flags.monks-active-tiles.fileindex}}to make use of Handlebar Expressions. When this jump is reached in the code, the handlebar expression will be replaced with this tile's file index value, which will be either 0 (for the first, unlit image) or 1 (for the second, lit image).- While the images start being numbered at
1for the purposes of Switch Tile Image, due to how arrays work in code, the first image is actually number0here, and the second image is1. -
{{tile.flags.monks-active-tiles.fileindexthetile.part tells the expression to look at the tile, whileflags.monks-active-tiles.fileindex}}is the flag whose value is being used here.
- While the images start being numbered at
- Add another Landing and name it
0. This will be the landing that is jumped to when the campfire is unlit.- It does not matter whether
Stop When Reached in Codeis checked in this instance, as it will never be reached by following the code normally as the jump just above it redirects the code.
- It does not matter whether
- Place a Show Dialog in this action thread.
- Use the
Customtype in the Dialog Type dropdown. - Use
Add Buttonsto add two buttons; the "Light the fire" one should include a Landing name that matches the landing we'll be adding later. The "Do nothing" button can leave the landing name blank, as it doesn't need to go anywhere.
- Use the
- Add another Landing and name it
0. This will be the landing that is jumped to when the "Light the fire" button is pressed in the previous dialog.-
Stop When Reached in Codedoes matter here; otherwise if the dialog is closed without making a choice the action thread will continue down from the dialog and light the campfire.
-
- Move your Activate/Deactivate and Switch Tile Image to this "Light" landing.
- Change the Switch Tile Image from
nextto2to match the images tab. - Change the Activate/Deactivate from
ToggletoActivate,
- Change the Switch Tile Image from
- Repeat steps 2 through 5, adjusting names & settings to instead extinguish the campfire.

- Add a Filter by Items in Inventory underneath the "Light" landing; this should again be
Triggering Token. - Follow it up with another Check Entity Count; this should once again be
Current Tokens.- The
Go Tofield needs to include the name of the landing being created in step 3.
- The
- Add another Landing at the end, then put another Send Notification here to warn the user they lack the item needed to start the fire.
- Make sure the name matches the Check Entity Count from step 2.
-
Stop When Reached in Codeshould be checked, otherwise the "Not Close Enough" action thread will continue into this one.
- Optional. Add the same kind of filter setup to the "Extinguish" landing to make sure your players actually have water to put the fire out.

If we want the Gamemaster to be able to bypass the item filter we just added, Redirect Based on Player Type will need to be used here.
- Add a Redirect Based on Player Type under the "Light" landing.
-
GM Redirectneeds to go to a landing that will be placed after the Filter by Item & it's Check Entity Count. -
Player Redirectneeds to go to a landing that will be placed before the Filter & Check.
-
- Add the landings in their respective locations.
-
Stop When Reached in Codecannot be checked on on theGM Redirectlanding; thePlayer Redirectlanding does not matter either way if your setup matches what is shown here.
-

We're going to add some Set Active Tile Variable in the "Light" & "Extinguish" action threads to prepare for a later step.
- Add your Set Active Tile Variable for each action thread.
- "Light" should set it to
= 1. - "Extinguish" should set it to
= 0.
- "Light" should set it to

Maybe your players have access to chemicals or a magic item that allows them to change the fire color; let's add that option to the dialog that shows while the fire is burning.
- Go to the Show Dialog action underneath the "1" landing, and add a third button to jump to a "Color" landing.
- Create a new landing, "Color" at the end of the action list.
- Underneath "Color", add another Show Dialog.
- This one's content field needs to contain the following HTML:
<form>
<div>Please select the color for your fire.</div>
<div class="flexrow">
<input type="color" name="hexcode" />
</form>
- Add an Alter action following the Show Dialog.
- The attribute here needs to be
config.color(As of time of this writing in V11). - The value field needs to be
= "{{value.hexcode}}"to use the value provided by the dialog's input.
- The attribute here needs to be