-
April 20th, 2020, 17:54 #1
DB.getValue()... impossible return value...
Okay... I am trying to get a value of a node "hitDice" and the return is "hitDice" not the value of the node.
if this:
Code:local _, nodeNPC = ActorManager.getTypeAndNodeName(rSource); Debug.console("manager_action_damage","getTable48HitDiceVsImmunity","nodeNPC",nodeNPC);
Code:.. <combattracker> <public /> <list> <public /> <id-00004> ... <hitDice type="string">4+1</hitDice> ...
Code:local sHitDiceString = DB.getValue(nodeNPC, "hitDice"); Debug.console("manager_action_damage","getTable48HitDiceVsImmunity","sHitDiceString",sHitDiceString);
Runtime Notice: s'manager_action_damage' | s'getTable48HitDiceVsImmunity' | s'sHitDiceString' | s'hitDice'---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
April 20th, 2020, 18:57 #2
nodeNPC is a string, not a DB node.
Therefore, the second argument to DB.getValue is the default to return if the value from the first argument isn't valid. So, you're getting the default returned = "hitDice".
Info here: https://fantasygroundsunity.atlassia...29/DB#getValue
The second parameter is an optional subpath which is:
subpath (string) [optional]
If the first parameter has type databasenode, then this parameter specifies the relative data node identifier path from the specified node object.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
April 20th, 2020, 19:00 #3
To make it work, you could use:
Code:DB.getValue(DB.getChild(nodeNPC, "hitDice"));
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
April 20th, 2020, 19:04 #4
Okay, I figured it out. The value of nodeNPC from the getTypeAndNodeName() is a string, not a node... I actually had meant to use getTypeAndNode anyway...
That said, the second call that I tested DB.getValue(nodeNPC,"frequecy") returned a value... not "frequency". I tested it when I noticed hitDice wasn't working.
Strange happenings but for now im good.---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks