-
October 14th, 2017, 18:28 #11
Client would already have the character sheet opened to inventory to be able to toggle the items equipped un-equipped. I mean, if the host hasn't opened their sheet and also clicked the inventory tab.
Far as I know they should already be a holder of their inventory. It's the CT node that is the problem I think.---
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.
-
October 14th, 2017, 19:21 #12
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
I am having trouble following your remedy.
-
October 14th, 2017, 20:13 #13
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
I'm not sure if this is the right approach (triggering off of player login/activation), but some thoughts below:
When the user logs in, you should be able to set up the triggers for any data a player may have visible (i.e. holder or owner). However, a big caveat is that the data is streamed in one data node at a time in the current networking, so the database will be building itself out after the login event. So, you would need to create DB handlers to get triggered on the add/update events.
Regards,
JPG
-
October 15th, 2017, 05:56 #14
Going to have to spend some time looking into this. Not really sure where to start yet. Sounds like I need to grant the user access to the node of the user in the CT when they take a character. Is there any examples of this anywhere I can poke at?
I'm guessing it's something around this.
User.onIdentityActivation = onIdentityActivation;---
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.
-
October 15th, 2017, 07:33 #15
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
They should already have access to read the CT node, since the CT node to a set to public.
They probably should not have ownership of nodes in the CT in general, as only one user can own. All of the current functions that need to make modifications to nodes not owned by players go through OOB messages to the GM client, and the GM client makes the appropriate updates.
Cheers,
JPG
-
October 15th, 2017, 07:35 #16
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
The “characterlist” window classes are a good place to start. (Which I think uses the onIdentityActivation handler)
There’s also an onUserLogin or onLogin handler as well. (Answering from phone, so just quick answer. )
JPG
JPG
-
October 15th, 2017, 18:44 #17
I'm going to do a walk through in the process tonight or tomorrow and see where the problem is. It's somewhere related to applying the effect to their self.
I've another feature I added that is comparable to the concentration you have in 5E that will appy a "Casting Bless (C)" effect on the player when they select it for their initiative option. It will not apply that effect if the client runs the initiative option but will if the host does it from his side.It's similar to the issue im having with gear toggle on/off and it applying the associated effects.---
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.
-
October 16th, 2017, 05:32 #18
Okay, I have it working ! Not sure it's the best way but here is what I have so far.
First, I created a AccessManagerADND.
Code:<script name="AccessManagerADND" file="scripts/manager_access_adnd.lua" />
And this is the script above: scripts/manager_access_adnd.lua
Code:-- -- -- Access to nodes managed for certain places here -- -- Right now this mainly deals with CT nodes so that players can apply effects -- that are on items or other areas --celestian -- function onInit() User.onIdentityActivation = onIdentityActivation; end function onIdentityActivation(sIdentity, sUser, bActivated) if bActivated then -- give access to CT node it character if exists local nodeCT = CombatManager.getCTFromNode("charsheet." .. sIdentity); if nodeCT and sUser ~= "" then local owner = nodeCT.getOwner(); if owner then nodeCT.removeHolder(owner); end DB.setOwner(nodeCT, sUser); end else -- remove access to CT node if character exists local nodeCT = CombatManager.getCTFromNode("charsheet." .. sIdentity); if nodeCT and sUser ~= "" then local owner = nodeCT.getOwner(); if owner then nodeCT.removeHolder(owner); end end end end -- flip through active users and their active identities and if they match -- the nodeCT we just added then give them ownership function manageCTOwners(nodeCT) for _,vUser in ipairs(User.getActiveUsers()) do for _,vIdentity in ipairs(User.getActiveIdentities(vUser)) do local _, sRecord = DB.getValue(nodeCT, "link", "", ""); if (sRecord == ("charsheet." .. vIdentity)) then DB.setOwner(nodeCT, vUser); end end end end
run when a player selects a character. If the character also exists in the combat tracker the ownership privs are granted.
manageCTOwners(nodeCT)
run from addPC() in manager_combat2.lua so that it matches up users/identities ownerships when a character is placed into the combat tracker.
So far in my testing using this method has allowed clients to apply effects from items w/o any issues.
Thoughts? Suggestions?Last edited by celestian; October 16th, 2017 at 19:48.
---
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.
-
October 16th, 2017, 05:41 #19
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Celestian, thanks for posting your solutions as you go. It is great to see working code.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks