PDA

View Full Version : Jeff's Excruciatingly Simple Extension Tutorial



jreddin1
July 19th, 2015, 15:46
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

damned
July 20th, 2015, 13:32
Loving your work jreddin1!

lordjeb
August 6th, 2015, 06:50
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!

kylania
August 6th, 2015, 15:10
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
<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?

damned
August 6th, 2015, 15:22
In this tutorial, which works just great, you have root set to
<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....

Trenloe
August 6th, 2015, 17:22
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/

jreddin1
August 12th, 2015, 21:07
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...

jreddin1
August 12th, 2015, 21:08
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!

Trenloe
August 12th, 2015, 21:23
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: 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:

<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" />

lochost
August 12th, 2015, 21:24
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

;-)

lochost
August 13th, 2015, 08:31
By the way, I've got an issue : I've reproduced exactly your code, etc, but the window is still not resizabe. The <resize_campaignlistwithtabs /> tag doesn't seem to work. Do I have to do an includefile or something do I do somethin wrong ?

I've got this output in the consloe :


Ruleset Warning: Could not find template (sizelimits) in windowclass (TutorialWindow)
Runtime Notice: s'self' | windowinstance = { class = TutorialWindow, node = nil, x,y,w,h = 412,284,200,200 }
Runtime Notice: s'getclass' | s'TutorialWindow'
Runtime Notice: s'getDatabaseNode' | nil
Runtime Notice: s'getFrame' | s'campaignlistwithtabs'

The mouse's cursor isn't even shapeshifting when hovering over TutorialWindow's bottom right corner :cry:

Any hint ?

LordEntrails
August 15th, 2015, 01:45
I've duplicated what lochost has encountered. the only output I get in the console is;


Ruleset Warning: Could not find template (sizelimits) in windowclass (TutorialWindow)

I'm running it in a new CoreRPG Campaign. I'm guessing that "sizelimits" comes from one of the other rulesets (5E maybe)?
p.s. how'd you get that code block?

dberkompas
August 15th, 2015, 01:59
Go into the Advanced editor, select the text you want in a code block, and hit the # symbol.


I'm a code snippet, if there was more, I might be a full block.


BoomerET

LordEntrails
August 15th, 2015, 05:05
I've duplicated the re-sizing error and resolved it.

The <sizelimits> has to be declared outside of the <sheetdata> tag. Page 10 of your tutorial shows;

<sheetdata>
<banner_campaign>

<icon>TutorialTitle</icon>

</banner_campaign>

<sizelimits>

<dynamic />

</sizelimits>

<close_campaignlist />

<resize_campaignlistwithtabs />
</sheetdata>



But the appendix shows it correctly;


<sizelimits>
<dynamic />
</sizelimits>
<sheetdata>
<banner_campaign>

<script>
...


Still a great tutorial. Thanks

lochost
August 16th, 2015, 17:02
wasn't home this weekend, on my way home, I can't wait to try this ! Thanks Jeff for the great tuto, and thank's Lord entrails for the solution !

jreddin1
August 22nd, 2015, 14:02
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...

Yep. Definitely copy-pasta error. Fixed now (In all the places I copy pasted), plus a few spelling errors I noticed. Thanks for the feed back!

jreddin1
August 22nd, 2015, 14:03
I've duplicated the re-sizing error and resolved it.

The <sizelimits> has to be declared outside of the <sheetdata> tag. Page 10 of your tutorial shows;

<sheetdata>
<banner_campaign>

<icon>TutorialTitle</icon>

</banner_campaign>

<sizelimits>

<dynamic />

</sizelimits>

<close_campaignlist />

<resize_campaignlistwithtabs />
</sheetdata>



But the appendix shows it correctly;


<sizelimits>
<dynamic />
</sizelimits>
<sheetdata>
<banner_campaign>

<script>
...


Still a great tutorial. Thanks

It was a copy paste error. If you look at the "final" in the appendix, it's right there. I've fixed it now, thanks to the sharp readers!

Ken L
April 21st, 2016, 10:46
So I finally decided to work on an extension rather than simple modules and Jeff; this is exactly the jumpstart I was looking for.

jreddin1
April 21st, 2016, 13:43
So I finally decided to work on an extension rather than simple modules and Jeff; this is exactly the jumpstart I was looking for.

Thanks! I'm glad it's helping out. I'm thinking about writing a new extension myself. I'll probably have to refer to my own guide to refresh my memory. Sucks getting old...

