Parameter Syntax
Complete reference for placeholder parameter syntax, including formatting rules, data types, and validation.
sameState and
withinRange (on both {randomBurg} and
{randomDungeon}) were written for the sibling product's
live map data, which Campaign Cookbook doesn't have - they're
silently ignored rather than throwing an error. The Complete
Parameter Reference table below marks exactly which ones work today.
minPopulation/maxPopulation/type/
difficulty all work as documented.
Basic Syntax
Parameters are added after the placeholder name, separated by a colon:
Example
{randomBurg:maxPopulation=300}
{nearestDungeon:type=Cave}
Multiple Parameters
Separate multiple parameters with commas. No spaces allowed.
Example
{nearestDungeon:type=Cave,difficulty=hard}
Formatting Rules
- No spaces around
=or, - Parameter names are case-sensitive
- Value types must match parameter type
- Invalid parameters are ignored
Valid Syntax
✓ {randomBurg:withinRange=50}
✓ {randomBurg:sameState=true,minPopulation=500}
✓ {nearestDungeon:type=Cave,difficulty=hard}
Invalid Syntax
✗ {randomBurg:sameState=true, minPop=500} // Space after comma
✗ {randomBurg:SameState=true} // Wrong case
✗ {randomBurg:withinRange=fifty} // Should be number
✗ {randomBurg:sameState=yes} // Should be true/false
Data Types
Boolean
True/false values. Must use lowercase true or false.
sameState=false
yes, no, 1, 0 are NOT valid boolean values.
Number
Integer or decimal numbers.
withinRange=100
minPopulation=1000
maxPopulation=500
String
Text values. Do not wrap in quotes.
type=Ancient-Crypt
difficulty=hard
difficulty=easy
- ✓
type=Cave - ✗
type="Cave"
Complete Parameter Reference
Settlement Parameters
| Parameter | Type | Description | Valid Values | Works Today? |
|---|---|---|---|---|
minPopulation |
number | Minimum population | Any positive number (e.g., 500, 1000) | ✓ Yes |
maxPopulation |
number | Maximum population | Any positive number (e.g., 300, 2000) | ✓ Yes |
sameState |
boolean | Intended to limit to same state/province | true, false | ✗ No - see warning above |
withinRange |
number | Intended max distance in units | Any positive number (e.g., 50, 100) | ✗ No - see warning above |
Dungeon Parameters
| Parameter | Type | Description | Valid Values | Works Today? |
|---|---|---|---|---|
type |
string | Dungeon type filter | Cave, Underground-Ruins, Sewer, Ancient-Crypt, Monster-Lair, Ruin | ✓ Yes |
difficulty |
string | Difficulty level filter | easy, medium, hard, deadly | ✓ Yes |
sameState |
boolean | Intended to limit to same state/province | true, false | ✗ No - see warning above |
Both of these placeholders are flavor-text only, drawn from an
optional hand-authored data/maps/locations.json - see
{nearestDungeon} for what
that means and how it differs from a real, campaign-authored
{dungeon:id}.
Parameter Compatibility
Not all parameters work with all placeholders:
| Placeholder | Supported Parameters |
|---|---|
{nearestBurg} |
None (no parameters) |
{randomBurg} |
minPopulation, maxPopulation (sameState, withinRange accepted but non-functional) |
{capitalCity} |
None (no parameters) |
{nearestDungeon} |
type, difficulty |
{randomDungeon} |
type, difficulty (sameState accepted but non-functional) |
Examples by Use Case
Find Specific Settlement Size
{randomBurg:minPopulation=500,maxPopulation=2000} // Medium town
{randomBurg:minPopulation=2000} // Large city
Match Dungeon to Story
{nearestDungeon:type=Ancient-Crypt} // Undead quest
{nearestDungeon:type=Sewer} // Urban adventure
Match Dungeon to Party Level
{nearestDungeon:difficulty=medium} // Level 4-7
{nearestDungeon:difficulty=hard} // Level 8-12
{nearestDungeon:difficulty=deadly} // Level 13+
Complex Filters
{randomBurg:minPopulation=800,maxPopulation=1500}
// Hard cave
{nearestDungeon:type=Cave,difficulty=hard}
// Deadly ancient crypt
{randomDungeon:type=Ancient-Crypt,difficulty=deadly}
Error Handling
Invalid Parameter Names
Unknown parameters are ignored:
Result: minPopulation is applied, invalidParam is ignored.
Invalid Parameter Values
Invalid values cause the parameter to be ignored:
Result: Parameter is ignored, placeholder acts as if parameter wasn't specified.
No Matching Locations
If filters are too strict and no locations match:
Result: Fallback text like "a nearby settlement" if nothing in your party's generated roster (or hand-authored locations.json) meets it.
Best Practices
1. Order Doesn't Matter
These are equivalent:
{randomBurg:maxPopulation=2000,minPopulation=500}
2. Use Meaningful Population Values
Choose values that make sense for your world:
✓ Good: minPopulation=2000 // A real city
3. Test Your Filters
After writing, test to ensure locations resolve correctly:
- Load your campaign in Campaign Cookbook
- Navigate to scenes with placeholders
- Verify locations appear (not fallback text)
- Check the console (see Debugging Tips below) for resolution details
Debugging Tips
Campaign Cookbook has no map to "load" or "configure" in the sense
the sibling product does - having no data/maps/locations.json
at all is the normal, common, out-of-the-box state, not an error
condition. Towns generate automatically the first time your party
needs one; dungeon flavor-text ({nearestDungeon}/
{randomDungeon}) only resolves to something specific if
you've hand-authored that optional file - otherwise it's generic text,
which is expected and fine.
Check Console Logs
The renderer process's console (View → Toggle Developer Tools in a
dev build; not available in a packaged release, see
Introduction) logs placeholder resolution via
debugLog(), prefixed [DM Toolkit].
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Generic fallback text ("the nearest settlement," "a nearby dungeon") appears | Normal for a fresh campaign with no towns generated yet, or no locations.json for dungeon flavor text |
Towns generate automatically the first time they're needed; for dungeon flavor text, author an optional data/maps/locations.json |
sameState/withinRange seem to do nothing |
They're not currently functional (see the warning near the top of this page) | Use minPopulation/maxPopulation instead |
| Parameter ignored | Invalid parameter name or value | Check spelling and data type |
| Same location every time | Working as intended (caching) | Use different parameters for different locations |
See Also
- Placeholders Overview - All available placeholders
- Scope Control - Guide to keeping adventures local
- {randomBurg} - Most flexible placeholder