View Full Version : Sound Triggers works for chat, but doesn't work for dice rolls
Fuffelschmertz
September 6th, 2023, 11:49
So basically, i've created a lua pattern that should match the dice roll, but it doesn't. It does match a chat message, when I manually put one in that matches.
Is it a bug, am I doing smth wrong?
Video attached
Tarkonian
September 6th, 2023, 16:46
The pattern you have is specifically looking for "Winter Wolf..." with no limit on the dots at the end.
Add another pattern below that one and use "^Winter Wolf:" (without quotes), and then try your roll again.
Let me know if that works.
Fuffelschmertz
September 6th, 2023, 17:11
Hey, that's incorrect. As per Lua docs (https://www.lua.org/pil/20.2.html) the dot sign means all characters. I just tested it with the string "Winter Wolf111" and it triggers from the chat. Even after the change to "^Winter Wolf:" it won't trigger on the dice roll.
Thanks for the response tho
Tarkonian
September 6th, 2023, 17:30
You're right. I was thinking '*' was the wildcard, not '.'
For attack rolls in D&D rulesets, there are Attack - HIT, Attack - CRIT, Attack - MISS, and Attack - FUMBLE, subtypes to select for the soundset.
These triggers work with the combat system, but require you to be targeting someone when you make the attack.
You can keep both the chat and the attack specific soundsets too. So your chat would still trigger when typing out "Winter Wolf..", but the attack specific trigger would work with the built in D&D attack system.
I also want you to try other combinations to make sure it's just not a bad pattern before I go looking for a deeper issue.
^Winter Wolf
^Winter Wolf.?
^Winter Wolf%:
Also try this pattern:
^%[Attack %(M%)%] Bite
Fuffelschmertz
September 6th, 2023, 17:40
It's working funny :)
^Winter Wolf - works with "Winter Wolf111", doesn't work with the attack/damage roll targeted and non-targeted
^Winter Wolf.? - works with "Winter Wolf111", doesn't work with the attack/damage roll targeted and non-targeted
^Winter Wolf%: - doesn't work with any of the above, works on "Winter Wolf:" and "Winter Wolf:123" (so it means, that a partial match still triggers a sound)
^%[Attack %(M%)%] Bite - doesn't work with the attack
Is the "Chat" subtype intended to work with attack roll? I would really love to see it working with EVERYTHING it sees in the chat, gives a lot of flexibility
Trenloe
September 6th, 2023, 17:46
I can't find it right now, there was a post by Moon Wizard a few weeks ago stating that the chat triggers don't operate against every single thing that appears in chat - in your example, they'll operate against the attack result text (if you have a target for the attack) but they don't operate against the dice roll actor text.
Fuffelschmertz
September 6th, 2023, 17:46
I figured it out, you guys are ignoring the actor:
58787
And the pattern ^%[ATTACK %(M%)%] Bite (must be caps, cuz ATTACK is caps, and it doesn't mater WHO will perform the bite)
is working
So ^Winter Wolf: would never work, it's the same as writing ^Fuffelschmertz: it seems, you can't distinguish it in the chat.
I'm not sure if I articulated it correctly, but I hope you get my idea.
Fuffelschmertz
September 6th, 2023, 17:51
I can't find it right now, there was a post by Moon Wizard a few weeks ago stating that the chat triggers don't operate against every single thing that appears in chat - in your example, they'll operate against the attack result text (if you have a target for the attack) but they don't operate against the dice roll actor text.
Why don't they operate against the dice roll actor text?
It's seems to me that this would be only natural to do so.
Perhaps a player wants some special flavor spell with his own sound or wolf bites are different from bear bites etc.
Tarkonian
September 6th, 2023, 17:58
It's working funny :)
^Winter Wolf - works with "Winter Wolf111", doesn't work with the attack/damage roll targeted and non-targeted
^Winter Wolf.? - works with "Winter Wolf111", doesn't work with the attack/damage roll targeted and non-targeted
^Winter Wolf%: - doesn't work with any of the above, works on "Winter Wolf:" and "Winter Wolf:123" (so it means, that a partial match still triggers a sound)
^%[Attack %(M%)%] Bite - doesn't work with the attack
Is the "Chat" subtype intended to work with attack roll? I would really love to see it working with EVERYTHING it sees in the chat, gives a lot of flexibility
The 'chat' subtype is supposed to work with all chat feed. So it -can- interact with attacks, but has the chance to trigger at incorrect times doing it like that.
So the 'attack' subtypes were created so they ONLY fire when attacking with a target. And are usually much easier to read out an attack since they're preset by ruleset developers.
'^%[Attack %(M%)%] Bite' probably didn't work because I left in the '^' character. Removing that and it should trigger since the output technically starts with "Winter Wolf: "
For the attack/damage rolls, just use basic matching instead of pattern matching (uncheck the "Pattern" checkbox and just use 'Winter Wolf' as the field). That will just do a straight name comparison.
For the rest of them, that's about what I expected.
'^Winter Wolf%:' is a very literal comparison, so as long as it finds 'Winter Wolf:' at the beginning exactly like that, it will trigger. Even if there's more trailing it.
'^Winter Wolf.?' is the same as what you did, it just doesn't need to include the wildcard character. But that means the pattern matching is working as it's supposed to.
'^Winter Wolf" is just a free-for-all. As long as you have that word at the beginning it should trigger. (Just checking to make sure)
Are you using multiple patterns for the 'chat' subtype trigger? You can use more than one and it'll check against them all. 5 or 6 patterns isn't going to kill performance, I'd just be VERY weary about doing 20+.
Trenloe
September 6th, 2023, 18:02
Why don't they operate against the dice roll actor text?
Only guessing here, but probably because the text can change and could be displayed differently on the GM instance and the player instance. You'll need a dev to get you the full details - maybe try searching for Moon Wizard's previous post about this?
Fuffelschmertz
September 6th, 2023, 18:04
Only guessing here, but probably because the text can change and could be displayed differently on the GM instance and the player instance. You'll need a dev to get you the full details - maybe try searching for Moon Wizard's previous post about this?
I'll probably ask him to incorporate this functionality - the current implementation seems counter-intuitive to me
Tarkonian
September 6th, 2023, 18:04
I figured it out, you guys are ignoring the actor:
58787
And the pattern ^%[ATTACK %(M%)%] Bite (must be caps, cuz ATTACK is caps, and it doesn't mater WHO will perform the bite)
is working
So ^Winter Wolf: would never work, it's the same as writing ^Fuffelschmertz: it seems, you can't distinguish it in the chat.
I'm not sure if I articulated it correctly, but I hope you get my idea.
Yeah you're right, I forgot to capitalize the 'ATTACK' part of that. It is capital-specific so good catch.
I was under the impression it DID use the Username tag in the chat readout. But that may not have been implemented after all.
The main reason though is how the chat text is built inside the CoreRPG ruleset.
The text like "[ATTACK (M)] BITE" is built as one string. And the UserName is appended to that string later on.
Since it's not being evaluated, we're just checking everything to the right of the username since that's the string we have when it's checked in the code.
Tarkonian
September 6th, 2023, 18:05
I'll probably ask him to incorporate this functionality - the current implementation seems counter-intuitive to me
Don't worry. I'll meet with him today or tomorrow and he'll want to know about this ticket. So I'll talk to him about it then.
Fuffelschmertz
September 6th, 2023, 18:09
Don't worry. I'll meet with him today or tomorrow and he'll want to know about this ticket. So I'll talk to him about it then.
Cool, thanks
I hope it will be implemented:)
(Also ask him about the first person theater of the mind feature please - I'm waiting for this feature since it was announced :D)
Tarkonian
September 6th, 2023, 18:12
Cool, thanks
I hope it will be implemented:)
(Also ask him about the first person theater of the mind feature please - I'm waiting for this feature since it was announced :D)
I will try to get it added. I see what you're trying to do and I think that's a very good feature to have with 'chat' specific subtypes.
As for the other part... Just be patient :)
Moon Wizard
September 6th, 2023, 19:42
Attacks only trigger when targeted; and are triggered on the attack result string only (i.e. HIT/MISS/etc.) They are not triggered on the roll itself; you must have a target.
For example, the "Attack - Hit" subtype is looking for these matches in addition to the specific matches: "^Attack", "%[HIT%]"
Everything is a chat trigger; there are no special cases. Just text matching.
Regards,
JPG
Trenloe
September 6th, 2023, 19:45
Attacks only trigger when targeted; and are triggered on the attack result string only (i.e. HIT/MISS/etc.) They are not triggered on the roll itself; you must have a target.
Regards,
JPG
The question in this thread is around "chat" triggers. What part of the attack process will be used for a "Chat" trigger. In the example discussed in this thread, it looks like the attack roll text, but not the actor name, are used in a chat trigger.
Fuffelschmertz
September 7th, 2023, 13:39
Attacks only trigger when targeted; and are triggered on the attack result string only (i.e. HIT/MISS/etc.) They are not triggered on the roll itself; you must have a target.
For example, the "Attack - Hit" subtype is looking for these matches in addition to the specific matches: "^Attack", "%[HIT%]"
Everything is a chat trigger; there are no special cases. Just text matching.
Regards,
JPG
Hey, yes, Trenloe is correct.
We separately found out that the actor name is not used in the chat trigger - is this the intended behaviour? Tarkonian mentioned that it's how the CoreRPG ruleset works, but it might be that it was not considered when designing this feature.
Because I would really like to distinguish the actor names even when the attacks are similar - a bear's bite and a wolf's bite have certainly different sounds, for example.
It also allows for more flexibility - simply gives the users more tools to use.
Moon Wizard
September 7th, 2023, 18:58
Unfortunately, the actor name is not technically part of the chat text returned by the system. (It's denoted as the speaker in the chat system.) The chat trigger system as it is built only can trigger off the "text" of the messages, not any other message metadata.
Regards,
JPG
Fuffelschmertz
September 8th, 2023, 11:09
Unfortunately, the actor name is not technically part of the chat text returned by the system. (It's denoted as the speaker in the chat system.) The chat trigger system as it is built only can trigger off the "text" of the messages, not any other message metadata.
Regards,
JPG
Does that mean this will not be implemented in the near future?
Moon Wizard
September 8th, 2023, 22:21
There are no plans at this time to enhance the sound capability, because all of our people are tied up on other projects. You can add to the wish list in my signature, and I'll add to our internal list of desired sound features.
Regards,
JPG
Fuffelschmertz
September 10th, 2023, 12:41
There are no plans at this time to enhance the sound capability, because all of our people are tied up on other projects. You can add to the wish list in my signature, and I'll add to our internal list of desired sound features.
Regards,
JPG
I've created a post there
http://fgapp.idea.informer.com/proj/fgapp?ia=141355
Trenloe
September 10th, 2023, 18:28
I've created a post there
http://fgapp.idea.informer.com/proj/fgapp?ia=141355
Vote for it! :)
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.