-
July 19th, 2015, 15:46 #1
- Join Date
- Apr 2015
- Posts
- 82
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 ExtensionMinimal Viable Product
2. Directory Structure
3. XML at the 50,000 ft. Level
1. Creating Our Extension FileGetting a little Lua going
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!
1. Lua are you?That's a Wrap!
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
Appendix A: The Final Result
Getting Some Content and Data (7/19/2015)
Introduction
Getting Rolling
1. Let's Talk DataWrap Part Deaux
2. One Func to Bind Them All
2.1. The lua bits3. Planning Our Layout
2.2. The Extension Bits
2.3. String Theory
3.1. Temple of the Templates4. Get Some Control
4.1. Add Some Edit5. Deeper Into the Woods
4.2. Add Some Add
4.2.1. First, the Button Part
4.2.2. Disappearing Act
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
Appendix A: Our Starting Point
Appendix B: Our Ending Point
Heavy Coding (??/??/2015)
PDFs Be HereLast edited by jreddin1; August 22nd, 2015 at 14:00.
-
July 20th, 2015, 13:32 #2
-
August 6th, 2015, 06:50 #3
- Join Date
- Jul 2015
- Location
- Eagle Mountain, UT
- Posts
- 66
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!
-
August 6th, 2015, 15:10 #4root: 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.Code:<root release="3.0" version="3">
-
August 6th, 2015, 15:22 #5
-
August 6th, 2015, 17:22 #6
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: https://www.fantasygrounds.com/refdoc/
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!
-
August 12th, 2015, 21:07 #7
- Join Date
- Apr 2015
- Posts
- 82
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...
-
August 12th, 2015, 21:08 #8
- Join Date
- Apr 2015
- Posts
- 82
-
August 12th, 2015, 21:23 #9
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: https://www.fantasygrounds.com/modguide/extensions.xcp
And more info on the <properties> section of extension.xml here: https://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: https://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 21:26.
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!
-
August 12th, 2015, 21:24 #10
- Join Date
- Jun 2015
- Posts
- 40
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)
Bookmarks