Thread: Tokens as Shortcuts
-
November 21st, 2019, 07:43 #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.
-
November 21st, 2019, 13:37 #2
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!
-
November 21st, 2019, 20:23 #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.
-
November 21st, 2019, 21:51 #4If 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
-
November 21st, 2019, 22:28 #5
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