STAR TREK 2d20
Page 2 of 2 First 12
  1. #11
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by Trenloe View Post
    If you've used a structured programming language before then just using the references in the scripting section of the ruleset modification guide should be enough to refer to when you need LUA specific info: https://www.fantasygrounds.com/modguide/scripting.xcp

    If you haven't programmed before then you'll need to spend some time understanding how to do structured computer programming - there's no quick way around this, spending the time now will save you hours in the long run (and save the sanity of the helpful community members). Do a search for "beginning lua" and see what comes up. The Wrox Press Beginning Lua Programming is an excellent book, free in PDF format here: https://it-ebooks.info/book/2556/

    You only need to know the very basics of XML - that is, how tags and properties work. The rest is all FG specific. There is various documentation about the FG APIs here: https://www.fantasygrounds.com/refdoc/ This is the deep down stuff of how the various components of FG work, are defined and how you can customise them.

    Then it's a case of starting to look at the FG code. damned's more core extension is a good one to look at - as he's put comments in the code and it deals with specifics of extending the CoreRPG character sheet and Combat Tracker. If this isn't your thing, you might want to pick a piece of small functionality you're interested in learning, modifying or adding and then dive into the code. However, this can quickly get very confusing.
    I have abused the sanity of many helpful people thru my lack of coding knowledge, patience and ability... to you all - you have my eternal gratitude for what that is worth.

    For adding another Tab on the Char Sheet I think its all XML from memory... no need for LUA to add that extra sheet.

  2. #12
    Hi, I've been learning a bit about coding and I believe I made some progress. I got the new tab, but FG tells me it couldn't find the window class I created, which is charsheet_espec. I edited the record_char to create the new tab and I specified the subwindow thing there too. Also created another xml file which contains the information for this new tab. But still FG tells me:

    Ruleset Error: subwindow: Could not find windowclass (charsheet_espec) for control (specializations) in windowclass (charsheet)
    Ruleset Warning: bitmapwidget: Logical icon (tab_espec) does not exist

    And also this bitmapwidget error, I created the icon for the new tab and named it tab_espec inside the tabs folder. So anyways I'm stuck and hopefully you can help me here. I'll post two screenshots too

    Thanks (:

    Attachment 10675
    Attachment 10676

  3. #13
    The windowclass below yours (char_spec_category_header) in that pic has a <frame> property while yours is missing that line (2nd line of the block). Is that required?

  4. #14
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by danielhalond View Post
    Also created another xml file which contains the information for this new tab.
    Sounds like you haven't put this new file in an <includefile> statement in your extension/ruleset. Have a look at an ruleset base.xml file or an extension extension.xml file for some examples.
    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. #15
    Quote Originally Posted by Trenloe View Post
    Sounds like you haven't put this new file in an <includefile> statement in your extension/ruleset. Have a look at an ruleset base.xml file or an extension extension.xml file for some examples.
    Yes, I figured that out. Thanks Trenloe! You were totaly correct. It seems we are very close to complete this. I got another error. I copied the code from record_char_main, so in that tab I'll have the same utilities, but that generated another problem. It is duplicating the code, and I believe that's because of list_charmainattribute (correct me if i'm mistaken). So I went to template_char and added a list_charmainattribute2 like this:

    <template name="list_charmaincategory2">
    <windowlist>
    <class>char_main_category2</class>
    <datasource>.maincategorylist2</datasource>
    <columns width="222" filldown="true"/>
    <allowcreate />
    <allowdelete />
    <sortby><field>label</field></sortby>
    <script>

    function onListChanged()
    update();
    end

    function update()
    local sEdit = getName() .. "_iedit";
    if window[sEdit] then
    local bEdit = (window[sEdit].getValue() == 1);
    for _,wCategory in ipairs(getWindows()) do
    wCategory.idelete.setVisibility(bEdit);
    wCategory.attributes_iadd.setVisible(bEdit);
    wCategory.attributes.update(bEdit);
    end
    end
    end

    function addEntry(bFocus)
    local w = createWindow();
    if bFocus then
    w.header.subwindow.label.setFocus();
    end
    return w;
    end
    </script>
    </windowlist>
    </template>

    but it isn't enough. I gotta create char_main_category2 and .maincategorylist2 but I don't know where :T

  6. #16
    I did it! Thanks for all the help!

    Now it doesn't seem that hard xD. Anyways, the last step was to edit record_char_main and add a windowclass named char_main_category2, so I went back to template_char and used that windowclass.

    Anyways I don't know, maybe someone tries to do the same thing so I'll paste the steps I did it:

    First I edited record_char.xml > I created a subwindow and a tab
    Then I created a .xml file with the codes I needed, in this case the same as the main tab (record_char_main.xml)
    Then I included that xml, editting the 'base.xml' (ex: <includefile source="campaign/record_char_spec.xml" />)
    In this step I got a problem because since the code was duplicated the new tab had the same information as the tab I copied from (which was the main tab)
    Then I edited the record_char_main and added the new windowclasses I needed, same thing with record_char and that is (:

    Thanks again for the patience, for the attention and everything. )))

  7. #17
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Glad you got it working.

    Are you modifying the ruleset directly or using an extension?

    If you're modifying the ruleset, make sure you rename the ruleset or make a copy so that future FG updated don't overwrite your work.
    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!

  8. #18
    I'm modifying the ruleset directly. I made a backup. Is if possible to achieve the same results using extensions?

  9. #19
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by danielhalond View Post
    Is if possible to achieve the same results using extensions?
    Absolutely, an extension would be the best way to do it. Check out the More Core Extension and https://www.fantasygrounds.com/forum...ight=extension
    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!

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