DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1

    Where is "Mask Sensitive Visibility" defined?

    I have a token placed in the map via an extension and it turns out players can see it across LOS. If you right mouse on it you get this unlocked eye icon that says "Mask Sensitive Visibility" which if you set to the locked will do what I thought it always did - respect the LOS for players. My question is - how can I force this to always be defaulted to on? For sure I don't see this default on regular tokens as an option - and they respect LOS. The PC and NPC tokens also have this as the default and respect LOS. I tried to look up the menu click code based on the menu strings in 5E and CoreRPG source but could not find it. How does this work? How can I make my dropped token respect LOS for players? Also when its set its not remembered between sessions.
    Last edited by SilentRuin; November 23rd, 2020 at 04:08.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #2
    It appears the default for tokens placed by the system is a lock image with text "Set Always Visible" which when selected show an unlock image with text "Mask Sensitive Visibility". In my dropped token the default is the unlock image which is opposite of PC/NPC/Asset token default. I want to make mine the same - but don't understand how I can do this.

    For sure this setting is not stored between sessions even for PC/NPC/Asset tokens (if I toggle it to the unlock image it will not remember it next session - just like my token will not remember if I toggle it to lock image). At the very least I want to force it to default to the lock image.
    Last edited by SilentRuin; November 23rd, 2020 at 04:09.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  3. #3
    Another Clue. Ok for sure the DB has the <visibility>mask</visibility> tag in the <layers> that represents the appropriate default setting. Naturally, editing this and restarting FGU does absolutely nothing to the already placed token - no idea why. If I take where I create my tokeninstance and call the setVisible(true) and change it to setVisible(false) - the <visibility> is set to mask in the DB and the default when I drop a new token in the map is the correct default. AND ITS INVISIBLE (sigh). I wanted it to place visible. So I then have to set another right mouse visibility flag using the exact same text - but different token image (slightly) and position in the menu, to make it visible - as in not greyed out. And it does not remember that one between sessions either.

    I'll keep flailing at this but I really don't understand what this is doing with two flavors of visibility neither of which are remembered across sessions. And while the tokeninstance.setVisible sets both of these flags at same time I've yet to find a discreet one to set them both individually. Still experimenting. Hopefully in morning someone has taken pity and explains these visibility flavors and how to set them in the code.
    Last edited by SilentRuin; November 23rd, 2020 at 04:47.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  4. #4
    And a solution - of sorts. While I can never make anything with visibility for a token store between sessions I can get the two visibility flags to be set how I want for default.

    I originally had

    newTokenInstance.setVisible(true);

    Thinking that it would make token visible to the players. And it will. It will also make it so that it will always be visible even with LOS. These are two different flavors of visibility set by this (though its not in the document).

    I then tried

    newTokenInstance.setVisible(false);

    This did make it no longer visible in LOS. But it was also no longer visible to the players.

    So looking at all instances of setting visibility in the code I noticed a weird case for deleting them. I figured what the heck - right? Its not a documented arguement but may as well try it.

    newTokenInstance.setVisible(nil);

    Yeah. This worked. Got me visibility to the players but not visibility through LOS situations.

    Recorded for posterity. Though I don't have the slightest clue why. Its possible not even calling this would be a similar fix but I'm going to go with this.

    Still can't change either visibility flavor on a token and have it saved. No idea why.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  5. #5
    Good work figuring out. It's used in CoreRPG that way. Visibility is a 3-state variable (always visible, always invisible, mask-sensitive visible).

    I've updated the wiki documentation for this function as well.
    https://fantasygroundsunity.atlassia...nce#setVisible

    Regards,
    JPG

  6. #6
    Quote Originally Posted by Moon Wizard View Post
    Good work figuring out. It's used in CoreRPG that way. Visibility is a 3-state variable (always visible, always invisible, mask-sensitive visible).

    I've updated the wiki documentation for this function as well.
    https://fantasygroundsunity.atlassia...nce#setVisible

    Regards,
    JPG
    I was asked by a user of my extension if there was any way to insure tokens remembered what <visibility> was being set. Changing the DB has no effect on the token coming up in a new session - and its not updated in DB after a particular token is set to one of those states. Always comes back in as the token was placed. That's true for NPC token, PC token, Asset token, or my token. I'm guessing there is some reason its not possible to store it between sessions - was just wondering what that was.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  7. #7
    Visibility should be remembered between sessions; so that might take some investigation to see what is happening.

    My initial guess might be that TokenManager script in CoreRPG is changing token token parameters in the Token.onAdd handler (which could affect visibility settings); but I thought it ignored tokens that were not linked in combat tracker or party sheet.

    Regards,
    JPG

  8. #8
    Quote Originally Posted by Moon Wizard View Post
    Visibility should be remembered between sessions; so that might take some investigation to see what is happening.

    My initial guess might be that TokenManager script in CoreRPG is changing token token parameters in the Token.onAdd handler (which could affect visibility settings); but I thought it ignored tokens that were not linked in combat tracker or party sheet.

    Regards,
    JPG
    Well I do use the onAdd for my specific unique token - but nothing I know of uses any global version of that type of thing. For sure I turned off all extensions and did a raw test with a Single PC on a map. Right moused and clicked visibility then turned off one of the visibility options. It was not remembered when I came down and back up in FGU. True for any map token.

    Its not a big deal to me as I can't imagine ever setting anything outside of the defaults. But someone asked so there must be some use to them.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  9. #9
    I just double-checked by creating a brand new empty image, adding 3 tokens from Assets window directly, setting each to one of the 3 different visibility states, exiting, verifying the data in the db.xml tracked the visibility information, reloading campaign, and verifying that the visibility data was maintained for those 3 tokens. So, it looks like everything is working as intended by default.

    Of course, if a script overrides for a specific token (such as CT-linked tokens) by calling setVisible API, then it would set to whatever the API call specifies.

    I just wanted to double check, since you raised the initial concern.

    Regards,
    JPG

  10. #10
    Quote Originally Posted by Moon Wizard View Post
    I just double-checked by creating a brand new empty image, adding 3 tokens from Assets window directly, setting each to one of the 3 different visibility states, exiting, verifying the data in the db.xml tracked the visibility information, reloading campaign, and verifying that the visibility data was maintained for those 3 tokens. So, it looks like everything is working as intended by default.

    Of course, if a script overrides for a specific token (such as CT-linked tokens) by calling setVisible API, then it would set to whatever the API call specifies.

    I just wanted to double check, since you raised the initial concern.

    Regards,
    JPG
    I assume by image you mean what I would call a map? I admit I'm stumped on this. The PC still does not remember any right mouse visibility lock icon I change (tried the top one again just now) - but the NPC does seem to remember. And placing a dumb chest asset (no extension intelligence for token) I can't even get visibility to show on it. So that must have only been available with tokens linked to the DB? I'm a bit confused by this.

    There is no console log error about it failing to update that <visibility> tag in layers. But it for sure is not updating - and this with extensions or without extensions for the PC and chest asset tied to DB (map parcel extension created it).

    This is FGU 5E ruleset. I'm wondering if anything with an active tokeninstance.onAdd sort of thing has this issue? Or simply that the token was ever touched with an extension even if its not currently running that extension?

    For sure an NPC dropped into image with no extensions remembers the visibility setting - but for some reason the other stuff does not. A raw asset dropped in seemed to just give me the image right mouse wheel - or I was missing its activation area some how.

    If you can place a PC/NPC and it remembers the settings between sessions - which are intelligent tokens tied to DB like mine - then I don't know what is going on. I never noticed this stuff till someone else mentioned it to me, because I will probably never set the visibility on these things.

    Basically I'm just confused.
    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
  •  
FG Spreadshirt Swag

Log in

Log in