PDA

View Full Version : senses field in NPC and CHARACTER



augustgames
May 12th, 2024, 05:30
I added the senses field to both my NPC and CHARASHEET.

Darkvision 60 works in the NPC field but it does not work for the CHARSHEET. I can manually add the effect with VISION: darkvision to the Character. I tried it on several maps. Always the same.


I have no extensions. Anybody have any insights as to why? I have spent a bit trying to get it to work, including the suggestings on this web site. This is my own Ruleset I am working on and it is used with Corerpg.




Charsheet
<stringfield name="senses">
<frame name="fieldlight" offset="10,5,5,10" />
<bounds>125,545,467,13</bounds>
<controlline />
<lineoffset>-40</lineoffset>
</stringfield>



NPC
<stringfield name="senses">
<frame name="fieldlight" offset="10,5,5,10" />
<bounds>356,453,249,15</bounds>
<controlline />
<lineoffset>-40</lineoffset>
</stringfield>

LordEntrails
May 12th, 2024, 14:47
I am pretty sure it already worked in the 5E character sheet and I assume all CoreRPG rulesets. Before you wrote the extension, did you try it per the wiki?
Player and NPC Token Vision on Maps - Fantasy Grounds Customer Portal - Confluence (atlassian.net) (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/1315930113/Player+and+NPC+Token+Vision+on+Maps#Defining-Player-Vision)

augustgames
May 12th, 2024, 19:46
Yes. It's built on top of CoreRPG. I acutally made a copy of CoreRpg and renamed it and use that. I did make a few changes to the combat tracker. Not many though. hummmm.

LordEntrails
May 12th, 2024, 20:16
Instead of making a whole copy of CoreRPG, I suggest you looking into the Merge and join commands so you can just alter what you need and then when Core updates you'll get those updates automatically. Not sure how to do it myself, just familiar enough with all the developer talk. The other thing to do is to out comments and log outputs to you code so you can trace what is happening easier.

augustgames
May 13th, 2024, 13:28
Interesting. I will check it out.

Moon Wizard
May 13th, 2024, 17:07
The existing 3.5E, 4E, 5E and other rulesets that are included with the standard install use this approach.

Regards,
JPG

augustgames
May 15th, 2024, 01:23
Ok, I figured it out. I noticed there were a bunch of Ruleset cases in the lua scripts so on a hunch I combed through the ct_entry.lua code. My Rulset name was not "CoreRPG" I updated this to my ruleset and it worked!

function linkPCFields()
local nodeChar = link.getTargetDatabaseNode();
if nodeChar then
name.setLink(DB.createChild(nodeChar, "name", "string"), true);
token.setLink(DB.createChild(nodeChar, "token", "token"));
token3Dflat.setLink(DB.createChild(nodeChar, "token3Dflat", "token"));

if Session.RulesetName == "CoreRPG" then
senses.setLink(DB.createChild(nodeChar, "senses", "string"), true);
end
end
end