2013-03-25 15:20:36

Hi all. What do I have to in Mushclient to tie sounds to phrases & make a soundpack of my own? I am planning to make one for Hell Moo, and I don't know how. Instructions would be most appreciated.

2013-03-26 07:27:53 (edited by Victorious 2013-03-26 07:28:52)

The process is pretty similar no matter what client you use. You will have to use triggers if you want something to happen when the mud sends you certain text. It is possible to do scripting in mush-z, so if you were so inclined, you could learn something like lua and perform more complex actions when a trigger fires. For example, having a stereo prompt for mana that plays and positions sounds based on the % of your mana. If you want sounds to play, you will also need a source for sounds. The mushclient online documentation is an excellent resource, especially the script functions list and the alteraeon.xml file is filled with examples.

2013-03-26 12:33:24

Cool thanks. I will give this a look when I get home from school.

2013-03-26 14:15:17

Okay. I took a look, and I see a bunch of meaningless code. I don't know this stuff. My intent was to make combat pack, communication pack, and such like. For example, how would I get a thing to say "From your wristpad, x-person texts: "Yo, wassup?" Or how about when you miss a shot, stab a foe, get slaughtered, and such like? How? The example is a tad vague, and I can't really read without knowing what to look for. Help please?

2013-03-26 15:30:18

hi,
Well, first, you need examples of the text you want it to trigger on from the MOO its self. As in, if you want to get something to happen, it  has to be tied to a specific text event, such as, x fires the boomstick in to y's head, making an all mity crack!

Underworld Tech.
Accessibility from us, to you.
Visit us

2013-03-26 15:39:09

Hmmm, I'll look into this. So you can't just base it off x-person: from your wristpad, x-person pages: "Hi."

2013-03-26 20:14:55

hi, That's exactly what a trigger is. Lets look at my erlyer example.
x fires the boomstick in to y's head, making an all mity crack!
Now, lets break it down.
x fires the boomstick in to
X, is obviously a person named x name. So, I'll look at it in vipmud terms. To do this, you would put in the event field:
* fires the boomstick in to
And we'd do the same with y.
*'s head, making an all mity crack!
the full trigger in vipmud would look like this.
* fires the boomstick in to *'s head, making an all mity crack!
What if we wanted to have the same sound for different weapons? No problem!
* fires the * in to *'s head, making an all mity crack!
I hope i've explained this right. to get a fuller understanding, i'd read a mush scripting tutorial to get special simbles etc.

Underworld Tech.
Accessibility from us, to you.
Visit us

2013-03-26 22:11:57

So... I have no idea of something in context, so I'll just make something up as an example.

Let's say that, whenever I type "SAY <MESSAGE>" (without the quotes), the output will be something like, <Name> says, <message>.
For example:
say Hi!
Scott says, "Hi!"

For demonstration purposes, whenever I want to say something, I want my client to make a ding, so I know someone said something.  To accomplish this:
Press CTRL+SHIFT+8 to get into triggers;
Press ALT+O and ensure the box is checked;
Press ALT+A;
Your focus will land in an edit box.  In this example, I have two unknowns: the person saying the message, and the message itself.  In my trigger, I shall replace these unknown values with an asterisk (shift+8).
My trigger will look like the following:
* says, "*"
Now, I press ALT+B and find my sound, and press ENTER to get out of this browse dialog.
The trigger is complete.  When anyone says something, it will play my sound.

There is a script called LuaAudio.  I don't know much about it, other than that it offers superior sound support (OGG files, panning, etc).  I am uncertain how to invoke it and use it.  If people are interested, I might be able to figure it out.

Any other questions please let me know.

2013-03-26 22:13:11

I've gotten the concept, and have since made one fabulous trigger! The connect sound. This, for me, is one gigantic step into the developer community.

2013-03-26 22:52:32

As mentioned above, there can also be scripts tied to triggers.  An example: MUSH-Z's regen calculator.

If you end up doing this, I would strongly recommend you use Lua and stay away from any other languages.  (Yes, MUSHclient does support a long list of them.)  But keep in mind that, for a portable, trouble-free installation, Lua is seamless, as every single MUSHclient install is packaged with it.

Best of luck!

2013-03-27 15:33:35

I don't think I am going to get into Scripting yet. In 1.0, the triggers and a few macros are all that will be in. Then I will get into the Scripting. It's a matter of getting a firm foundation down. Are there any good audio tutorials that teach LUA? I can't do it in text without learning by ear what stuff is supposed to look like.

2013-03-28 14:57:30

Okay. Two things. One: how do I build the installer package?
And two, how do I enable ctrl+tab to cycle betwene input and output (like in Alter Aeon, you can press ctrl+tab to cycle betwene stuff you send to the mud, and stuff that the mud sends back).

2013-03-28 21:05:45

with the control tab thing, that's dependent on the output functions plug-in, so you'd need that to be activated.
I use it on every mud I play and it works fine.

2013-03-29 19:41:04

But I hand-activated it, and it isn't behaving. This is with Mushclient, the accessibly enhanced one I got that is not MushZ.

2013-03-31 08:37:13 (edited by dhruv 2013-03-31 08:37:57)

hi everyone,
I'm wondering is there any guide on writing plugins aka soundpacks?
I'm getting some problems. when I connect to a mud, the login doesn't  appear correctly, like it doesn't speak correctly...can someone help me in that?

This is not a signature.

2018-01-24 17:52:09

here's an issue I haven't yet been able to resolve; how the blazes do you get more than one sound to play in mush?  I can never seem to get this to happen and so I end up with sounds never playing because mush just plays the last sound triggered.  What am I missing!

When life gives you oranges, demand lemons since everyone else is obviously getting them.

2018-01-24 20:55:35

You need to use lua audio. you need the plugin ID for it, and then you do ppi.load(blablablablablabla), all your triggers will then take the form of ppi.play("path", 0, vol, pan) where that first 0 is the sound slot, you get ten. Forgive me if the syntax is a bit off, I haven't done it in a while. Also, you want to make regex triggers wherever possible, because that way your triggers will not interfere or get crossed up with one another. A lot of packs use wildcard triggers, which is something like [* chat * which works just fine until someone says to you, I wanted to have a chat with Billy. Then your chat sound goes off.

You could of course clean this up a bit without using regular expression triggers by just including more of the string, for instance, if your mud puts brackets around its chat channel, supposing it even has one, you could do [chat] *. You don't need that forward star in front of the chat, that's causing issues for people. Learning regex is a %*#$ing pain in the 4$$ so if you go that route, be prepared for it, but it does give you a lot of power and flexibility.

Let's say I wanted to buffer all chat messages using the chanelhistory.xml plugin. I didn't want to include the chat string, just the relevant bits, name, and message. You can format this however you'd like, I'll give an example. First, let's say our output from the mud when the chat channel is used takes the following form: [chat] Nocturnus says, "message"

Now we have some pieces of information needed to make a regular expression. Go in to your triggers list and hit add, then hit alt X to check that box so you don't forget, then alt T again to get back into the trigger, then type in the following

^\[chat\] (.*) says, "(.*)"$

Alright, so that seems crazy, right? but its not, let me break it down for you. The caret thing which looks like an inverted V means basically beginning of line, in other words, were asserting that this is the beginning of the matching line. Now, you may be asking yourself why are their backslashes in front of the brackets enclosing the chat. Well, that's because brackets are used in regular expressions to create a set. like this: p[aeiou]tter. Now, that regular expression would match patter, petter, pitter, potter, and putter, not all of which are words, but you get the idea. So we need to escape those brackets, which just tells the thing, hey, we're not doing a set, we literally mean brackets, so don't interpret it as a set.

Also, why are there parentheses around parts of this expression? Parentheses have several meanings, part of which is to start a branch, so you could have (thing1|thing2|thing3), which means either this one, that one, or finally *that* one, not both, not all, but only one. That symbol in the middle there is the pipe symbol, commonly used in unix like operating systems to pipe things into and out of stdin and stdout. Anyway, for our purposes, the parens do another thing, they mark out what's inside them as things we can refer to as wildcards.

Now, let's move onto that dot star or dot asterisk syntax. The dot, or full stop means literally any character, remember that example with patter pitter, etc? it could also be written like this: p.tter In this case, it means literally any character can fill the place of that dot, not just vowels, and it will still match. The asterisk is a quantifier, it just means zero or more, and now that I think about it, since we want both those fields to be filled in, it would be more appropriate to change the asterisk to a plus sign, which is also a quantifier meaning one or more.

That covers everything for this example except for the dollar sign, which simply means end of line. SO, the caret is beginning of line, and the dollar is end of line. Notice how we included the quotes in the regex rather than just encapsulating them in the .*? I did it that way so the quotes would be left out of that second wildcard to give you flexibility to format it however you wish.

Now that that regular expression is finished, you will want to go into the send box and do something like this, then you will go down two and change that combo box to script. Going back up in to the send, do the following:

history_add chat=(%1, %2)

The %1 and %2 are how you refer to those wildcards in the order they appear inside your regex. You can also format that however you wish, or if you don't want to format it, leave off the parens and delete everything inside them and change it to chat=%0. %0 is the entire matching line.

Now, one more thing, you will probably want to create a .lua file for your world which is part of our pack. This is where you link the external file to and is where you put the ppi.load method call. In this file you will want to do something like the following: global path=Getinfo(56) + "/worlds/aardwolf/sounds/"; But what is that Getinfo(56)? All that is saying is give me the path of mushclient's executable. After that we do what is called string concatenation, what that means is that we join multiple bits of info into one string, the + sign in lua is for that purpose, also for arithmetic addition, so its called an overloaded operator. We're basically forming a root so that we can use relative paths in the pack. We also leave it with a trailing / so that you don't have to prepend one to every sound trigger. The global in front of path is just saying I want to access this variable anywhere i.e. globally. So what this does is saves you a massive amount of typing. You could use it in a trigger like this. Let's say you had a folder structure in your Aardwolf/sounds folder that was like: combat, communication, general, etc. etc. etc. Your chat sound would be in communication, so in that example trigger earlier, you could add a line that looks like this: ppi.play((path+"communication/chat.ogg"), 0, 50, 50) and it would both play the sound and buffer it. I forget which one comes first pan or volume, I'd have to look inside luaaudio.xml to straighten that out but still... you get the general idea.
I'm sorry if that was too slow going or whatever, I don't know how much you know about programming and regex, not trying to be insulting or anything, just wanted to make something anyone should be able to follow. If you want more help with this, skype me or something, pm me and tell me here you sent one because  I never check them.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-01-24 22:01:42

slow?  Bwuh?  whaaat?  Waaaaait!
rofl I'm used to dorking around with VIP, which I suppose is the lame mans' way of doing things, so this, this is gonna take some doing/getting used to.  Hopefully I can convince you to chat with myself and my better half at some point when you are available/have free time on your hands, as I do want to get serious with SP's and the like.  I have a vague suspicion once I get a hang of Mush and the way things work as far as triggers and such go I'll have more flexibility and power to do as I wish, but as I said up until now VIP has been the end all/be all, given I'm a sound designer/audio producer first, everything else after, and programmer?  Yeah right; my HTML and PHP scripting knowledge is very basic, I got as far as if and block if statements with VB, and then I metaphorically began banging my head against every metaphorical wall you can think of and throwing temper tantrums that didn't help much of anything, at which point I said I'd come back to it later but never did because I never could get anyone to give me a kick in the pants and a push in the right direction, I suppose.  I'm a man of many talents, a master of none, and where programming is concerned, I doubt I'll ever get there.

When life gives you oranges, demand lemons since everyone else is obviously getting them.

2018-01-24 22:27:14

yeah no problem, you can add me on skype with bscross32, also I have a teamtalk server which I can fire up, I have more memory on my server now so there's no concern of letting it run 24/7 now, or face time something like that, whatever works for you I'm fine with.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-01-25 02:05:30

@Nocturnus, before you start making SPs, I'd highly recommend you learn the Lua language first. Like, the hole thing. Because you'll be using all that knowledge, believe me. And have the Lua reference manual handy too.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-01-25 03:36:31

You don't need to know every single thing about lua to make a soundpack. All you really need to know is variables and data types and if statements for certain things.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-01-25 17:40:40

@21, true, for a simple soudpack. But when you get into area-based music and such.... well, go look at alter aeon's plugin source code -- alteraeon.xml -- and you'll see tables in there.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-01-25 18:45:05

