Thread: Creating Tokens
-
December 9th, 2017, 16:32 #1
Creating Tokens
So there's
ImageControl.addToken(tokenPrototype,X,Y)
Where the prototype as defined in the XML database is simply a local path reference to an image. The function documentation notes that it should come from a token instance and thus should not be created. However the XML simply stores this as a string with the path. All my returns are coming up as 'nil' as expected by the documentation, but given I've found some undocumented behavior before, I was hoping to game the API a bit.
What is the reason for disallowing the creation of tokens through this way?
-
December 9th, 2017, 19:52 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,560
No images can be added to the system through the API at runtime. The architecture is not built to support that scenario. The closest thing is that the token and campaign images folders are re-parsed when receiving application focus to allow adding token/images during play.
Regards,
JPG
-
December 9th, 2017, 21:40 #3
So even if the images are in the tokens folder locally, and accessible and loaded by FG during launch, you can't create prototypes from them?
EDIT: This means I can only get prototypes from tokens that exist in a tokenfield already if I'm hearing this correctly, irrespective of the token themselves having been loaded by FG?Last edited by Ken L; December 9th, 2017 at 21:48.
-
December 9th, 2017, 22:52 #4
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Surely this will be fixed in FGU. I have had a request in ideainformer forever to get this fixed but programming requests never get any votes.
-
December 10th, 2017, 05:09 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,560
No, any valid images in the tokens folder will automatically given a token asset, but only when the application focus is removed from FG and returned to FG. The re-acquisition of the overall application focus is what triggers FG to rebuild the token folder assets and campaign image folder assets.
For tokens, you would then be able to access the token assets.
For images, you can only access the image assets through the image records created automatically.
Regards,
JPG
-
December 11th, 2017, 02:47 #6
-
December 14th, 2017, 03:57 #7
It works, turns out my reference array had spaces rather than underscores which is the proper name, way to shoot my foot over naming.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks