Houndy
April 16th, 2020, 15:21
Hi All,
I have been driving myself crazy with a problem whilst coding for an extension (testing in FGU, but think it would apply to either), i am sure is something simple but cant figure it out.
Originally I was storing my own copy of token, ID etc of entries into the combat tracker and using handlers to update them. However, this quickly became a performance issue when there was more than 8 or so NPCs.
So I figured, why am I creating a new DB, when I can just use the combat tracker directly, and add a couple of extra fields myself. However, I just cant get the NPCs to display in my window. I've been debugging and it must be somethign to do with the databasenode, as if I call getDtabaseNode() with my entry script it returns nil, but if I call window.getDatabaseNode() within my entry.xml it returns the correct combat tracker entry ID.
I am using a windowlist with datasource "combattracker.list" and have my own script <script file="scripts/rfia/rfia_npcs.lua" /> included in that windowlist. It refers to a windowclass which I have created <windowclass name="rfia_npc_entry"> , which also has its own script rfia_npc_entry.lua.
I created an init method in both scripts to debug. For the windowlist script, it gets the database node (getDatabaseNode()) as expected "combattracker.list". However, for the entry script it returns nil for the databasenode. I know that the correct number of entry windows are being created because the number of debug calls = number of NPCs in combattracker.
Hope this makes sense. So in conclusion I just think somehow the databas enode/window isnt properly connecting to the script or vice versa.
Let me know your thoguhts!
Thank you!
I have been driving myself crazy with a problem whilst coding for an extension (testing in FGU, but think it would apply to either), i am sure is something simple but cant figure it out.
Originally I was storing my own copy of token, ID etc of entries into the combat tracker and using handlers to update them. However, this quickly became a performance issue when there was more than 8 or so NPCs.
So I figured, why am I creating a new DB, when I can just use the combat tracker directly, and add a couple of extra fields myself. However, I just cant get the NPCs to display in my window. I've been debugging and it must be somethign to do with the databasenode, as if I call getDtabaseNode() with my entry script it returns nil, but if I call window.getDatabaseNode() within my entry.xml it returns the correct combat tracker entry ID.
I am using a windowlist with datasource "combattracker.list" and have my own script <script file="scripts/rfia/rfia_npcs.lua" /> included in that windowlist. It refers to a windowclass which I have created <windowclass name="rfia_npc_entry"> , which also has its own script rfia_npc_entry.lua.
I created an init method in both scripts to debug. For the windowlist script, it gets the database node (getDatabaseNode()) as expected "combattracker.list". However, for the entry script it returns nil for the databasenode. I know that the correct number of entry windows are being created because the number of debug calls = number of NPCs in combattracker.
Hope this makes sense. So in conclusion I just think somehow the databas enode/window isnt properly connecting to the script or vice versa.
Let me know your thoguhts!
Thank you!