-
July 7th, 2020, 03:35 #1
openWindow() returning nil in classic?
alright, i got a weird one. in Fantasy Grounds Unity, the following line returns a windowinstance which i can use to get the databasenode from.
local aNode = Interface.openWindow("npc", "npc.");
Debug.console(aNode);
Debug.console(DB.getChildren("npc"));
aNPCDetails.node = aNode.getDatabaseNode();
Debug.console(aNPCDetails.node);
in Fantasy Grounds Classic, aNode comes up nil. What do i need to do so that we create a new npc and return its databasenode in both versions?Last edited by pr6i6e6st; July 7th, 2020 at 03:43.
-
July 7th, 2020, 08:40 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
"npc." is not a valid database path. That's probably the issue.
JPG
-
July 7th, 2020, 10:00 #3
-
July 7th, 2020, 11:02 #4
Use createChild: https://fantasygroundsunity.atlassia...DB#createChild or https://fantasygroundsunity.atlassia...de#createChild
Either will create a unique ID (in the form of id-XXXXX) if the name parameter is omitted, and return a databasenode which can be used in Interface.openWindowPrivate 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!
-
July 7th, 2020, 11:10 #5
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks