DICE PACKS BUNDLE
  1. #1

    [Fate Core] Making Skills Roll Dice in the NPC Window

    I recently completed my extension to change the vehicle window for Fate Core so it better suits Inteface Zero 2.0. I'm now wanting to simplify things for the NPC window. My work on Fate Core vehicles actually involved changing the CoreRPG ruleset vehicles, whereas The NPC window is a Fate Core specific window. The first thing I want to do is make it so that skills listed in the skill field will roll dice when they're double-clicked. Currently, the individual skills do get correctly highlighted when you click them, but double-clicking them does nothing. This is what this field currently looks like with the Shoot skill highlighted.

    NPC_Window.png

    I noticed this code in the Fate Core record_npc.xml file.

    Code:
    			<label_column name="skills_label">
    				<static textres="npc_label_skills" />
    			</label_column>
    			<string_columnh name="skills">
    				<nodragselect />
    				<script file="campaign/scripts/npc_roll.lua" />
    			</string_columnh>
    It references a script file named npc_roll.lua, but that file doesn't actually exist. For a code example where a 4dF roll is actually made in the Fate Core ruleset, I've noticed this code in the /scripts/chatdice.lua scipt.

    Code:
    function fatediceCheck(number, bonus, name)
      if ChatManager.control then
    	local dice = {};
    	for i = 1, number, 1 do
    	  table.insert(dice, "dF");
    	end
    	ChatManager.control.throwDice("fatedice", dice, bonus, name);
      end
    end
    So...I'm wondering what I'd need to do to create a missing npc_roll.lua script which would roll fate dice similar to the way they are in chatdice.lua?
    But, because it's a skills roll, any skill double-clicked would always roll a 4dF + skill value.

    As per usual, I'm pretty much uesless when it comes to LUA, but hey, I keep adventuring.
    Last edited by kronovan; May 6th, 2025 at 20:12.

  2. #2
    The campaign/scripts/npc_roll.lua file is located in CoreRPG; and since it's not defined in FATECore, then it would fall back to the version in CoreRPG.
    The CoreRPG version of the script is just looking for simple name/roll combinations in a comma-delimited list (i.e. Name NdN+N, ...); and then triggering a simple dice roll with that name and dice string.

    The chatdice.lua file you found is not actually referenced anywhere, and the code is old and not used. I'll get that removed in the next update pass.

    If you want to override the skills field behavior, I would start by copying the CoreRPG version of the file into your extension/ruleset in the same location ("campaign/scripts/"); and then, modifying it to how you want it to work.

    You can look at the 5E or 3.5E NPC skills fields for examples of what they do.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    ...If you want to override the skills field behavior, I would start by copying the CoreRPG version of the file into your extension/ruleset in the same location ("campaign/scripts/"); and then, modifying it to how you want it to work.

    You can look at the 5E or 3.5E NPC skills fields for examples of what they do...
    Thanks for the info and suggestion Moon Wizard. I'll copy in the CoreRPG npc_roll.lua and then check those D&D versions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in