#Token Says Macro

1 messages ยท Page 1 of 1 (latest)

orchid lily
#

@wind geyser I created this thread to help keep things contained

wind geyser
#

oh okey

#

i havent written macros before, so i have limited exp w scripts, but im an intuitive learner

orchid lily
#

I'm at work now so my chat's will be a little broken up, but Iet me see if I can get you some details. I'll grab a starting screen shot in a sec

wind geyser
#

lol ok, i appreciate it. its not an urgent issue so you can also wait until u finish work

supple vessel
#

what is it you need?

orchid lily
#

@wind geyser I included a screenshot with both the Token Says configuration example and the macro. The macro can be created by clicking on the macro bar in the bottom of the screen. The 'type' for the macro needs to = 'Script'. For configuring saying, be sure the Action Type = 'Macro (API). The rest should be similar to any other saying. The macro works by having the token that you want the saying to come from selected (not targeted, but selected under your control). I wrote it to take the first of the tokens you control, so just be sure not to have more than one selected.

orchid lily
wind geyser
orchid lily
#

the actual parameters are tokenSays.says(tokenId, actorId, actionName)

wind geyser
#

const tokenId= canvas.tokens.controlled[0]?.id
tokenSays.says(Adebimpe, 'Adebimpe', hey i see you!)

#

actor and token has the same name. this scripts isnt working ๐Ÿ˜…

#

im doing something wrong

orchid lily
#
const tokenId= canvas.tokens.controlled[0]?.id
tokenSays.says(tokenId, '', 'Use "Title" from your Saying configuration')
#

The actorId can be blank if tokenId is provided. The id is the actual Foundry ID for the token instance. In the above, tokenId is a variable being set by the first line. That first line in the macro grabs your currently selected token. So just be sure to have the token you want selected before running the macro

#

The actionName needs to be in quotes and needs to match your saying title. In my screenshot, the saying title (the form on the right) is "Token Says Example"

wind geyser
#

ok thanks man i appricitate your help, ill look more into it later

orchid lily
#

So, effectively, with the above macro the only thing you need to change is the actionName

wind geyser
#

hey i followed your instructions and made it work! although not with audio for some reason. Whenever i active audio macro, the previous macro is activated. i have no idea why

orchid lily
#

Hmmm, does the other saying have the same title? The two saying titles would need to be unique

wind geyser
#

no the other macro has the exact same setup as your example

orchid lily
#

Thanks. Can you send me the screenshot of the same layout like above but for the other one. That will help me look into. Thanks!

wind geyser
orchid lily
#

thanks!

wind geyser
#

i tried making another macro with same setup, except name was "bandit says example 2" and that also seems to copy the first one

#

ive only tested macros on the same actor, player 1

orchid lily
#

It may be something up with the API, based on how you are describing it. I'll try it out locally and see if the code is missing the part where it checks for the name. I'll get back to you. Thanks!

#

oh, duh, I think I see my error. It was in my instruction to you. It's a small change. one sec

#

So I was saying it was the title of the saying that matters, but it is in fact the Action Name. You can leave the macros as are, just update each of the related sayings to fill in the Action Name, likely setting it the same as that saying's title

#

In my earlier instructions I had this blank and so that saying was basically going to trigger for any saying of that actor triggered by the macro.

#

So the key thing is to update all the sayings linked to macros (action tyhpe = Macro) for this token name that you already set up before testing again. They all should have an action name.

wind geyser
#

ok i tried but the same thing happens, the first macro is activated

#

ill send u a sc shot

orchid lily
#

That looks good. The other one also needs the action name filled in. Is that filled in for that one also?

wind geyser
#

holy moly that was the problem

#

it works!

#

๐Ÿ˜„

orchid lily
#

Shoot, well sorry about the incorrect instruction to start it all off. You'd think I would know my own code ๐Ÿ™‚

wind geyser
#

hehe, no problem i really appirciate your help

orchid lily
#

When action name is blank it basically means any, that is why the first one was always triggering. Both rules were probably being hit but Token Says only plays one rule.

wind geyser
#

my players will appreciate it as well ^^

#

perhaps these instructions should b part of the module description

#

in case anyone else have the interest of creating their own macros. just an idea!

orchid lily
#

Oh, on Foundry site? There's a call out to additional instructions there to the github which has instructions for this. I'll include a screenshot in the github instructions though as I think that would help.

#

actually, do you mind if I use your screenshot? It is nicely laid out

wind geyser
#

np screenshots is my speciality ๐Ÿ˜

orchid lily
#

thank you!

wind geyser
#

hi again! just fiddling around in Foundry, and noticed that the token says module, isnt working when using attack and damage rolls. its working fine with ability and skill checks though

#

okey just testing a bit more, it turns out the only action types that doesnt work are indeed attack and damage rolls. perhaps there are conflicting modules?

#

i can invite you to the game as an assistant gm if you want to take a look

wind geyser
#

another thing i noticed, sometimes a saying trigger forces camera focus to the token, but only on a few rare occasions. i cant figure out what makes this happen. Would be great if its something that can be enabled/disabled in the individual Saying configuration.

orchid lily
#

Good morning! The camera focus change is a core foundry setting that occurs with chat bubbles. If you disable the saying chat bubble then this won't happen for that saying. Foundry configuration can also be set to not pan on chat overall in the configuration area. I believe that setting is at the user level.

#

For the attack and damage, what game system are you on? And do you use any modules that influence rolling, like better rolls or midiqo

wind geyser
#

i tried disabling MIDI qol, but no difference

orchid lily
#

Can you just confirm that the source actor is also named Adebimpe?

#

(I don't need a screenshot)

wind geyser
orchid lily
# wind geyser i can confirm it is

I see something it may be. Do you happen to have another saying configured for this token for attack, possibly one that is inactive or set up for a chat message to generate?

wind geyser
#

no, i only have two active API macros, and the attack say

orchid lily
#

I suppose a check then would be to see if this happens with disabling all other modules except token says. It works in my set up which matches yours and i tested with midiqol enabled and disabled. Are you attacking with the scimitar or dagger and seeing the attack roll?

wind geyser
#

i tried both weapons. ill try it out with no other modules active

#

y now it works... ill do some testing to see what other module is interfering

orchid lily
#

If you want to export your midiqol settings ,(from the midiqol config area) I can load those up and see if that is it. Could be the data they pass through is different under certain settings

#

To give you an idea of what may effect it, modules that enhance/automate dice rolling features or modules that update chat messages.

wind geyser
wind geyser
#

okey after tinkering with all 70 ish modules, ive found out that its definently midi-qol thats the issue

#

i dunno why, perhaps u can see it in the code i sent you. this next midi qol export is from a clean world installment:

#

so the second export works just fine

#

i tried turning off all auto attack and auto damage effects in the "corrupt" code, but there still no sound trigger

orchid lily
#

Thanks! Yes, I was just going to respond with that also. I am seeing the same thing - when I load the first file you provided it no longer works. Then I reload my previous and it does. I will compare the two and see what is up. I'll let you know when I get a patch out - it may be quick or it may be something that I have to redo my approach to midiQol. I know it isn't the equivalent, but the Item Name action type may get you close to what you want for the time being, though you'd have to specify the weapon names else it would run for any item.

wind geyser
#

ya its not really a big deal, but i thought it was worth figuring out ๐Ÿ˜†

#

anyway, thanks for your cool attitude and helpfulness, its greatly appreciated

orchid lily
#

Same!

wind geyser
#

just so u know, i tried importing the working midi qol setting into the world where your module wasnt working, and it didnt make any difference. so i reinstalled the world, and now everything is working again, with all modules active

orchid lily
#

Oh, your previous midiqol settings and token says is working?

wind geyser
#

no the first settings i sent you are faulty for some reason, no matter what world i import them into

#

but the functioning settings could restore the faulty, except for two of my old worlds. so i deleted those worlds

#

mustve been a bug within those two

orchid lily
#

I found the cause. It's this setting. From what I can gather, midiQol sets the same flag in their workflow when this option is set as it would if the person rolled with the "Private GM Roll'. In other words, the roll is read by Token Says as a private roll.

#

If you want to use that setting you can uncheck this option in Token Says

#

The idea of not running Token Says on private rolls is that it may give away things you are doing, like if you do a private skill check and have a Token Says on that skill check for that actor, it would give it away because the saying would generate. But if you want that Midi setting and don't forsee much hidden shenanigans you can disable the Token Says setting and it should work

#

I'll update the help documentation. This is new to me,.

wind geyser
#

Alright, thanks for the update! ๐Ÿ™‚๐Ÿ‘

wind geyser
#

hey, ive really grown fond of your module, its really great!I have a few ideas for potential future updates, it would be awesome if the response action types options would be expanded with 'hp lost', and different triggers depending on whether an attack or save failed or were successful.

orchid lily
# wind geyser hey, ive really grown fond of your module, its really great!I have a few ideas ...

Thanks! You can put requests on https://github.com/napolitanod/Token-Says/issues and I'll work through what I can. Some of them are more complex to implement due to differences in data structure and data passed on functions when it comes to game systems and different rolling modules (hp and attack success/fail fall into this category).

GitHub

Tokens speak dialog or play audio based on in game actions. - Issues ยท napolitanod/Token-Says