FG Spreadshirt Swag
  1. #1

    Sound Sets and Lua Pattern

    I am trying to get some sound working for particular NPCs, like dogs, mutant hounds, and feral ghouls. Problem is that some of them have attack names that are just the same, like bit or unarmed. So I thought why not add their npc name to the lua regex, but that does not seem to be working.

    For example, feral ghoul, in the chat window, we get
    Feral Ghoul:
    [ATTACK] Unarmed (vs. TN 8)
    [LOCATION: Right Arm]
    [SUCCESSES: 1]

    The following individual regex works (one example per line):
    (Unarmed)(.*)(SUCCESS)
    (Unarmed)(.*)

    But, any unarmed attack then gets the feral ghoul sound effect, even if it is an unarmed from a PC or a npc raider. So I tried this: (Feral Ghoul)(.*)(Unarmed)(.*)
    This combined a working regex, with an addition at the front to look for the type of npc. No dice, I even tried just the feral ghoul part: (Feral Ghoul)(.*)
    Still, no dice.

    Anyone got any ideas? At the moment, it would seem like the regex is completely ignoring the first line of the chat box output.

    For context, all my sound sets for weapons work, since all of those are just in the second line on of the chatbox output.

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,986
    I think what you'd need to do here is create an item - called Ghoulclaws or something similar and then create a sound set for that item. You would also need to edit the attack action in the Ghoul to Ghoulclaws (or whatever you called it).

    The trigger doesn't look for the name of the creature that is making the attack - only what action the creature made (attack, damage, cast) and what the result of that attack was (hit, miss, damage type, spell).
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    I was afraid of that. I did that for a dog companion one of my players has. I was hoping to avoid that with NPCs, will end up with a custom copy of the ghouls, or any others I do this for, that wont get updated if new updates come out. Oh well..

    Thanks for the reply!

    Any idea why the trigger does not look at the line that has the name of the character?

  4. #4
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,986
    Quote Originally Posted by banesorka View Post
    I was afraid of that. I did that for a dog companion one of my players has. I was hoping to avoid that with NPCs, will end up with a custom copy of the ghouls, or any others I do this for, that wont get updated if new updates come out. Oh well..

    Thanks for the reply!

    Any idea why the trigger does not look at the line that has the name of the character?
    I dunno. Might have something to do with the fact that you can have things like Ghoul 1, Ghoul 2 etc.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  5. #5
    In lua I've used something like this for sounds, e.g. .-ATTACK.-MINIGUN.- I haven't tried with names like ghoul, but if you put a name in front it might work

  6. #6
    Quote Originally Posted by Pathicc View Post
    In lua I've used something like this for sounds, e.g. .-ATTACK.-MINIGUN.- I haven't tried with names like ghoul, but if you put a name in front it might work
    Unfortunately even the most basic attempt to get a sound to go off if the word Ghoul shows up in the chat window is failing. So I would have to rename the weapons on all creatures that have some kind of unarmed attack, which I just don't want to do.

    Edit: For clarification.
    When I looked for the word Ghoul in any context, no sound ever played, the final conclusion I have made at this point is similar to what Zacchaeus said, the line that has the name of the NPC is never read by any sound set lua. The reason for it is totally unknown to me though.

    Feral Ghoul: Lua ignores this
    [ATTACK] Unarmed (vs. TN 8) Lua reads from here
    [LOCATION: Right Arm] -----
    [SUCCESSES: 1] To here
    Last edited by banesorka; May 27th, 2024 at 14:29.

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,564
    Quote Originally Posted by banesorka View Post
    Edit: For clarification.
    When I looked for the word Ghoul in any context, no sound ever played, the final conclusion I have made at this point is similar to what Zacchaeus said, the line that has the name of the NPC is never read by any sound set lua. The reason for it is totally unknown to me though.

    Feral Ghoul: Lua ignores this
    [ATTACK] Unarmed (vs. TN 8) Lua reads from here
    [LOCATION: Right Arm] -----
    [SUCCESSES: 1] To here
    That's correct, the NPC name is not part of the pattern matching. The main FG dev, Moon Wizard, discussed this in a thread here: https://www.fantasygrounds.com/forum...l=1#post697112
    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!

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
  •  
STAR TREK 2d20

Log in

Log in