-
September 9th, 2020, 22:20 #1
Document or tutorial explaining how Map interacts with <token> tags in DB?
I need to see if I can create a token tied to a DB entry of my own but am not sure on the rules of interacting with the map based on current things that do this. PC and NPC tokens are only ones that come to mind currently.
Is there some sort of directions or rules on how this is done or do you just have to trial and error through the code?
Hoping for some sage advice here. Need to know how (or examples) of dropping a DB entry with a <token> definition onto the map and how it can be tied back to the DB entry. If I know that pretty sure I can do the rest of what I want to do.Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
September 10th, 2020, 00:33 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,421
The token information stored on a map in FG is only the graphic asset used, an ID value, and some other attributes (active, selected, etc.) There is no implicit connection to other database entries.
In the CoreRPG provided combat tracker (and the various ruleset implementations); when a token is dragged from CT to a map, the resulting token ID and map database node are saved into the CT record node. Then, whenever an action is performed against a token, the TokenManager code checks to see if there is a CT entry which has a matching image database path and token ID, and performs actions appropriately.
So, the result is that you need to do your "linking" of tokens and database records within your own scripts.
Regards,
JPG
-
September 10th, 2020, 01:37 #3Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
September 10th, 2020, 22:14 #4
A new question has come up while I'm implementing this:
While doing the OnInit in the script for my xml I link the token using similarly named fields in my xml as shown below:
Code:.. <hs name="tokenrefid" /> <hs name="tokenrefnode" /> <tokenfield name="token" > ...
Last edited by SilentRuin; September 11th, 2020 at 16:00.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
September 11th, 2020, 18:10 #5
Never mind - I assumed I had to save the original function before I overloaded it then call it after I established it was not one of my tokens - but that was always coming up nil for the original functions and even with my new stuff - the old stuff was still working. So I guess it just knows that the global "Token" is your personal scripts version. Anyway, figured it out.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
September 11th, 2020, 20:12 #6
WOOT! Wile-E-Coyote... The core base of what I wanted to do all works!
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks