Simultaneous Sounds

Posted by Dukeskath on Tue 06 Aug 2024 11:48 AM — 13 posts, 19,768 views.

#0
I'm a total noob with MUSHClient and scripting and triggers, but I love playing MUDs with sound.

While playing Aardwolf I'm using the soundpack plugin, but I also want a step sound (S1) to play when I move. This is working fine with a simple trigger when the game displays "Exits:".

However, I would also like a chime (S2) to play when I arrive at recall. (Triggered on "The Grand City of Aylor (G)".) Works fine when I disable the step trigger.

Alas, when I step into the recall room, I only hear S1. I tried changing the S1 trigger sequence to 105 — S2 is default 100 — because I read somewhere that such a thing might help triggers work properly. No luck.

Any help is appreciated.
USA Global Moderator #1
I think the answer to this depends on exactly which mechanism you're using to play sounds and also what format your sounds are in. We need to see your triggers.

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
Amended on Tue 06 Aug 2024 12:26 PM by Fiendish
#2
Thank you very much for the speedy reply. I apologize for my total lack of knowledge.

The page to which you linked is about a script function. Is that different from triggers? I feel like scripting is a huge labyrinth into which I may not be ready to step.

If there's no way to remedy the problem with triggers alone, I may just endure the single-sound situation.
USA Global Moderator #3
Sorry, I've updated my reply to back up a step. Please read it anew.
#4
Fiendish said:

We need to see your triggers.


Yes, of course.

---

S1 (step):

<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="*Exits:*"
sequence="105"
sound="C:\Users\scart\OneDrive\Documents\MUDs\MUD Sounds\step.wav"
>
</trigger>
</triggers>

---

S2 (recall):

<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="The Grand City of Aylor (G)"
sequence="100"
sound="C:\Users\scart\OneDrive\Documents\MUDs\MUD Sounds\tone03.wav"
>
</trigger>
</triggers>

---

Thanks again for your assistance.
USA Global Moderator #5
I don't know why there are multiple different internal mechanisms in MUSHclient for playing sound, but IIRC the old trigger sound mechanism does not support playing more than one at a time.

If you use these instead, I think it should work...


<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="*Exits:*"
   send_to="12"
  >
  <send>PlaySound(0, "C:/Users/scart/OneDrive/Documents/MUDs/MUD Sounds/step.wav", false)
</send>
  </trigger>
</triggers>



<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="The Grand City of Aylor (G)"
   send_to="12"
  >
  <send>PlaySound(0, "C:/Users/scart/OneDrive/Documents/MUDs/MUD Sounds/tone03.wav", false)
</send>
  </trigger>
</triggers>
Amended on Wed 07 Aug 2024 01:03 PM by Fiendish
#6
Thank you! Alas, I'm not sure where to add that code. I tried using the trigger window, changing "Sent to" to "Script" and adding the code into the "Send" window above. No luck.

I tried adding it to the "External Script File" under the World Properties menu. No luck.

Thanks for your help. Sorry for being such a clueless novice.
USA Global Moderator #7
Quote:
Alas, I'm not sure where to add that code


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
#8
You're going to hate me.

I followed those directions and it won't play either sound. I know the trigger is working because when I tell it to highlight the matched text, that works.

If you have any ideas about what else we could try, I'm all ears. I tried making a new directory in my MUSHClient folder with the same sounds and adjusting the path.. but it didn't fix it. Perhaps I did it wrong?
Australia Forum Administrator #9
Dukeskath said:

You're going to hate me.


We don't hate you.

In Lua, to put backslashes inside a string as Fiendish did, you need to double them, so it would be:


PlaySound(0, "C:\\Users\\scart\\OneDrive\\Documents\\MUDs\\MUD Sounds\\step.wav", false)


Or, more simply, use forward slashes.




Fiendish said:

I don't know why there are multiple different internal mechanisms in MUSHclient for playing sound ...


Incremental improvements + backwards compatibility.
Amended on Wed 07 Aug 2024 06:35 AM by Nick Gammon
USA Global Moderator #10
Lol, oops. I've edited my post to use forward slashes instead. Sorry for not testing it first.
#11
Thank you both! (And thanks for not hating me, heh.)

I look forward to trying this out later today. Fingers crossed!
#12
It worked!

It's a pretty small thing, but it means SO much that you stuck it out and helped me. Thank you, both of you, a billion times!