Skip to content

WIP Do you want to build a campfire

Crowguard edited this page Dec 19, 2023 · 38 revisions

Do You Want to Build a Campfire?

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.

Beginner

These first few steps are basic options you can use to configure your tile.

Base Campfire

  1. On the Setup tab, remove any existing trigger and add the Double-Click trigger.
  2. Add your images to the Images tab. 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.
  3. Add a Switch Tile Image, targeting the tile itself. For now, leave the Change to field on next.
  4. Add an Activate/Deactivate action; this example Uses Tagger to target a light that has the matching tag Light on it. Change the State dropdown to Toggle for now.

Now the tile image should be synced up with the light and your campfire has a basic on/off button.

Add a Distance Filter

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.

  1. Add the Filter Tokens by Distance at the top of the action thread; while you can use Current Token at this stage, it should be targeting the Triggering Token to future proof this action, and just to make it a habit. Leave the other settings of this filter on the defaults for now.

Add a "Not Close Enough" Branch

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.

  1. Change your Filter Tokens by Distance's Continue If dropdown to Always Continue.
  2. Add a Check Entity Count into the action list after the distance filter; it needs to be Current Tokens here, to tell the action flow to see if a Current Token exists that made it through the previous filter.
    • The count field should stay at > 0.
    • The Go To field should be the name of a Landing that the action list will go to if the count isn't found. Capitalization and symbols matter.
  3. Add a Landing at the end of the action thread.
    • Check the Stop When Reached in Code box on the landing; this makes the landing create an entirely new action thread, instead of being an extension of the original one above it.
  4. Add a Send Notification in the new action thread created by this landing.

Add a GM Auto-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.

  1. 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 Code unchecked this time; this will allow the action thread to continue from above.

Advanced

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.

Adding Different Dialog Options

Now let's add different dialogs with options depending on the current state of the campfire.

  1. Add a Jump to Landing below the _gm auto-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 1 for the purposes of Switch Tile Image, due to how arrays work in code, the first image is actually number 0 here, and the second image is 1.
    • {{tile.flags.monks-active-tiles.fileindex the tile. part tells the expression to look at the tile, while flags.monks-active-tiles.fileindex}} is the flag whose value is being used here.
  2. 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 Code is checked in this instance, as it will never be reached by following the code normally as the jump just above it redirects the code.
  3. Place a Show Dialog in this action thread.
    • Use the Custom type in the Dialog Type dropdown.
    • Use Add Buttons to 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.
  4. 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 Code does 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.
  5. Move your Activate/Deactivate and Switch Tile Image to this "Light" landing.
    • Change the Switch Tile Image from next to 2 to match the images tab.
    • Change the Activate/Deactivate from Toggle to Activate,
  6. Repeat steps 2 through 5, adjusting names & settings to instead extinguish the campfire.

Add an Item Filter

  1. Add a Filter by Items in Inventory underneath the "Light" landing; this should again be Triggering Token.
  2. Follow it up with another Check Entity Count; this should once again be Current Tokens.
    • The Go To field needs to include the name of the landing being created in step 3.
  3. 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 Code should be checked, otherwise the "Not Close Enough" action thread will continue into this one.
  4. 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.

Redirect Based on Player Type

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.

  1. Add a Redirect Based on Player Type under the "Light" landing.
    • GM Redirect needs to go to a landing that will be placed after the Filter by Item & it's Check Entity Count.
    • Player Redirect needs to go to a landing that will be placed before the Filter & Check.
  2. Add the landings in their respective locations.
    • Stop When Reached in Code cannot be checked on on the GM Redirect landing; the Player Redirect landing does not matter either way if your setup matches what is shown here.

Expert

Add Variables

We're going to add some Set Active Tile Variable in the "Light" & "Extinguish" action threads to prepare for a later step.

  1. Add your Set Active Tile Variable for each action thread.
    • "Light" should set it to = 1.
    • "Extinguish" should set it to = 0.

Add a Color Picker

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.

  1. Go to the Show Dialog action underneath the "1" landing, and add a third button to jump to a "Color" landing.
  2. Create a new landing, "Color" at the end of the action list.
  3. 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>
  1. 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.

Add Fire Damage.

Clone this wiki locally