Minty23185Fresh
April 23rd, 2016, 17:22
Thanks Jeff for an incredibly useful tutorial. I worked through it over the course of a couple days. Copying and pasting code a little at a time. Oddly enough, I had a couple typos that caused me some grief! I still have something wrong in my code, anchoring seems to be the issue. I'll chase it down on my own, helping solidify the lessons learned. And it doesn't unnecessarily string this thread out to 50 pages in length. As mentioned in the tutorial some controls are non functional. One thing that might be nice is a screen shot of your final resultant window. I'd know if I'm chasing red herrings then. Again thank you so much for the excruciating time you spent documenting this project for others, like me, to follow!

Tuendal
October 8th, 2016, 18:45
Ok, so following the tutorial to learn how to meddle with extensions. I am following the tutorial and here is my code.



<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<icon file="graphics/TutorialWindow.png" name="TutorialWindow" />
<windowclass name="TutorialWindow">
<frame>campaignlistwithtabs</frame>
<sizelimits>
<dynamic />
</sizelimits>
<sheetdata>
<banner_campaign>
<icon>TutorialWindow</icon>
</banner_campaign>
<close_campaignlist />
<resize_campaignlistwithtabs />
</sheetdata>
</windowclass>
</root>



Based on what i have been reading this should allow for resizing, but it does not appear to be working. I see the resize icon at the bottom right, but its not allowing me to resize.


Ok, I figured it out. I didn't save the extension.xml file after changing the version to 3.0 in the root tag. It's working now.

Tuendal
October 8th, 2016, 19:10
Another question i have, and this is because i have very little background with XML or LUA, but in the example we are using an Image for the title of the window, is it possible to just use a Text box and not an image? I'm more or less wanting to streamline some of the boxes and the images don't scale well and want more of a minimal feel for some of the windows.

damned
October 9th, 2016, 01:21
Try something like this for sizing:

set an initial size


<placement>
<size width="515" height="610" />
</placement>

and what dimensions can be changed


<sizelimits>
<minimum width="515" height="610" />
<maximum width="515" />
<dynamic />
</sizelimits>

I believe the headings are always on an image... but you can redefine the image to something smaller.

jreddin1
October 9th, 2016, 14:41
Glad you figured it out. I didn't see anything obvious, and I wouldn't have guessed what the problem was, based on your solution! I hope you found the tutorial helpful.

jreddin1
October 9th, 2016, 14:43
Another question i have, and this is because i have very little background with XML or LUA, but in the example we are using an Image for the title of the window, is it possible to just use a Text box and not an image? I'm more or less wanting to streamline some of the boxes and the images don't scale well and want more of a minimal feel for some of the windows.

As far as I can tell, the headers must be images. I haven't found any examples anywhere else in FG that works differently, and there doesn't seem to be anything in the docs. At one point, I was going to see if I could find a way to generate the image in Lua if it didn't exist, but it really is just too much work for too little benefit. Maybe when the Unity version comes out, they will be more dynamic with the labels.

bnickelsen
October 26th, 2016, 15:32
If I wanted to look at an existing Extension. Using Notepad ++ how woudl I do it?

Trenloe
October 26th, 2016, 15:47
If I wanted to look at an existing Extension. Using Notepad ++ how woudl I do it?
Change the .ext file extension to .zip and unzip.

Some info on what you'll find inside can be found here: https://www.fantasygrounds.com/modguide/extensions.xcp And, of course, in the guides found in post #1 of this thread.

jreddin1
October 26th, 2016, 16:10
Change the .ext file extension to .zip and unzip.

Some info on what you'll find inside can be found here: https://www.fantasygrounds.com/modguide/extensions.xcp And, of course, in the guides found in post #1 of this thread.

Dang. Once more the ever-present-eye (and keyboard) of Trenloe beat me to the punch.

Nylanfs
October 26th, 2016, 17:06
It's cause he is an AI and present all the time online.

Laramie Wall
November 29th, 2016, 10:37
First, thanks to anyone who wants to field this. I haven't coded in ABOUT 15 years, but thought I'd try my hand again. Frankly, I'm pretty confused what I'm missing.

This is a GREAT tutorial, and on the read through, I thought I'd go back and try to do the interactive play-by-play. I can NOT get extension.xml to even appear as an option. Saved as ...\AppData\Roaming\Fantasy Grounds\extensions\extension.xml. File is simply a straight copy paste from page 5 of tutorial I. Tinkered with the root release and root version. Nothing. FG version 3.2.1. I've been dinking away for about 90 minutes and can't even get the option to load the XML as an extension.

Seriously, I'm sure I'm missing something quite obvious, but would welcome any help. Thank you again. (For completion sake in checking typos, copied code follows).

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- This is our MVP for the Extension Tutorial -->
<root release="3.0" version="3">
<properties>
<name>Extension Tutorial - Jeffery W. Redding</name>
<version>0.0.1</version>
<author>Jeffery W. Redding</author>
<description>
A really simple extension file for
creating a really simple extension
</description>
</properties>
<base>
<includefile source="xml/TutorialWindow.xml" />
</base>
</root>

damned
November 29th, 2016, 11:09
we will call your fantasy grounds data folder \fantasy grounds
in there you have a bunch of other folders like \tokens, \rulesets, \modules, \extensions and more
inside these you will find various files often with specific file extensions like .mod for modules, .pak for rulesets and .ext for extensions
these are actually zip files in a specific layout and with the correct extension for the data type
you can do it without the zip file too

so for your extension you want to create a folder \fantasy grounds\extensions\myextension
and your files live in there starting with extension.xml
you can zip it up but generally you dont until you have finished building it - its much quicker to keep hacking away at the unpacked files rather than unpacking, edit, repack, test, repeat

Laramie Wall
November 29th, 2016, 11:22
Firstly, thank you so much for your help. I guess I missed that direction, totally on me. Thank you.
Second, thank you for your quick response, and three cheers for the six hour time difference.

Ready to rock. Thank you.

damned
November 29th, 2016, 11:31
Firstly, thank you so much for your help. I guess I missed that direction, totally on me. Thank you.
Second, thank you for your quick response, and three cheers for the six hour time difference.

Ready to rock. Thank you.

Cool. Keen to see what you come up with.

Laramie Wall
November 29th, 2016, 11:38
Weeeelllll, don't get your hope TOO up, since I'm trying to learn to code again, and the languages of choice have changed in 15 years. But, I'd like to get together with some other people and work on a HackMaster setup.

damned
November 29th, 2016, 12:03
Weeeellll.....

Have a look at this ruleset...
https://www.fantasygrounds.com/forums/showthread.php?34860-MoreCore-Ruleset

and check out posts #64 and onwards....
https://www.fantasygrounds.com/forums/showthread.php?34860-MoreCore-Ruleset&p=303703&viewfull=1#post303703
Feel free to give that dice extension a go too and I might build you a basic (MoreCore) ruleset....

And some example themes...
https://www.fantasygrounds.com/forums/showthread.php?35056-MoreCore-Themes

And an example quick start ruleset conversion of another game...
https://www.fantasygrounds.com/forums/showthread.php?35156-MoreCore-City-Of-Mist-Starter-Set

Laramie Wall
November 29th, 2016, 12:27
Excellent.
Thanks for the heads start.

Trenloe
November 29th, 2016, 15:50
And lots of background info here (and reference links): https://www.fantasygrounds.com/forums/showthread.php?20651-Modifying-the-CoreRPG-ruleset

Laramie Wall
November 30th, 2016, 07:12
...

Laramie Wall
December 2nd, 2016, 10:15
OK.
Adding a title graphic. (step 6)
"Ruleset Warning: Could not find template (banner_campaign) in windowclass (TutorialWindow)" Presuming another bonehead move on my part, but I can't sort it out. Correct me if I'm wrong, this isn't an issue of the file I'm utilizing as TutorialTitle, but of the location of banner_campaign?
Thanks again for all the help, and sorry about making a mess of the thread.

damned
December 2nd, 2016, 12:02
post the windowclass here please?

Laramie Wall
December 2nd, 2016, 16:38
Sorry, that's relevant data.
<windowclass name="TutorialWindow">
<frame>campaignlistwithtabs</frame>
<sheetdata>
<banner_campaign>
<script>
function onInit()
Debug.console("self", self)
end
</script>
<icon>TutorialTitle</icon>
</banner_campaign>
<close_campaignlist />
</sheetdata>
</windowclass>

Laramie Wall
December 2nd, 2016, 17:10
Disregard.
Situation resolved.
Ruleset has changed, no longer includes "

<template name="banner_campaign">
<genericcontrol>
<bounds>16,22,30,177</bounds>
</genericcontrol>
</template>

"

bigbluepaw
January 26th, 2017, 17:38
Hey folks. I've encountered what I *think* is an error in the tutorial.

In step 6 in the first tutorial, a new snippet of code in the TutorialWindow.xml calls for a <banner_campaign>. Here is the code.


<banner_campaign>
<icon>TutorialTitle</icon>
</banner_campaign>

As soon as I added this, I got this error in the console.



Ruleset Warning: Could not find template (banner_campaign) in windowclass (TutorialWindow)


I tried this in both 5e and 3.5. I get the error in both.

Am I doing something wrong?

damned
January 27th, 2017, 03:20
Hi BigBluePaw - Ive not tried this tutorial.
That error message means it cant find the template banner_campaign.
If you look at the post above it appears that this template has been deprecated.
This was the banner style graphics that came down from top left hand corner of the window...

This will require some updating of the tutorial to work with the newer layouts.

What is it you are trying to achieve?

bigbluepaw
January 27th, 2017, 03:31
Wh00t. I resolved it on my own. A hint at how to solve it is in the second tutorial. Here is the quick fix.

1.) Create ExtTutorial_Templates.xml in the XML directory.

2.) Add the following code to it. This is the entire thing.


<?xml version="1.0" encoding="iso-8859-1"?>
<!-- This is our MVP for the Extension Tutorial -->
<root release="3.0" version="3">
<!-- This creates the banner_campaign template -->
<template name="banner_campaign">
<genericcontrol>
<bounds>16,22,30,177</bounds>
</genericcontrol>
</template>
</root>

3.) Go to your extensions.xml and add the following code.


<includefile source="xml/ExtTutorial_Templates.xml" />

This should go right after this code.


<includefile source="xml/TutorialWindow.xml" />

As I understand it, this resource was depreciated (removed) from FG. So you have to create it yourself with ExtTutorial_Templates.xm, declare it in extensions.xml and then call it from TutorialWindow.xml.

While frustrating, this was a valuable experience. Thanks!

bigbluepaw
January 27th, 2017, 03:49
Redundant post. Ignore.

damned
January 27th, 2017, 03:51
Well done bigbluepaw - what are you trying to make?

bigbluepaw
January 27th, 2017, 03:55
Just trying to get familiar with the functionality right now. But my motivation is to create a tool for navigation, travel, exploration and tracking. It will also build out travel days taking foraging, searching, sneaking, random encounters, hazards and more. It will actually be very similar to the Combat Tracker, only with different functionality. It is my attempt to make the Out of the Abyss travel sections far more interesting and engaging.

bigbluepaw
January 27th, 2017, 04:07
Well this is strange. I don't get any errors in the console, but when the window comes up, the image for the header is teeny-tiny instead of being fullsized. Furthermore, it is not in the middle of the header. It is offset to the left and below, almost in the middle of the window.

It looks like it uses the <icon> tag, but I don't see where the placement is controlled.



<banner_campaign>
<script>
function onInit()
Debug.console("self", self)
ExtTutorial.setIconByRuleset(self)
end
</script>
<icon>TutorialTitle</icon>
</banner_campaign>


The point of the tutorial is made: you can use a lua script to change what is shown in a window. But it seems like something funky is going on.

damned
January 27th, 2017, 05:58
Screenshot please.

bigbluepaw
January 27th, 2017, 14:48
Sure.

Here is the image resource to be used as the banner for the window in 5e.

17648

Here is how the image is being displayed on the 5e window.

17649

In contrast, here is the image resource for rulesets that are not 5e.

17647

Here is how that image is displayed in a 3.5 window.

17650

These two campaigns use the exact same extension.

bigbluepaw
January 27th, 2017, 18:57
Hey folks. Ran into a different issue. Can anyone help me diagnose what I'm doing wrong?

This is step 3.1 to 4.1 in the tutorial.

I have defined a new template in a file ExtTutorial_Templates.xml


<template name="button_edit_entries">
<buttoncontrol>
<anchored width="20" height="20">
<position>insidebottomright</position>
<top anchor="bottom" offset="-90"/>
<right offset=”-30” />
</anchored>
<state icon="button_edit" tooltipres="button_editon" />
<state icon="button_edit_down" tooltipres="button_editoff" />
</buttoncontrol>
</template>

I have registered it in my extensions.xml.


<includefile source="xml/ExtTutorial_Templates.xml" />

I then call it from within my windowclass.


<button_edit_entries name=”list_edit” />

However, the little edit buttons that should appear in the bottom right corner aren't there.

Any ideas?

Zacchaeus
January 27th, 2017, 21:47
I know nothing about coding but I do know that there were wholesale changes to all sorts of frames and window classes etc in v 3.2; so I think as damned mentioned above this tutorial may not be compatible with the new version and is therefore out of date. I don't know if this is correct or not; but if someone who knows about such things could let me know then I'll unsticky this thread so that others don't have similar issues as bigbluepaw appears to be having.

bigbluepaw
January 27th, 2017, 21:52
Well, I learned a TON doing this tutorial. While the other one is interesting, it doesn't cover nearly as many concepts as this one does. I found it invaluable, even if it has some issues.

damned
January 28th, 2017, 00:19
Sure.

Here is the image resource to be used as the banner for the window in 5e.

17648

Here is how the image is being displayed on the 5e window.

17649

In contrast, here is the image resource for rulesets that are not 5e.

17647

Here is how that image is displayed in a 3.5 window.

17650

These two campaigns use the exact same extension.

as mentioned earlier these used to be "banners that hung down" from the top of the page. Its still trying to do that with your image but doesnt know how to.
this has largely all been deprecated with the new groups and with every data type having its own sidebar icon instead of some being nested (encounters, parcels etc).

damned
January 28th, 2017, 00:20
Im not sure but possible the edit buttons wont be available until they are attached to some sort of list?

bigbluepaw
January 28th, 2017, 01:02
K. I'll try that.

statik37
August 9th, 2019, 20:46
Are these PDF's still valid, or outdated with update changes?

Trenloe
August 9th, 2019, 20:56
Are these PDF's still valid, or outdated with update changes?
The principles behind them are unchanged. The only thing that might change is if code from specific rulesets is used as examples, that code may have changed since the guides were written.

OSdirk
March 24th, 2020, 18:33
I'm working on this tutorial, and can't get it to display the "TutorialTitle.png" file, despite having followed the XML to the letter. Has something changed about the required commands?

Beemanpat
October 4th, 2021, 03:28
I'm working on this tutorial, and can't get it to display the "TutorialTitle.png" file, despite having followed the XML to the letter. Has something changed about the required commands?

I'm attempting this also amd seem to be stuck in the same place. Did you have any luck figuring it out?

damned
October 4th, 2021, 12:37
You might find some of these helpful in getting started...
https://www.youtube.com/watch?v=R_CulFJYs-M&list=PLsgd1zJLdiKVbJg6KJv668LyJXmfk25Yv

jreddin1
October 4th, 2021, 14:04
That tutorial is pretty old at this point, and I haven't updated it. I know a lot has changed, so it's likely that something that DID work doesn't work anymore. If I get a chance, I'll take a look at updating it.

Beemanpat
October 4th, 2021, 16:28
That tutorial is pretty old at this point, and I haven't updated it. I know a lot has changed, so it's likely that something that DID work doesn't work anymore. If I get a chance, I'll take a look at updating it.

I'll try to document and I'll send what i figure out to you so we can get things updated. I figured out some stuff doing my best to process and retain the lesson learned so I can share.

@damned thanks for the video's very useful.

jreddin1
October 4th, 2021, 17:31
I figure out the issue (at least the title issue).

It used to be that you had to provide a graphics file (png) for the title. At some point, they modernized it so that you could provide a string instead and the title would be automagically formatted to put the string on the graphic as needed. Here is the code I used to put a title on. It's pretty straight forward. It adds a string resource for the title, and then adds a windowtitlebar with that resource.



<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<icon file="graphics/TutorialTitle5E.png" name="TutorialTitle" />
<string name="tutorial_title">Tutorial</string>
<windowclass name="TutorialWindow">
<frame>campaignlistwithtabs</frame>
<sheetdata>
<banner_campaign>
<icon>TutorialTitle</icon>
</banner_campaign>

<windowtitlebar name="title">
<resource>tutorial_title</resource>
</windowtitlebar>

<close_campaignlist />
</sheetdata>
</windowclass>
</root>


That should do it. Let me know if you find anything else, and I'll see if I can fix that too!

Larson
December 1st, 2022, 02:11
So, I'm in the Tutorial at the Minimum Viable Product Step 4 where it says to switch to using <frame>campaignlistwithtabs</frame>

and it doesn't do anything at all. (The previous steps have worked.)

Has FGU now dropped the campaignlistwithtabs? If so, what can I use instead (in the tutorial)?

damned
December 1st, 2022, 02:43
This tutorial was written a long time ago. I havent tried it.
What you should do is unpack CoreRPG and then use an editor with Find In Files functionality and search for campaignlistwithtabs and see what it finds, follow it back until you find your answer.

Larson
December 1st, 2022, 10:24
Where do I find CoreRPG and how do I “unpack” it?

Moon Wizard
December 1st, 2022, 18:52
Any non-vaulted rulesets and extensions are located in the FG data folder under rulesets and extensions subfolder. You can get to the FG data folder using the folder button on the launch screen.

There is a whole topic devoted to where files are located, and how they work in the Developer Guide on the wiki that you should read.
https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644323/Data+Files+Overview

Regards,
JPG

LordEntrails
December 4th, 2022, 17:32
Be aware, once you unpack core rpg (or any ruleset or module) FG will no longer see updates to that item (because the compressed file will get updated, but FG always reads unpacked references first)