1. #1

    Additional "cloned" tab in charsheet

    Hello.

    My issue is, in my own game system (without advanced game mechanics programmed into ruleset i am not able to do with my skill ATM) I need to have alot of informations related to atributes and skills inside charsheet.

    I thought simple yet elegant workaround could be separate Atributes tab and Skill tab into two tabs in charsheet.
    I spent 5 hours to achieve this probably simple task and failed. Reading guides, looking for video tutorials but every attemp ends with "exacly cloned tabs" - when I do anything inside main "atributes tab", the second main "skills tab" have exact data copy inside it and vice versa.

    When I look into db.xml, only one data node is here so I am displaying and writing only one group of data instead of two.

    I am lost inside all that reference logic jumping from one file to another looking for where is what . trying to change something and trying to figure results of my change. Its pretty hard with almost no debug options inside FG a and almost zero commentary inside files. (my programming experience is based on Basic, Pascal, C++ from pre OOP/DOS era so all that encapsulation stuff troubles me).

    I made additional TAB copy record_char_main.xml into record_char_main2.xml, included it in base.xml and add it as additional "subwindow" inside record_char.xml. Then i was toying inside record_char_main2.xml, trying something inside template_char.xml but no luck.

    Any advice?

    Thanks.

  2. #2
    dulux-oz's Avatar
    Join Date
    Jan 2012
    Location
    Brisbane, Australia
    Posts
    3,820
    Blog Entries
    14
    Sounds like nodes in the Database is being reference by both pages - nodes are "linked" to screen elements either via their "name" attribute or a "source" attribute - I'd check both of your new pages for duplicates in these areas, if I were you.

    Have fun

    Cheers
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Read my FG Blog here.

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Ongoing Video, Ruleset & Extension Development: via PayPal (Send To: [email protected])

    YouTube Channel/Tutorial Playlists: www.youtube.com/c/duluxoz

  3. #3
    Quote Originally Posted by dulux-oz View Post
    Sounds like nodes in the Database is being reference by both pages - nodes are "linked" to screen elements either via their "name" attribute or a "source" attribute - I'd check both of your new pages for duplicates in these areas, if I were you.

    Have fun

    Cheers
    Thanx Dulux - watched alot of your VIDS on youtube last 2 weeks - and you are main reason why I spent 20% of my monthly sallary into ultimate version of FD.

    One small question - I thought "template" files (like template_char.xml ) are just reference types instead of "real charsheet stuff" so I dont need change them in this case. And *.lua files are again reference scrips I also dont need access them for this task so whole "editing magic" should be hidden inside record_char_main.xml, am I right?

    Sorry for my english, I spent my school years under russian iron courtain so its my another issue i am dealing with when I try to learn something from guides, my english is based on self-learning and movies subtitles .

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,022
    Quote Originally Posted by Kilitar View Post
    One small question - I thought "template" files (like template_char.xml ) are just reference types instead of "real charsheet stuff" so I dont need change them in this case. And *.lua files are again reference scrips I also dont need access them for this task so whole "editing magic" should be hidden inside record_char_main.xml, am I right?
    Templates are usually for XML specifications that are going to be used more than once, so they can (and do) contain "real stuff". Also, LUA is code that can be manipulating the database directly, so it might be that there is some hard coded database references in LUA files.

    The issue you're having is that the data stored from the Main tab is stored in 2 windowlist controls which are defined in template_char.xml: <template name="list_charmaincategory"> and
    <template name="list_charmainattribute">. Both of these have a <datasource> entry that determines where their data is stored in the database - list_charmaincategory has a datasource of .maincategorylist and list_charmainattribute has a datasource of .attributelist - which you will see looking at a <charsheet> entry in the campaign db.xml file.

    As a minimum you'll need to change the <datasource> entry for these 2 templates in your new control definitions in record_char_main2.xml. You can do this using the mergerule="replace" parameter within the XML. For example, the following will replace the template <datasource> entry:
    Code:
    <list_charmaincategory name="categories">
    	<windowlist>
    		<datasource mergerule="replace">.maincategorylist2</datasource>
    	</windowlist>
    	<anchored to="attributesframe">
    		<left offset="15" />
    		<top offset="35" />
    		<right offset="-15" />
    		<bottom offset="-20" />
    	</anchored>
    </list_charmaincategory>
    Use the above code in your record_char_main2.xml for the categories windowlist, the red highlights that this control will use a datasource of maincategorylist2 for the category headers. There is no need to change the underlying attributelist control as this will be embedded within the new maincategorylist2 database structure.

    More info on templates and merge rules here: www.fantasygrounds.com/modguide/templates.xcp


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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. #5
    Thx Trenloe.
    Add your code in case of both did not work for me, dunno why - tabs were still cloned in old characters and even in new ones.
    Code:
    <list_charmaincategory name="categories">
             <windowlist>
    		<datasource mergerule="replace">.maincategorylist2</datasource>
             </windowlist>
    and
    Code:
    <list_charmainattribute name="attributes">
    	<windowlist>
    		<datasource mergerule="replace">.attributelist2</datasource>
    	</windowlist>

    Anyway you pointed me to right part of code so I did it "dumb manual way".

    Code:
    Code:
    <list_charmaincategory2 name="categories">
    				<anchored to="attributesframe">
    					<left offset="15" />
    					<top offset="35" />
    					<right offset="-15" />
    					<bottom offset="-20" />
    				</anchored>
    			</list_charmaincategory2>
    and with clone part of template_char.xml
    Code:
    <template name="list_charmaincategory2">
    		<windowlist>
    			<class>char_main_category</class>
    			<datasource>.maincategorylist2</datasource> 
                             .
                             .

    My code now working as I need - anyway its just dumb code duplication so I would like to figure what I did wrong with your "merge magic "

    Based on your and Dulux advices I moved from nowhere to somewhere forward I suppose.

    Thank you for your time.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Log in

Log in