Temple + DM tool mini guide

Discussion in 'General Modification' started by Mellonril, Jan 18, 2026.

Remove all ads!
  1. Mellonril

    Mellonril Member

    Joined:
    Apr 6, 2008
    Messages:
    38
    Likes Received:
    48
    Hi!
    Since I’m using the Dungeon Master tool extensively for development, I thought it might be helpful to write a short tutorial about it.

    Below is what I’ve understood so far , Temple+ developers, please feel free to correct me if I’m mistaken anywhere.

    1) Enabling the DM tool
    A) Via Temple+ Configurator
    In the Configurator UI there’s a checkbox:
    • “Dungeon Master”
      Enables the Dungeon Master UI, which allows you to spawn creatures and edit existing ones.
    Internally this sets the config key:
    • dungeonMaster = true (see config/config.*)
    TemplePlusConfig.jpg

    B) Via the in-game console

    The in-game console menu bar has a “DM” button. Clicking it:
    • forces config.dungeonMaster = true
    • toggles the DM window on/off
    TemplePlusDMConsole.jpg

    2) Where the DM UI appears
    DM button on the utility bar
    When enabled, Temple+ adds a small DM button on the utility bar UI (bottom area). Clicking the button toggles the DM window.
    TemplePlusDMOpenBtn.jpg

    3) Basic interaction model
    The DM tool is half UI, half “mouse mode”:

    A) Hover targeting
    As you move the mouse in the world, the DM system constantly picks the object under the cursor (excluding portals/scenery/items). That “hovered” object is used for:
    • showing its name near the DM portrait area
    • opening the object editor
    • clone/move actions, etc.
    B) DM “actions” (spawn/clone/move/pathnode/tile paint)
    When you click certain buttons in the DM window (Spawn, Clone, Move, Pathnode Create/Delete/Move, Paint Blocker), DM enters an Action Mode:
    • the cursor switches to the DM cursor
    • the next clicks in the world perform the action
    Common controls across actions:
    • Left mouse release: apply / place / commit
    • Right mouse click/release: cancel and exit the action
    • ALT: for some actions (notably Clone, and intended for Move), holding ALT keeps the action active so you can repeat placements
    TemplePlusDMUI.jpg

    4) What’s inside the DM window (features overview)
    The DM window is titled “Dungeon Master” and contains collapsible sections:

    4.1 Maps
    Lets you browse maps and Teleport to them.
    auto-builds a list of map IDs & names (starts around 5001 up to “highest map id”)

    TemplePlusDMMaps.jpg
    • Filter
      • Area (numeric)
      • Outdoors Only checkbox
    • Each map entry shows:
      • Area ID
      • Teleport button (calls TransitionToMap(mapId))
    Use case: rapid map hopping during development.
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    4.2 Day / Night Xfer
    Displays “DayNightXfer” records (engine-side objects that transfer between day/night states).

    What you get:
    • object id
    • day map & location
    • night map & location
    • current map
    Use case: debugging day/night swapped NPCs/objects.

    4.3 Fudge Rolls
    Forces dice roll outcomes globally (DM-side “cheat” control).
    TemplePlusDMFudgeRolls.jpg
    Options:
    • Normal
    • Min
    • Avg
    • Avg+2
    • Max
    Internally this sets mForceRollType. The rest of the engine can query dmSys.GetDiceRollForcing() to alter roll behavior.

    Use case: deterministic testing (e.g., always crit, always fail saves, etc.).
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    4.4 Monsters
    Proto browser + spawner for NPCs/critters.
    TemplePlusDMMonsters.jpg

    Top-level:
    • Control NPCs checkbox
      When enabled, Objects::IsPlayerControlled() returns true for everyone, which effectively allows you to directly control NPCs (not just party members) in situations like combat/turn order.
    Filter (Monsters)
    • Category (Aberration/Animal/…)
    • Subcategory flags (Air/Aquatic/Extraplanar/…)
    • Faction (numeric)
    Modify (Monsters)
    Applies modifications to newly spawned monsters (not retroactive unless you re-spawn):

    Faction editing:
    TemplePlusDMFactionEditing.jpg
    • Faction ID input
    • Override checkbox (Button becomes Add or Set)
    • Clear button (???)
    On spawn, applies these faction changes:
    • Override = true clears all factions and sets only your chosen ones
    • Override = false appends factions
    Monster entries
    Each monster record shows:
    • protoId | name (HD)
    • Spawn button → enters Spawn action mode
      Then: Left-click in the world to place it.
    Use case: spawn test encounters instantly; force factions for AI behavior testing.
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    4.5 Items
    Proto browser + Give / Spawn actions for Items
    TemplePlusDMItems.jpg

    Filter:
    • Item type dropdown (All, Weapon, Ammo, Armor & Wearables, Potion, Scroll, Wand, Magical Item, Other)
    • Name substring filter (case-insensitive, trimmed)
    Each item entry:
    • Give: creates the object near party leader and inserts into inventory (auto-identifies)
    • Spawn: enters DM Spawn action (place into world with a click) (the item will not be identified)
    Use case: gear up fast, test item scripts, spawn loot, etc.
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    4.6 Pathfinding (Pathnodes tooling)
    Utility for pathnodes debugging and creation.
    TemplePlusDMPath.jpg

    Controls:
    • Show Pathnodes toggle
      Also enables debug rendering of paths.
    • Buttons:
      • Create Node → action mode: click to add nodes
      • Move → action mode: move active node
      • Delete → action mode: delete active node
    • Recalc All Neighbours
      Rebuilds adjacency & traversal distances
    • Save Nodes
    • Generate Clearances
      Generates tile clearance data (and warns it may take a while)
    • Persist checkbox
      If off: saves to DM_PF\<mapName> (temporary / non-module content)
      If on: saves directly under maps\<mapName> (module content)
    Mouse behavior while pathnodes are visible:
    • moving the mouse updates the active node from cursor location
    • in “move” mode, it tries to drag the active node while hovering/moving
    Use case: fix broken pathing, speed up PF queries, generate clearance caches.
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    4.7 Sector Tiles (Show blockers + paint)
    Controls:
    • Show Blockers toggle (enables tile/blocker visualization)
    • Paint:
      • Blocker → action mode
        Clicking toggles a “3x3 blocker mask” on that tile
    Use case: collision setup in a live map without passing from the editor.
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    4.8 Active Spells
    Lists active spell packets from the spell registry.

    Per spell you can inspect:
    • spellId, spell name, enum, active/inactive
    • caster handle, caster level, inv idx
    • caster partsys id
    • duration remaining / total
    • targets list (handles + partsys ids)
    • End button: forcibly ends the spell (SpellEnd(spellId, 1))
    Use case: debug stuck particles, lingering auras, “why is this still active”.
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    4.9 Import Rival Party
    This section scans save slots (Save\slot*.gsi) and lets you “PseudoLoad” them into a temp folder, then pulls mobiles/objects out for spawning.

    Use case: bring characters/NPCs from other saves into the current session for PvP/testing.
    --------------------------------------------------------------------------------------------------------------------------------------------------------
     
    Last edited: Jan 18, 2026
    Robson Hermes likes this.
  2. Mellonril

    Mellonril Member

    Joined:
    Apr 6, 2008
    Messages:
    38
    Likes Received:
    48
    5) Object editor (right-click in the world)
    TemplePlusDMEditObj1.jpg

    Note: The Clone and Move actions are only available for critters (PCs/NPCs) and containers.
    Items, portals, and scenery are excluded and cannot be cloned or moved using the DM Edit Object mode.

    When the DM window is open and not minimized:
    • Right-click in the world opens the Edit Object window for the hovered object.
    The editor includes (highlights):
    • Clone button (enters clone placement mode)
    • Move button (enters move placement mode)
    • Location display
    • Factions display
    • HP editing:
      • Damage (obj_f_hp_damage)
      • Heal button (sets damage to 0)
      • Base HP (obj_f_hp_pts)
    • Stats (STR/DEX/CON/INT/WIS/CHA)
    • Critter attributes:
      • Alignment & Alignment Choice editing
    • NPC properties (if NPC):
      • Hit Dice
      • AC bonus
    • Class Levels:
      • edit existing, add new class
    • Skill ranks (supports 0.5 increments)
    • Inventory view + “Prune invalids”
    • Feats:
      • add feats (supports multiselect feats)
      • view existing feats
    • Spells Known / Memorized:
      • add spells with class + level
      • “Pending to Memorized”
    • Modifiers & Conditions:
      • add condition/modifier structs by name
      • view existing conditions on dispatcher/permanent mods
    • Scripts (add/override scrip id)
    Use case: live-tune NPCs, add feats/spells, fix broken inventory, remove/add conditions without writing scripts.

    6) Practical workflows
    Spawn a monster at a location
    1. Open DM
    2. Monsters → find proto → Spawn
    3. Move cursor to desired tile
    4. Left-click to place
    5. (Optional) Use Modify section first to set factions before spawn
    Clone an NPC multiple times
    1. Right-click target → Edit Object
    2. Click Clone
    3. Left-click to place clones
    4. Hold ALT while placing to keep clone mode active
    Move an object
    1. Right-click target → Edit Object
    2. Click Move
    3. Left-click destination to relocate
    4. Right-click cancels action mode
    Force all rolls to Max for a test
    1. DM → Fudge Rolls → Max
    2. Run your scenario
    3. Switch back to Normal after test (important—this affects lots of systems)
    Fix “why is pathing broken here”
    1. DM → Pathfinding → Show Pathnodes
    2. Create/Move/Delete nodes as needed
    3. Recalc neighbours
    4. Save nodes (Persist on/off depending on whether you want module changes)
    Kill stuck spell effects / particles
    1. DM → Active Spells
    2. Find the spellId
    3. Click End
     
    Last edited: Jan 29, 2026
    Sitra Achara likes this.
  3. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,652
    Likes Received:
    552
    Great guide, glad you found it useful!
     
    Mellonril likes this.
  4. Basil the Timid

    Basil the Timid Dont Mention the War

    Joined:
    May 19, 2008
    Messages:
    1,174
    Likes Received:
    9
    Ah ha!! Fudge rolls! That explains everything: all the warped battles over the past 18 years!
     
    Last edited: Jan 23, 2026
  5. Baraz

    Baraz Member

    Joined:
    Jan 19, 2026
    Messages:
    22
    Likes Received:
    0
    One thing (two actually) confused me a bit in your guide and does not seem to work in my game.

    1) At the beginning of the guide you state that right-click cancel and exit the action and that alt offers options.
    - but right-clicking on a character, or on some world objects, shows the DM options (with the DM window opened of course), as you explain later for items in the following post.
    Note: the image though is pretty clear.


    2) Also, right-clicking or alt+click does nothing on a cloak or other inventory items (both on the ground or in the inventory) ;
    - and Alt key and clicking does nothing (left and right click ; left-clicking has party members just picking up the items).
    I guess the DM mode does not work on those types of "items".

    I am using the most updated version of TemplePlus.
     
    Last edited: Jan 30, 2026
  6. Mellonril

    Mellonril Member

    Joined:
    Apr 6, 2008
    Messages:
    38
    Likes Received:
    48
    Yes, you’re right, I’ve added a clarification note to the Object Editor section to avoid confusion:

     
    Baraz likes this.
  7. Robson Hermes

    Robson Hermes Member

    Joined:
    Sep 20, 2020
    Messages:
    3
    Likes Received:
    0
    Hey @Mellonril , thanks a LOT for your post.
    Got a couple of questions about the tool.

    First is about factions. How do they work? Would factions be the explanation of when I added several different monsters, they fought between them when I threw a fireball against them from far away. Each one belonged to a different faction?

    Second is about some creatures like Iuz and Zuggtmoy. I've spawned both of them and tried to fight them, but first it triggers the dialogue we have with them during the campaign, and them they vanish. Cannot really fight them. Even if I manage to hit Iuz a couple of times, he doesn't engage in combat. Would you have any idea how to fight them?

    Ah, one more. Is it possible to spawn Hedrack ? Couldn't find him in the list.

    Thank you :)
     
    Last edited: Feb 5, 2026 at 6:39 PM
  8. Mellonril

    Mellonril Member

    Joined:
    Apr 6, 2008
    Messages:
    38
    Likes Received:
    48
    You might want to use the forum search — there are quite a few previous discussions about factions that go into detail.
    That said, the short answer is: yes.
    Monsters with different Faction IDs will fight each other.
    If you’re using the DM tools, there are also options to override a creature’s Faction ID before spawning it.

    Long answer (note that I’m not a Temple+ coder or a programmer, so the information below may be inaccurate):
    In Temple+, “factions” are basically a list of integer IDs stored on NPCs (object field obj_f_npc_faction, up to 50 entries), and most of the AI logic boils down to one question:

    Do these two critters share allegiance?
    If yes → they’re considered friendly/allies for a lot of AI behaviors (assisting, not turning on each other, etc.).
    If no → they’re treated as unrelated (and may fight depending on flags like KOS, hostility state, etc.).

    Factions data model
    • NPCs have an array obj_f_npc_faction[0..49].
    • The list is 0-terminated: as soon as the code reads a 0, it treats that as “end of faction list” and stops scanning.
    What happens when two NPCs have different factions set?
    1) They do not share allegiance
    LegacyCritterSystem::NpcAllegianceShared(npc1, npc2) checks:
    1. Leader relationships (same leader, one is leader of the other) → allied
    2. Otherwise: scan npc1’s faction list; if npc2 “has” any of those (factions.FactionHas(npc2, factionId)) → allied
    3. If no match → not allied
    So if NPC A has factions {10, 11} and NPC B has {20}, they won’t be allied by factions.

    2) That affects “friendly” tests and AI support behavior
    LegacyCritterSystem::IsFriendly(critter1, critter2) uses NpcAllegianceShared as one of the main “are we friendly?” checks, meaning different factions generally makes them not friendly (unless other rules apply: party/leader/charm edge cases).

    3) It also affects who joins fights / reacts to alerts
    AiSystem::GetAllegianceStrength(aiHandle, tgt) returns:
    • 3 if strong party/leader relationship
    • 1 if critterSys.NpcAllegianceShared(aiHandle, tgt) is true
    • 0 otherwise (also 0 in brawls, flee flags, charmed, etc.)
    And AI alerting / provoking hostility uses this “allegiance strength” to decide whether nearby NPCs should back you up.

    Practical effect: different factions → NPCs are less likely to “help each other” automatically.

    What is faction 0 used for?
    Faction 0 is treated as “no faction / null faction”.

    There are two closely related helpers:

    LegacyCritterSystem::HasNoFaction(handle)
    Returns:
    • true for PCs
    • false for NPCs in party
    • for other NPCs: true if obj_f_npc_faction[0] == 0
    So for NPCs, “faction 0” at slot 0 means this NPC has no faction list at all.

    FactionSystem::HasNullFaction(handle)
    Very similar intent (null faction concept):
    • Non-NPCs → true
    • Party members → false
    • Otherwise NPC: obj_f_npc_faction[0] == 0
    Special-case behavior for two “null faction” NPCs
    In LegacyCritterSystem::IsFriendly, Temple+ has a special rule:

    If both critters “have no faction” (i.e., faction[0] == 0) and neither is in party, then it returns TRUE (they’re treated as friendly to each other). There’s even a comment noting it was adjusted so things like animal companions don’t auto-treat faction-0 critters as friendly in the wrong situations.

    So faction 0 is commonly used as:
    • “generic ambient NPC / bystander / non-aligned creature”
    • “don’t participate in the normal faction web”
    • and it acts as the terminator / empty list marker for the faction array.
    One more important detail: PCs don’t really “store factions” the same way
    When the system checks NPC ↔ PC allegiance, it doesn’t scan PC object factions. Instead it calls:
    • factions.PCHasFactionFromReputation(pc, factionId)
    Meaning: PCs can be treated as belonging to factions via reputation, not via obj_f_npc_faction[].

    Some monsters or NPCs strictly depend on their game scripts or other factors (global variables, maps, other NPCs, etc.).
    In those cases, you’ll need to edit the protos or duplicate them into new ones in order to create “clean” profiles that can be used independently.
    If you want to fight a specific boss NPC, it’s usually easier to teleport directly to the encounter map where that boss is located.

    (ref description.mes) Hedrack should be proto {14256}{High Priest}
     
    Robson Hermes likes this.
  9. Robson Hermes

    Robson Hermes Member

    Joined:
    Sep 20, 2020
    Messages:
    3
    Likes Received:
    0
    @Mellonril
    Dude, you're awesome. Thanks lot!

    Will try to get a custom Iuz to fight. When fighting all the 4 Iuz together at the end of Co8, still getting my ass kicked. Cannot prepare beforehand cause I teleport there right after the dialoge with Lady Asherah. Not sure how some people manage to avoid the automatic dialogue and prebuff.

    Thanks again, I owe you a beer.
     
  10. dolio

    dolio Established Member Supporter

    Joined:
    May 30, 2005
    Messages:
    529
    Likes Received:
    148
    I think if you just want to fight a boss without having their dialogue do something custom, you can probably use the DM tool to clear out a few of their scripts that will trigger the dialogue. Then they'll act more like normal enemies that will just fight you on sight. The thing you have to be careful about is clearing scripts that will affect some of their behavior during combat. E.G. Lareth interrupting to beg for mercy.

    Also, as far as Hedrack goes, I've noticed that some notable protos don't show up in the DM tool for some reason. So he might actually not be there. I'm not sure why that happens.
     
    Robson Hermes likes this.
  11. Robson Hermes

    Robson Hermes Member

    Joined:
    Sep 20, 2020
    Messages:
    3
    Likes Received:
    0
    True, Hedrack is not there indeed. But I was able to spawn him using the "To spawn an NPC" described here, directly from the console.
     
Our Host!