PDA

View Full Version : Weird thing happened - stringres picked up from another ruleset???



Varsuuk
January 25th, 2020, 18:39
So, on my ruleset - I borrowed from several including 2E, 5E, etc.

I was just cleaning up the 3 stats I had for an npc sheet in prep to add saving throws. Decided to first add the saving throw description strings resource and decided to search on resource of prior control to find the spot in the file to add the next one. I searched on "npc_label_numberattacks"

from:


<label_column name="numberattacks_text_label">
<static textres="npc_label_numberattacks" />
</label_column>
<labelcontrol_columnh name="numberattacks_text" />


It appears in UI as "# Attacks"


Umm it wasn't in my strings... search whole ruleset - nope. Only in the .xml file.
Search CoreRPG. Nope.
It's in 2 rulesets 2E and AD&DCore (I kept the old one in my dev tree in case it had anything different that might be useful)

Huh...
OOOO - I probably put in my base.xml "strings_adnd.xml" and somehow it ... searches other directories?
Nope, I don't have it.

So, moving on and fixing it to include my own resources - BUT, if anyone has a clue how/why this occurred, let me know. Like some sort of thing like C++ template dependency injection? If you think it is impossible, it probably is and I made a mistake that didn't see and not providing all the info. Like said, I don't care about this because clearly I WANT to define my own string resources and will. Just curiosity if it is a thing where it looks in entire ruleset tree from /strings dir xml. Which I CANNOT actually credit as being the reason but hey...

damned
January 25th, 2020, 23:58
are you importing from other rulesets?

<importinfo>
<acceptfrom ruleset="MoreCore" />
<acceptfrom ruleset="CoreRPG" />
</importinfo>

Varsuuk
January 26th, 2020, 00:29
are you importing from other rulesets?

<importinfo>
<acceptfrom ruleset="MoreCore" />
<acceptfrom ruleset="CoreRPG" />
</importinfo>


Of course I am! Thank you! Yet another mystery solved due to your help!! :)


...
<!-- Abilities -->
<description>
<text>Swords &amp; Wizardry Complete Ruleset</text>
<author>Dan Delgado (Varsuuk)</author>
<website>https://www.fantasygrounds.com</website>
</description>

<!-- Layers -->
<importruleset source="CoreRPG" />

<importinfo>
<acceptfrom ruleset="CoreRPG" />
</importinfo>



<!-- Tabletop settings -->
<includefile source="gameelements.xml" />
...


Edit: WAIT... I know I'd get from Core, I meant before it WASN'T from Core (sorry) - it was in 2E.


"npc_label_numberattacks"

strings_adnd,xml:


...
<string name="npc_label_numberappearing"># Appearing</string>
<string name="npc_label_numberattacks"># Attacks</string>
<string name="npc_label_organization">Organization</string>
...



Before I changed it to:


<label_column name="numberattacks_text_label">
<static textres="label_numberattacks" />
</label_column>
<labelcontrol_columnh name="numberattacks_text" />


it was


<label_column name="numberattacks_text_label">
<static textres="npc_label_numberattacks" />
</label_column>
<labelcontrol_columnh name="numberattacks_text" />


And it was displaying # Attacks even though I had YET to define a string for that in my own strings.xml file to the ruleset.
Was wondering if there was an obvious reason like import - if not then skip, as I said - it was cos hadn't yet defined it but expected it to throw an error due to that. dir search did NOT find that string anywhere except 2E and AD&D Core. Odd

Trenloe
January 26th, 2020, 04:54
FG only loads the files that you tell it to load via https://www.fantasygrounds.com/refdoc/includefile.xcp and https://www.fantasygrounds.com/refdoc/script.xcp. It doesn't just pick up random files in directories and load them.

Varsuuk
January 26th, 2020, 08:42
Right, as I always continued to believe. I was trying to figure out what angle I was missing.

I finished some stuff and committed. In the morning I will again reference the string in 2E and see if it loads it. If it does, will rethink and check again cos there is a razor here somewhere that will explain it.