5E Character Create Playlist
  1. #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):

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

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    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
    Thanks, I know what to do now.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  4. #4
    Quote Originally Posted by Moon Wizard View Post
    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
    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" >
    ...
    Which is all good and fine. But when I look into supporting the Token.OnDoubleClick and other overrides I need, I now notice that TokenManager (which is pretty much solely hardcoded to deal with combat tracker stuff - which this is not) has overriden the global Token callbacks in a non register/unregister multiple item way. So my question is - as my token field will need its own version of these things - is Token something that applies toward everything and is locked up by the current hardcoded TokenManager? Am I going to have to overwrite Token Manager to allow for a more generic implementation or am I missing something and we all have our own version of the "Token" callbacks?
    Last edited by SilentRuin; September 11th, 2020 at 16:00.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  5. #5
    Quote Originally Posted by SilentRuin View Post
    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" >
    ...
    Which is all good and fine. But when I look into supporting the Token.OnDoubleClick and other overrides I need, I now notice that TokenManager (which is pretty much solely hardcoded to deal with combat tracker stuff - which this is not) has overriden the global Token callbacks in a non register/unregister multiple item way. So my question is - as my token field will need its own version of these things - is Token something that applies toward everything and is locked up by the current hardcoded TokenManager? Am I going to have to overwrite Token Manager to allow for a more generic implementation or am I missing something and we all have our own version of the "Token" callbacks?
    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):

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in