Page 1 of 6 123 ... Last
  1. #1

    Jeff's Excruciatingly Simple Extension Tutorial

    Jeff's Excruciatingly Simple Extension Tutorial

    Overview
    This is a very detailed tutorial that goes from soup-to-nuts on how to build a simple extenstion for Fantasy Grounds. The exension used is a trimmed down version of the Chatnomicon Extension that allows the user to save frequently used chat messages, with their associated chat type, and send them with a single click. It covers all the basics of creating a new window, using a database, coding some lua, and using the chat interface.

    I've tried to include as much basic material as I could, without teaching XML, Lua or any kind of graphics program.
    Feedback is welcome and appreciated.

    Getting Our First Window Going (8/22/2015)*New Update

    Introduction
    The (Very) Basics
    1. Anatomy of an Extension
    2. Directory Structure
    3. XML at the 50,000 ft. Level
    Minimal Viable Product
    1. Creating Our Extension File
    2. TutorialWindow.xml
    3. Let's run it!
    4. Finding a better base
    5. Adding the close button
    6. Adding a title graphic
    7. Resize this Sucker!
    Getting a little Lua going
    1. Lua are you?
    2. Adding some Lua script
    3. Adding a simple script in a windowclass
    4. Deeper into our script
    5. Time for the Meat!
    5.1. Finding our methods
    5.2. Finishing touches
    That's a Wrap!
    Appendix A: The Final Result

    Getting Some Content and Data (7/19/2015)

    Introduction
    Getting Rolling
    1. Let's Talk Data
    2. One Func to Bind Them All
    2.1. The lua bits
    2.2. The Extension Bits
    2.3. String Theory
    3. Planning Our Layout
    3.1. Temple of the Templates
    4. Get Some Control
    4.1. Add Some Edit
    4.2. Add Some Add
    4.2.1. First, the Button Part
    4.2.2. Disappearing Act
    5. Deeper Into the Woods
    5.1. Let's List, Lucky Lou!
    5.2. Getting Classy
    5.3. Fill in Some Templates
    5.4. Time to Get Dirty with the DB
    5.5. Cleaning Up After Ourselves
    5.5.1. First, Let's Lua
    5.5.2. Delete is Easy
    Wrap Part Deaux
    Appendix A: Our Starting Point
    Appendix B: Our Ending Point

    Heavy Coding (??/??/2015)

    PDFs Be Here
    Attached Files Attached Files
    Last edited by jreddin1; August 22nd, 2015 at 15:00.

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    19,071
    Blog Entries
    1
    Loving your work jreddin1!

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

  3. #3
    Great work. Just finished the part 1 tutorial and my only feedback would be that for me the sizelimits element had to be a child of windowclass, not a child of sheetdata in order for the resizing to work. Really looking forward to the second tutorial as well. Thanks!

  4. #4
    root: This tag is the base, or outermost, tag for every XML file used by FG. The name/value
    pairs inside the tag are called “attributes”. It's REALLY important to get the right release and
    version in this tag! This is NOT the release and version of your extension, but rather the release
    and version of FG that you've built your extension for.
    In this tutorial, which works just great, you have root set to
    Code:
    <root release="3.0" version="3">
    How are we supposed to know what goes in there since to a normal user we're on version 3.1.2. I assume "release = '3'" comes from the 3. but where does the "version = '3'" value come from? .1 + .2 = version 3?

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    19,071
    Blog Entries
    1
    Quote Originally Posted by kylania View Post
    In this tutorial, which works just great, you have root set to
    Code:
    <root release="3.0" version="3">
    How are we supposed to know what goes in there since to a normal user we're on version 3.1.2. I assume "release = '3'" comes from the 3. but where does the "version = '3'" value come from? .1 + .2 = version 3?
    Im pretty sure that the "release" will indicate what FG version features to support / extension is dependant on.
    The "version" is your version number..... I believe....

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,208
    The root version is a special parameter. It is used for backwards compatibility to ensure older rulesets coded for features in the base FG application that have changed or been deprecated. See the version number/compatibility changes here: http://www.fantasygrounds.com/refdoc/
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    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!

  7. #7
    Basically, the release is the version of FantasyGrounds that your extension is expecting to extend. So, by using 3.0, then any FG release that is 3.x should work with the extension. If you used 2.0, then your extension won't work with anything in 3.x because there were significant changes between 2.x and 3.x. If you want to be specific, you could specify 3.1, but then your extension won't load for someone with 3.0, or 2.9, etc.

    Most people keep their FG updated most likely, so using the latest version in your extension probably won't be an issue. The key here is that "release" is not YOUR release, it's the FG release.

    Version doesn't seem to do much of anything that I can tell, but i think it's supposed to be where the '2' in '3.1.2' would go...

  8. #8
    Quote Originally Posted by lordjeb View Post
    Great work. Just finished the part 1 tutorial and my only feedback would be that for me the sizelimits element had to be a child of windowclass, not a child of sheetdata in order for the resizing to work. Really looking forward to the second tutorial as well. Thanks!
    Sounds like a copypasta error. I'll have to take a look when I get a chance and update. Thanks for the catch!

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,208
    Quote Originally Posted by jreddin1 View Post
    Basically, the release is the version of FantasyGrounds that your extension is expecting to extend. So, by using 3.0, then any FG release that is 3.x should work with the extension. If you used 2.0, then your extension won't work with anything in 3.x because there were significant changes between 2.x and 3.x.
    Sorry, this isn't correct. "release" in the <root> XML tag of a extension doesn't mean anything. See the "extension.xml" section here for more info on the data that is relevant: http://www.fantasygrounds.com/modguide/extensions.xcp

    And more info on the <properties> section of extension.xml here: http://www.fantasygrounds.com/refdoc/properties.xcp

    The "release" parameter is used in the <root> definition of a ruleset (in the base.xml file). See the "Ruleset dependencies" section here: http://www.fantasygrounds.com/modguide/extensions.xcp This can then be used by extensions to set a <minrelease> version of a ruleset to load.

    Note: rulesets don't use "release" numbers that we're familiar with. For example, the current v3.1.2 5E ruleset uses release="6". In the 5E ruleset base.xml file:
    Code:
    <root version="3.0" release="6" logo="logo.png">
    	<announcement text="5E ruleset v3.1.2 for Fantasy Grounds\rCopyright 2015 Smiteworks USA, LLC" font="emotefont" icon="rulesetlogo_5E" />
    Last edited by Trenloe; August 12th, 2015 at 22:26.
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    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!

  10. #10
    A huge THANK YOU Jeff !!! I was desperated not finding any "Hello World" for our favourite software, and I found your tuto. Normally I should and would have presented myself in the appropriate forum's section before, but I needed too much toi say thx that I write here first

    ;-)

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