-
June 10th, 2019, 17:48 #1
API calls to remove "token selection" ?
I've been fiddling around with some highlighting/indicators in the combat tracker. One thing I noticed is that there is apparently no way to "remove selection" of a token. I do not me "target" for another token I mean when you click on a token and select it.
I'd like to be able to clear the token select when it's another person's turn. The reason being is that I will select a token during one npcs turn, next round another npc goes and the "selected" token is from the previous turn selection and if I target something, for what I think is the current npc, it will actually target for the previously "clicked on/selected" token. To clear up that problem I'd like to just clear selection.
tldr; selecting a token persists, I'd like to clear selection on each turn.
Am I missing something and there is a API to allow you to clear the token selection?---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
June 10th, 2019, 17:52 #2
It's based off the image control, not an individual token: https://www.fantasygrounds.com/refdo...SelectedTokens
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!
-
June 10th, 2019, 17:56 #3---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
June 10th, 2019, 19:02 #4
Okay, so I've implemented the clearselections and it "seems" to do something but not everything.
Here is the token before selection.
Here is the token AFTER selection.
And here is the token after the clear has been initiated.
You'll note the token does appear to be unselected however it still seems to be acting like it is. You can see it even it showing the indicator for range to it's target. If I immediately "control-click" another token to target it adds those targets to that token. I needed to auto-select the "active" token as well.
Code:-- clean any selected token, select active one function clearSelectionToken() local nodeCT = getDatabaseNode(); local tokenMap = CombatManager.getTokenFromCT(nodeCT); local imageControl = ImageManager.getImageControl(tokenMap, true) imageControl.clearSelectedTokens(); imageControl.selectToken( tokenMap, true ) ; end
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
June 10th, 2019, 23:34 #5
Please dont change the way Targeting works....
As GM in large battles I will try to do as much targeting as possible whole the PCs are taking their turns so that i can fire off my attacks on the NPC turns without slowing things too much.
In more cases than not an NPC will attack the same target they attacked on their previous turn - not always but certainly more often than not...
-
June 11th, 2019, 00:27 #6
I'm not changing targeting, just token selection. It sounds the same but it's not. Token selection is the token you've clicked on, it shows the black ring when you do, that's it. When you target (control-click) that is targeting (which shows on the CT entry with each name of targeted tokens), that I did not change.
Last edited by celestian; June 11th, 2019 at 00:30.
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
June 11th, 2019, 01:23 #7
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks