PDA

View Full Version : [Fate Core] Making Skills Roll Dice in the NPC Window



kronovan
May 6th, 2025, 19:48
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.

64299

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


<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.


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. :p

Moon Wizard
May 7th, 2025, 23:13
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

kronovan
May 8th, 2025, 04:54
...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.