5E Character Create Playlist
Page 2 of 2 First 12
  1. #11
    Quote Originally Posted by Bidmaron View Post
    You mean on the client you have to load their PCs up and select the inventory tab?
    Seems like you just need to register each client as a holder of their inventory nodes instead as they login....
    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.

  2. #12

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    I am having trouble following your remedy.

  3. #13
    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

  4. #14
    Quote Originally Posted by Moon Wizard View Post
    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
    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.

  5. #15
    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

  6. #16
    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

  7. #17
    Quote Originally Posted by Moon Wizard View Post
    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
    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.

  8. #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
    onIdentityActivation(sIdentity, sUser, bActivated)
    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.

  9. #19

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in