Starfinder Playlist

Thread: Creating Tokens

  1. #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?

  2. #2
    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

  3. #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.

  4. #4

    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.

  5. #5
    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

  6. #6
    Quote Originally Posted by Moon Wizard View Post
    No, any valid images in the tokens folder will automatically given a token asset
    That's odd, I've tried through several different means by specifying the relative path through the token folder ( tokens/<path>)and didn't come up with anything. I'll revisit this later on.

  7. #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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in