5E Character Create Playlist
  1. #1

    Tokens as Shortcuts

    [Programming question]
    Hey guys! Thanks again for all the help in my journey. New question.

    What must I do to make a token on a new record type (in this instance, planet, star system, colony, or vehicle) and have it so if I placed that token on a map, I could double click the token to get its record, much like if it was an entity on the combat tracker?

    The idea is to take a star chart, place graphics of planets and systems around, and have those graphics linked to a record.
    Last edited by pr6i6e6st; November 21st, 2019 at 07:45.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    This functionality is already there in CoreRPG based rulesets - but it is coded to open the linked combat tracker record. So, anything you'd add would need to be incorporated into this current structure - and maintained if the CoreRPG code changes in future versions.

    Look at the CoreRPG file: scripts\manager_token.lua - onDoubleClick function - this opens the linked record when the token is double-clicked.

    Have a look at scripts\manager_combat.lua - the replaceCombatantToken function. Within this, the Token.addToken API is called to add a link to the token as it is placed on the map. Note - this appears to be an undocumented API.

    Then, to see how this CombatManager.replaceCombatantToken function is called when a token is added to the map, look in ct\scripts\ct_token.lua - the onDragEnd function.

    You'll have to look at this whole process and how to integrate what you want to do into this without breaking the current double-click on token linked to the combat tracker functionality.
    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!

  3. #3
    Hmm, something like the ability to assign a token as a pin image? That would be pretty cool, you could leave little clues for players to find on their own.

  4. #4
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,799
    Quote Originally Posted by Dtoad View Post
    Hmm, something like the ability to assign a token as a pin image? That would be pretty cool, you could leave little clues for players to find on their own.
    You can do that now. Create a story entry pin it to the map and then share the pin and the related story.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  5. #5
    Quote Originally Posted by Zacchaeus View Post
    You can do that now. Create a story entry pin it to the map and then share the pin and the related story.
    I think the idea would be to reskin the pin to look like something else...maybe a scroll...and then have it open when a player finds (clicks) it. Or, it could look like a floor tile and be a secret tunnel. Or several token could be elements of a map. I'm just spitballing here. It's an interesting idea.

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