Thread: CopyNode Issue Help
-
May 20th, 2020, 11:18 #1
- Join Date
- Mar 2020
- Posts
- 132
CopyNode Issue Help
Hello,
I have been struggling with this for a while now and it has been driving me nuts!
FGU
5E
My extension is loaded.
My code works so that a user can reset their actions form a saved copy in the database. In this scenario a player is resetting the actions for a spell.
I have a copy of an Actions node in my DB:
Code:<original_actions> <holder name="Houndy" owner="true" /> <id-00001> <holder name="Houndy" owner="true" /> <onmissdamage type="string">half</onmissdamage> <order type="number">1</order> <savemagic type="number">1</savemagic> <savetype type="string">dexterity</savetype> <type type="string">cast</type> </id-00001> <id-00002> <holder name="Houndy" owner="true" /> <damagelist> <holder name="Houndy" owner="true" /> <id-00001> <holder name="Houndy" owner="true" /> <dice type="dice">3d6</dice> </id-00001> </damagelist> <order type="number">2</order> <type type="string">damage</type> </id-00002> </original_actions>
so I do:
Code:local nodeActions = powerNode.createChild("actions"); for _,v in pairs(nodeActions.getChildren()) do v.delete(); end DB.copyNode(originalActionsList, nodeActions);
Code:<actions> <holder name="Houndy" owner="true" /> <id-00001> <holder name="Houndy" owner="true" /> <onmissdamage type="string">half</onmissdamage> <order type="number">1</order> <savemagic type="number">1</savemagic> <savetype type="string">dexterity</savetype> <type type="string">cast</type> </id-00001> <id-00002> <holder name="Houndy" owner="true" /> <damagelist> <holder name="Houndy" owner="true" /> <id-00001> <holder name="Houndy" owner="true" /> <dice type="dice">3d6</dice> </id-00001> </damagelist> <order type="number">2</order> <type type="string">damage</type> </id-00002> </actions>
However, for the player it does not update the actions properly:
If I quit as the player and rejoin, it then shows as expected.
If I debug the node, it points to the correct path in the DB, but it seems the values of some of the children are not there.
It seems to me that for the player, the reference to the DB is not being updated. This particular causes an issue if the player then tried to change or manipulate the broken references, as it will then break for the DM also.
Edit: Everything works fine if it is the DM who is doing the restoring.
Edit: I also manually added a method so I could update the display of the actions, to see if it that was the issue, but that did not work. I think it must be to do with lists and the node reference or, communications between the player and DM.
Any help would be gratefully appreciated!
Thanks,
HoundyLast edited by Houndy; May 20th, 2020 at 11:28.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks