PDA

View Full Version : Exporting Tokens



Kapkomm1
August 26th, 2013, 00:32
Hello all! Another question from TIBTK. I read somewhere that you no longer have to "double" export tokens. Does this mean that if you add a token to an NPC and then export the NPC the token goes with it? And...does this mean you don't have to explicitly export tokens with your NPCs, that merely adding a token to the NPC does the trick? :confused:

Thanks,
TIBTK

Moon Wizard
August 27th, 2013, 00:10
I haven't used this feature personally, but reviewing the FG code, it appears that the token image references of any token data structures exported should also be copied to the module file.

Cheers,
JPG

Targas
January 23rd, 2014, 21:05
Does anybody know how to create a Token Module, such as the ones provided with FG ? I want to save on memory and I hope even startup loading time will be much faster this way. The Export function just will allow to drag tokens individually to it (with the C&C ruleset), but not to put several token bags into it for example.

Trenloe
January 23rd, 2014, 21:15
Does anybody know how to create a Token Module, such as the ones provided with FG ? I want to save on memory and I hope even startup loading time will be much faster this way. The Export function just will allow to drag tokens individually to it (with the C&C ruleset), but not to put several token bags into it for example.
Have a look at the token .mod files that come with Fantasy Grounds. Open the FG app data folder (click the "Open Data Folder" icon to the top right of the first screen of Fantasy Grounds - above the version number) and go to the "modules" directory.

The .mod files in this directory are actually ZIP files with the .ZIP extension changed to .mod. If you make a copy of lettertokens.mod and change the extension to .zip you will be able to open the token module and see the structure - basically a "tokens" folder, a definition.xml file and a thumbnail.png file - these last 2 are used to display the module information in the module activation screen.

You could create your own token module with multiple folders within the top level "tokens" folder in the .mod file.

You'll need to be a little bit familiar with unzipping and zipping up files and a tiny bit of XML editing to change the name of the token module in definition.xml (but that is pretty self explanatory).

Griogre
January 23rd, 2014, 21:59
Token modules are library modules so they have to built by hand. However, it is really easy to do.

1) Make or edit a definition.xml file. I've attached the one from FG's letter tokens so you can just edit it if you wish. Note: use Notepad *not* a word processor to edit the file if you don't have a code editor, its included on all windows installations in accessories. There are eight lines of XML in it:



<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.06">
<name>Letter Tokens</name>
<ruleset>Any</ruleset>
<author>JPG</author>
</root>


You are going to want to change two lines: the Name of the Module and the Author.

<name>Modules Name Displayed in Library Listing</name> This needs to be unique and I would stick to only alpha numeric characters.
<author>Can be Author or Further module description</author> This is the second line in the module listing.

Example of a definition.xml file I made for a token module for my Pirate's game:



<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.06">
<name>Pirate Tokens</name>
<ruleset>Any</ruleset>
<author>PotSM Campaign</author>
</root>


So basically you need to change two lines of XML if you edit the file below.

2) Next put all the tokens you want in the module in a folder called: tokens

3) Next you need a thumbnail.png. This is optional, its the icon that displays in the module list. It should not be any larger than like 64x64 pixels. The name is important, you need to rename the image so it is exactly "thumbnail.png". You may be able to use a jpg but I have never tried it here.

4) Zip the definition.xml file, the token folder and any thumbnail.png together. Use normal zip, not rar or zip7 and then change the resulting file extension from .zip to .mod (Windows will warn but say OK). FG's .mod files are normal zip files in disguise. Drop the .mod file into FG's data application modules folder and it should work. Note you have to restart FG if it is running since module files are only read in when FG starts.

Targas
January 24th, 2014, 07:47
Thank you for your quick and in depth explanation. I will try this out.

Griogre
January 25th, 2014, 09:52
You're Welcome. :)

ffujita
December 23rd, 2015, 06:54
OMG that was a lot of work -- but thanks to Griogre -- I did it. Thanks!

damned
December 23rd, 2015, 10:42
OMG that was a lot of work -- but thanks to Griogre -- I did it. Thanks!

Its not really that much work!
Unless of course you had LOTS OF TOKENS - in which case - very good move :)

Griogre
December 23rd, 2015, 19:36
OMG that was a lot of work -- but thanks to Griogre -- I did it. Thanks!

Glad you got it done. It's worthwhile if you have a lot of tokens. :)