[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Incorporating sound buffers into an existing .mct file
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Incorporating sound buffers into an existing .mct file

You need to log onto the forum to reply or create new threads.

  [Refresh] Refresh page


Posted by Imloti   USA  (4 posts)  [Biography] bio
Date Thu 26 Apr 2018 08:42 AM (UTC)
Message
I have a fairly complex set of triggers for a MUD that I play. When I created them (all through the dialog box), I did not know about sound buffers that would allow more than one sound to play at a time. I have fiddled with the .mct file and cannot figure out how to incorporate the buffers into what I already have. An example of one of my existing triggers is:

</trigger>
<trigger
enabled="y"
match="* A marking on the ground indicates that this area has already been explored."
sequence="100"
sound="D:\\MUSHclient\sounds\beep1.wav"
>
</trigger>

I know that what I want to add looks something like this:

PlaySound (0, "D:\\MUSHclient\sounds\beep1.wav", false, 0, 0)

The problem I'm having is how to incorporate the two. Any assistance would be appreciated. Thank you!
[Go to top] top

Posted by Fiendish   USA  (1,774 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Thu 26 Apr 2018 10:55 AM (UTC)

Amended on Thu 26 Apr 2018 10:59 AM (UTC) by Fiendish

Message
Try

<trigger
enabled="y"
match="* A marking on the ground indicates that this area has already been explored."
sequence="100"
send_to="12"
>
<send>
 PlaySound (0, "D:\\MUSHclient\sounds\beep1.wav", false, 0, 0)
</send>
</trigger>


Notice the bits that say send_to="12" and <send>...</send>

The interface entry equivalent is that in the trigger edit window you would put the PlaySound invocation in the send box, and then you tell the trigger to send to script.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Imloti   USA  (4 posts)  [Biography] bio
Date Reply #2 on Thu 26 Apr 2018 11:01 AM (UTC)
Message
Thank you so much. This is perfect.
[Go to top] top

Posted by Imloti   USA  (4 posts)  [Biography] bio
Date Reply #3 on Thu 26 Apr 2018 12:57 PM (UTC)
Message
The only problem I'm having now is I'm getting a ton of compile errors. Things like:

Compile error
World: StarC
Immediate execution
[string "Trigger: "]:1: '<name>' expected near '/'

and

Compile error
World: StarC
Immediate execution
[string "Trigger: "]:1: function arguments expected near '.'

It looks like it's something with line 1? Which is:

<?xml version="1.0" encoding="iso-8859-1"?>

But I haven't touched that.
[Go to top] top

Posted by Nick Gammon   Australia  (21,652 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Thu 26 Apr 2018 08:08 PM (UTC)

Amended on Thu 26 Apr 2018 08:10 PM (UTC) by Nick Gammon

Message

Do not replace the </trigger> in your initial post. That was the end of the previous trigger. Each trigger should look like this:

What might be easier would be to make a new (empty) world file, import the triggers from the .mct file1, amend them in the GUI interface, and write them all back to the .mct file2. Make a backup first.

As Fiendish said, in the trigger GUI interface:

  • Change “Send to” to be “Script”
  • Change Sound to “(no sound)” by clicking the “No sound” button
  • Add into the Send box the small script he showed. The default place to look for sounds is the sound directory, and some arguments are optional, so it could simplified to:

The default sounds directory can be checked by executing this in the Immediate scripting window:


  1. In the trigger configuration dialog box, click “Load…”.

  2. In the trigger configuration dialog box, click “Save…”.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Imloti   USA  (4 posts)  [Biography] bio
Date Reply #5 on Thu 26 Apr 2018 08:12 PM (UTC)
Message
Thank you, Nick. I ended up having someone look at just one of the triggers from the file and turns out I was making a mistake that my high school computer programming teacher warned me about. I was leaving off a quote prior to the file name. And as much as I stared at it, I didn't see it was missing. All works perfectly now and this amazing person also helped me set it so they play in the background so that I don't have to be in the MC window in order for them to play. Thanks to all of you and this other person...I've got it straight.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


256 views.

You need to log onto the forum to reply or create new threads.

  [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]