Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[EmojiBubble] Need help regarding this mod

Hi, I've been using the EmojiBubble mod and while tinkering with it I ended up being stuck on an unexpected issue. When trying to hard-code a macro for my players, I found out you can't call a certain character_id ? For example, I wanted to create a macro saying this : !emojibubble @{Charactername|token_id}|craft But this way of calling doesn't seem to work sadly, any idea ? :/
1671083789
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I believe you would need to use selected, target, or just the actual token_id, there. A single character or character name cold refer to any number of tokens, and the Script Moderator has no way of knowing which of the ten tokens named "goblin" or that represent a character named "Bob" is the intended one.
How should I write it with a specific ID ? I've tried to use it but it doesn't seem to work
1671131451
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm not familiar with the syntax of the script, but @{selected|token_id} will return the token id of the selected token. Remember when copying and pasting, that the "-" at the beginning of the id is essential.
I've done that, but I'm asking about the script syntax I tried multiple ways of writing it but none of them will work : !emojibubble --id-MZLvtCa8xCfsR1MiXFa|craft !emojibubble -NFflOLsyvKV6rwo2Y41|craft !emojibubble @{-NFflOLsyvKV6rwo2Y41|token_id}|craft !emojibubble @{NFflOLsyvKV6rwo2Y41|token_id}|craft
1671132714
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Instructions for the script are available on the installation page or in the linked forum thread. In this particular case, select any token and run !emojibubble|craft That will add the emoji to the selected token. If you want to target a token (say, to give this ability to a player), use: !emojibubble --targettoken|craft|@{target|speaker|token_id} This I found from dissecting the provided macros that the script installed and perusing the thread.  Or you can use the script-provided control panel, or the script-provided macros. In any case, hopefully that's enough to make the hard-coding of specific macros work. Let me know if you run into more issues.
Thanks ! I tried this line : !emojibubble --targettoken|craft|@{TOKENID|token_id} And a funny thing happens It works, the token gets its emojibubble, but the script still sends me an error in the chat stating "No character was found for 'TOKENID'"
1671135855
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That's because @{TOKENID|token_id} means nothing unless there is a character called "TOKENID". And even then it wouldn't work, because you cannot call a token id from a character name for the reasons outlined above. If you are trying to hardwire a token ID (-1234567890abcdef) into the macro so that it will require neither selection or targeting, then do this: Select the token. run: @{selected|token_id} copy the token id from chat (including the "-" at the beginning.) Let's assume it is -NJMHp8VuTeFtKkECgZp Use the macro: !emojibubble --targettoken|craft|-NJMHp8VuTeFtKkECgZp If you are looking for dynamic assignemnt (giving the emoji to any selected or target tokens), use one of the macros I provided above.
1671138629

Edited 1671138662
I replaced the token id with "TOKENID" intentionally, it's not the issue, the real command is !emojibubble --targettoken|craft|@{-NFflOLsyvKV6rwo2Y41|token_id}
Any idea on how to fix the error ? :(
1671152815
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yes. Don't use that construct. It doesn't work. You cannot get a token id that way. Use one of the options I posted. For example, the one you just posted would be: !emojibubble --targettoken|craft|-NFflOLsyvKV6rwo2Y41 Assuming that - NFflOLsyvKV6rwo2Y41  is a token id. A character id won't work. Let's step back a bit. Instead of telling me what commands you have tried, can you explain what you are trying to do? In game terms?
1671175077
Pat
Pro
API Scripter
Howdy, author here - I, too, would like to understand the use-case of what you're trying to do, not how you've been trying to do it... 
Sorry for not explaining beforehand, but I wanna make a macro for each of my players that will add a specific emoji onto their token without giving them the burden of selecting or targetting it, just a click and the token get its emoji !
1671210546
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
They will need to select or target it. Every time you create a new token for the character by dragging it onto the VTT, it gets a new, unique token ID. Pat might have a workaround for this, but AFAIK, there is no way to account for this. One character can be represented by many tokens. You can't specify a character and expect the scrip modifier to know which token to use.
I wonder if the script could be tweaked (or if one of Timmaugh's metascripts could be used) to add the EmojiBubble to each  token on the current page for the related character sheet.  I haven't used the script myself so I'm not sure how that might work.
1671215124
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I wouldn't doubt that some combo of meta scripts would allow for it. But is it really that burdensome to select a token?
It is when it's grouped with other tokens and you have to hold Alt to select it, and half the time you end up selecting a token in front of your token
1671390102
Pat
Pro
API Scripter
The script itself checks for ownership and non-DM status to prevent spamming and griefing - so players can add emojis to tokens they control all they want, but key to this is identifying which token you own, by which you *can* select... co-opting the selectability to prevent the griefing.  Now, if you had a macro to *select* a token automatically for players, that's half your problem done, not related to emojibubble, but that's not currently possible as far as I know - what I do for my players with things that require select-then-activate is put them on token actions, so the buttons only appear when the token is selected. 
1671390375
Pat
Pro
API Scripter
One idea, if you have stacked/grouped tokens, might be to take the number of states they can be in and convert it to a single-image-per-side rollable token, so while you'd lose some fine intra-layer movement, you'd not have problems with selecting and then accidentally moving one element in a group, the problem with selecting which token in a group, etc, and could even program the side they show based on other programmable elements, further automating it...