5E Character Create Playlist
Page 13 of 34 First ... 3111213141523 ... Last
  1. #121

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    Thanks for your reply.
    Now i have a new problem : When i set a new frame for a character sheet, it does not change dynamically for the host and the client, i must close the sheets and open it for see the new one... any idea ?
    Thanks

  2. #122
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    If you use a value in the database to control which frame to use write a <databasenode>.onUpdate function that triggers on all clients when this database value is changed and use code in the function to change the frame.
    Private 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!

  3. #123

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    thanks but i do not understand all, how can i do that ? Do you have an exemple ?

  4. #124
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by earthworm3 View Post
    thanks but i do not understand all, how can i do that ? Do you have an exemple ?
    See campaign\record_npc.xml in CoreRPG, the "npc" windowclass has the following script section:
    Code:
    <script>
    	function onInit()
    		local sNode = getDatabaseNode().getNodeName();
    		DB.addHandler(sNode .. ".locked", "onUpdate", onLockChanged);
    		onLockChanged();
    	end
    	
    	function onClose()
    		local sNode = getDatabaseNode().getNodeName();
    		DB.removeHandler(sNode .. ".locked", "onUpdate", onLockChanged);
    	end
    
    	function onLockChanged()
    		if header.subwindow then
    			header.subwindow.update();
    		end
    		if main.subwindow then
    			main.subwindow.update();
    		end
    
    		local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
    		notes.setReadOnly(bReadOnly);
    	end
    </script>
    onInit uses the DB.addHandler function to define the onUpdate event handler that runs the onLockChanged function when the node specified (sNode..".locked") changes.

    See also the "Handler Functions" section here: https://www.fantasygrounds.com/modguide/scripting.xcp Note that the line "node.onUpdate = sourceUpdate;" in this should be "node.onUpdate = onSourceUpdate;"
    Private 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!

  5. #125

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    thanks, it's work

  6. #126

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    Hello, my second extension is in progress. For now, we can change character sheet between werewolf and vampire. I am on mage V20 now, and after NPC sheet. See my signature to download it.

    EDIT : i have updated VtDA and VtM on my dropbox for now.
    Last edited by earthworm3; April 15th, 2014 at 21:20.

  7. #127

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    Hello, i have a problem for change npc sheet frame, see my code :

    function onMenuSelection(selection, subselection, subsubselection)
    if selection == 1 then
    window.getDatabaseNode().getChild("race").setValue ("vampire_npc");
    if window.description then
    window.description.onInstanceCreated();
    window.combat.onInstanceCreated();
    window.other.onInstanceCreated();

    window.other3.onInstanceCreated();
    window.other4.onInstanceCreated();
    window.other5.onInstanceCreated();
    end
    end
    end
    description is a subwindow and it does not go to the if for call onInstanceCreated() function.

  8. #128

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    Problem solved :

    Code:
    local wnd = Interface.findWindow("npc",window.getDatabaseNode());
    		if wnd then
    			wnd.description.onInstanceCreated();
    			wnd.combat.onInstanceCreated();
    			wnd.other.onInstanceCreated();
    			
    			wnd.other3.onInstanceCreated();
    			wnd.other4.onInstanceCreated();
    			wnd.other5.onInstanceCreated();
    		end

  9. #129

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    Extension "Crossover.ext" updated : NPC werewolf sheet OK.

  10. #130

    Join Date
    Jun 2009
    Location
    France, near Paris
    Posts
    305
    By right clicking on "more" button, we can change PC & NPC sheets between Mage 20th, Vampire 20th, Werewolf 20th.

    EDIT : Any bug ?
    Last edited by earthworm3; April 18th, 2014 at 07:16.

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