Right and that's fine, but what he was saying is he has limited experience with programming. In that case, the goal then is to do as much as possible without introducing abstract programming concepts. The minimalist approach, do as much as you can with whatever you got. Learn only what is necessary to do those tasks. Tables aren't really needed for a basic level, in fact, I can easily see a point where it becomes detrimental to introduce too many concepts too quickly. And building MUSHz probably took years, I know Wayune was one of, if not the main devs, and I don't know if he had help, but that pack grew to this crazy thing, a really good pack, but its just so big. I think for building something like this from scratch, its more important to get the thing functional before adding features like area music and the like.

You don't say to an aspiring chef, OK, here's this cooking manual, learn everything in it, then we'll talk. You start them up with small things, and build layers of understanding based on introducing concepts one at a time. If someone knows nothing of cooking, they need to have some basic concepts. So what concepts does a chef need, let's see

  • Heat - low heat for simmering, medium heat for general cooking, high for boiling, high can burn your food rapidly

  • General measuring knowledge - of which I have very little, so use siri or alexa tongue

  • Ability to follow instructions, but know where its safe to deviate if needed or desired

There are more obviously, but my point is you learn some things and work with what you have. When you feel confident with what you're doing, then you hit the books and learn more, you don't try to cram in knowledge, also at least for me, too much theory and not enough practice means I will not learn effectively. I need equal amounts of both. The practical sets the theoretical up in my mind, and makes associations that weren't there before.

I have also studied code examples from other packs, because I am not a good programmer, and never claimed to be, but I can get by, if not with a bit more frustration and cussing than some more talented people. Some of these packs are coded terribly, to be frank, and not worth studying at all. It was good that I knew better and didn't do what they did.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-01-25 18:54:52 (edited by Ethin 2018-01-25 19:07:26)

@23, Oh, I know. I'd always start simple if I were to try to teach someone programming, though for me it's more on the practical side than theoretical. Usually my mind can develop the theoretical aspect on it's own in a way that's natural to me, which is probably computers and what they can do (i.e. programming, troubleshooting, configuration, ...) comes so naturally to me (and might explain my attitude -- I don't really know if it would though). I can pick up a programming language in a few weeks, if not months, using code examples and *a lot* of practice. My speech teacher had a common mantra that I love and use to this day: "Practice, practice, practice." And it's definitely something that works too! One thing I have trouble with, for example, is computer theory (specifically the number sub-theory). I can count in Octal (1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 27, 30, etc), decimal (obviously) and decimal (0-9, a, b, c, d, e, f, 17, 18, etc) but not very high. Octal would probably come more naturally because it's raw numbers. But bring in hexadecimal with huge numbers (3f31d3392ff139c, for instance, which according to Python, is 284603308801201052) and I could never mentally translate it into numerals. I've read up on OS development at http://wiki.osdev.org, and tried it (all ended in CPU faults, VMware...) and never could wrap my mind around assembly language, though memory came easily (just not the address theory). The only OS development system I've managed to get working is CSMOS (the C# Open-Source Managed Operating System), which doesn't have very much that would allow you to develop a fully-function operating system. But enough of that and back to the original topic.
The reason I suggested having the Lua reference manual handy is because, while you'll start basic, you'll build upon it, and before you know it you'll be using tables and metaprogramming-like data types to allow you to accomplish what you want to do. Great analogy, by the way, Iron. That was a good one.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-01-25 19:01:11

@ironcross32, thanks.  Honestly, in a world that is quickly becoming a place where programming seems to be something of a literacy, it'd be nice to know a little more than I know now, but you're absolutely right that taking babysteps is a necessity.  I take the same approach with playing games and pretty much everything else in general; in the case of games I'll play it first and get acquainted with the keystrokes, mechanics, sounds, concepts, bla bla bla, then go read the manual, which means I'll probably be stuck with something before I ever hit the manual.  IN the case of coding, I haven't even gotten stuck yet, because I haven't had anyone to constantly motivate me in the right direction.  All the people I know who can code are usually busy with their own projects so I don't fault them for not being able to, but it is a bummer in some ways.  Beyond music, I never could motivate myself to do much of anything else, which is why my wife being around is so good for me; that little woman keeps me on my toes and made me learn simple linux concepts at the very least.

When life gives you oranges, demand lemons since everyone else is obviously getting them.