nails is going to start ignoring people on the phone soon. Mark takes the phone from nails. Mark initiates surrogate ignoring. Sharinna has arrived. nails says, "Everybody ready?" Sharinna nods. Psyche nods. Nemesis nods. Ros nodnods. Boo noddles. nails says, "I'm going to start with a couple of disclaimers. I 'planned' this on short notice. As I mentioned in the post, people have been looking for something like this (or a log of something like this) for a while, coming to me in ones and twos, and it kept getting put off. So, calculated this was not." nails says, "Also, I worked a night shift last night and slept for most of the day, so I didn't really prepare anything. This is all off the cuff, but based on past discussions of a similar nature. In short, bear with me :)" Kaedria grins, "I'll probably end up explaining stuff to Nem if she doesn't follow." Nemesis swats Kae.. "Uh, shut up. :P" Psyche says, "And she'll explain it to me." nails says, "The other piece is that, as I stated, I am aiming this at beginners. This means that there are some things I'm going to gloss over, there are exceptions to rules I'm going to ignore for now. Some of you will probably have things to add on certain subjects, and I ask that you consider whether this is the right audience before you chime in with the nitty gritty." nails says, "So, lets begin." nails says, "Lets first get a sense of who is here, and what your experience has been, why you're interested in code, and what your goals are down the road. Feel free to jump in." The Lecture Hall - Museon You stand in a colonnaded gallery of smooth white stone, lit during the day by clear glass skylights set into the high arched ceiling; by night, torches in high mounts illuminate the hall. The floor is carpeted in dark blue, and low benches arranged in a cresent ring an open area. While ornately decorated, this place has an indisputable air of utilitarian purpose. Contents: Sharinna Nemesis Jazmin Psyche Cadi(#1741PXcJOg) Muse Mark Boo Sally Eve Kaedria nails Grey Ros Tape(#1033V) The Archives (TA) The Forum (O) Kaedria pokes nailsy, "I tell you all the time what I'm at." Kaedria just annoyed to hell with one of her stupid codes with the breaking setq. nails says, "I should also remind people that this session will be logged, so as to share with people who couldn't attend. ;)" Kaedria logging too. Ros says, "I am running my own game, have done most of the softcode on it and have wiz'ed various places without a coder trying to set up a new game. I had no guide on what I should learn so it's been a holdgepodge and who knows how much I'm m8issing, so... I'm always interested in listening and lesarning something I dont know and would help me." Nemesis knows VERY little. Wants to know as much as she can. Wants to be a better staffer. "I wanna know how and why the code works instead of just saying.. 'wow, that's cool.' Sharinna has reconnected. Eve has reconnected. Kaedria grins, "Read that as? She wants to cut down my bitchy moments so I don't ban people out of spite because they break my code." Cadi has reconnected. Psyche says, "I'm mostly a builder, though I'v seen some exceptional things using code which make using places and even setting up custom parents make a room that much better for players. Beside that, I'm wizzing on Kaed's mush...and she just explained the rest for me." Kaedria cackles. nails says, "Banning out of spite is bad, m'kay." Kaedria sagenods, "It is. Which is why I ignore everyone when coding." Nemesis is the other admins and refuses to let Kae ban people without good reasoning. "She's got a bad temper." Eve grins Muse is here. i've been around for a very long time. played with code off and on, have had to recycle most of the braincells for other things now. i can understand a lot of code once someone else writes it, and i can take it apart, but i can't write it from scratch, nor do i really want to. i need those braincells. i'm predominantly a visionary, Story, organizational person. Psyche says, "Yes, only because that steals Nem's ability to ban them for spiteful reasons." Psyche hides. Kaedria stops being anti-productive and shuts up :P Muse says, "Oh, and I can build like there's no tomorrow." Jazmin is, apparently, the token stranger who doesnt knwo you folks in this crowd. I'm also a staffer on a game, I code enough to break things and have to get our head coder to fix it. I'm primarily a PR/Newbie helper kinda staffer. nails says, "There is no tomorrow. Just fyi." Muse says, "Good." Ide enters from the Forum. Ide has arrived. Boo is head builder and owner and co-owner on a handful of different places. I've been doing it long enough that I know how to pick apart code and for the most part figure out how it works. But I'd like to not have to honestly rely on someone else. I dream of the day where I can say, you'd know what'd be cool!? And be able to do it myself. 10 years of building experience, 2 years of futzing with code some. Kaedria grins, "I'll give everyone a quater always tomorrow but never today." quarter* Psyche says, "I'm in the same boat as Boo and Muse, give me code and I'll take it apart sooner than later, I'll even be able to modify a few of the easier ones, write something /very/ simple, but getting any further than that and my brain just...stops functioning." Sharinna has partially disconnected. Grey maintains Anomaly Jobs, coded there and wrote almost all of the code on Gamma One. Plus people seem to think I have some small idea regarding how to softcode. Ros notes you do. Cadi has partially disconnected. Eve has partially disconnected. nails says, "I first had a friend throw me on a MUSH the first time I got on the internet. At the time, dialup costs prevented me from hanging out all day, so I'd login, grab helpfiles, disconnect and read them offline. Code is what sucked me into MUSH, although it took me years and years to really get a good sense of what I was doing. I am by no means an ubercoder, and I'm pretty rusty these days, which is why I offered to do a 'beginners' class. That's about all I can manage. But the bottom line is that after more than ten years, I still love softcode and what can be done with it." Sally has reconnected. nails says, "I'm going to start with basic stuff that most people probably know, but it's best to start with a foundation (and it's likely helpful to someone reading the log)" nails says, "Everybody wave to the nice log reading people." Sally waves! nails waves. Eve <--hothot. Boo blows kisses. Kaedria refuses to wave. Cadi waves. nails says, "So. MUSH. And let me clarify what I mean when I use that term: MUSH is a family of codebases that primarily include TinyMUSH, PennMUSH, TinyMUX and RhostMUSH. Yes, MUX is a type of MUSH. There are a few other variations that are based off one of these four (or are old splinters like TinyTIM) but those four are the primary MUSH-type codebases in use these days." nails says, "All of these share a basic structure that is built upon a database. The database is made up of objects, all of which have types, flags, attributes, etc." nails says, "This vocabulary is very important. Some people will use other terminology that comes from elsewhere, such as calling attributes 'properties'. When dealing with a technical subject, using the correct terms is key to avoiding confusion. Let me give you an example of a common mixup people have." nails says, "The MUSH database is essentially made up of objects. There are four types of objects: Players, Rooms, Exits, and Things." nails says, "People often confuse the terminology and call the 'Thing' type an 'object', suggestiong that an object is not a player, room, or exit. Why does this matter? Later on when you are in the thick of code, and you need to use a function to determine the type of object, you'll need to specify THING if you want to match that." nails says, "In short: details matter." nails says, "Questions?" Grey seconds nails. "Details and terms matter very much." Ide says, "good intro nails" Eve says, "so far so good" nails says, "So lets talk about objects. What is an object? I'm not going to say it's the basic building block of MUSH, because that's cliche and also debatable. But essentially, the database is a collection of them. Each one gets a unique identifying number, known as the Database Reference Number (or DBREF for short). It looks something like #45941, and the # in front is important. In certain code instances, it tells the MUSH what you're talking about, and also when you're discussing code with other players, it lets them know you're talking about a dbref of an object." nails says, "alternate terms for dbref: dbnum, or db#. I think dbref is most common." Sally has partially disconnected. nails says, "And as stated, there are four types of objects: Players, Rooms, Exits and Things. Each object is labeled with this particular TYPE, and the softcode language has ways to work with this. Another key difference is that each type of object is created differently." nails says, "Players are created at the connect screen of a MUSH, or using the wizard command @pcreate." nails says, "Rooms are created with the @dig command. Exits are created with the @open command (or with a complex form of @dig that does @open for you). Things are created with the trusty old @create command." nails says, "They are all essentially the same basic structure, but with slight differences that the MUSH cares deeply about. Only players can log into games. Only exits can be linked between rooms (or other objects) to form virtual doorways. It's possible to make objects act a lot like rooms, and so on and so forth, but in general each type of object is used for its own specific purpose." nails says, "Questions?" Psyche says, "I know what the base dbref stands for, but then at times you see a dbref that looks like #21PXcZ, what are the letters for anyway?" nails says, "Good question." nails says, "When you see #21PXcZ, you're seeing the dbref #21, followed by the FLAGS set on that object." nails says, "In this case, P (player) X (ansi) c (connected) and Z (royalty)" Eve says, "heh, nifty." Nemesis ahhhhhhhhs. Kaedria views flags as what the object is capable of doing, "I know that's not a completely accurate of how they work but..still..." nails says, "One thing to note: There are three 'flags' that aren't really flags. P for player, R for room, and E for exit. These mark objects as their specific TYPE, and so they are treated differently than all other flags." Psyche nods, "Gotcha, well that explains a years load of time on that question." nails says, "There are specific functions that you can use to check whether an object has a flag or not. If you use those functions to see whether it has the P or PLAYER flag, it'll return false, even if the object is a player. You need to use the equivalent type functions instead." nails says, "Lets talk a bit about flags." nails says, "Similar to what Kaedria said, they are modifiers that affect the behavior of objects." nails says, "Flags are boolean, which is to say they are on/off. Either the flag is set, or it is not. Either the object has that modifier, or it does not." nails says, "(boolean is just a fancy name for true/false, or on/off)" nails will let the math geeks tear him to shreds over that comment later. Kaedria hates boolean. Hates it. Eve says, "hmm, do they work like tags?" nails says, "One thing to note is that while all MUSH codebases have flags, they differ somewhat between codebases. So flags on PennMUSH may be different than on TinyMUX. Also, new features get added as codebases are developed, so newer versions may have newer flags that do new things." nails says, "Tags in what sense?" Eve says, "do you build a proggie and then use flags on all the objects this program is supposed to affect, or do you do it the other way around?" Eve says, "as in tags" nails says, "Sometimes they are used as markers. There are certain flags that do not actually change the ability or behavior of an object, but are used for that purpose." Flags: ABODE(A) ACCENTS(!~) ANSI(X) AUDIBLE(a) AUDITORIUM(b) BLEED(!-) BLIND(B) COMMANDS(!n) CHOWN_OK(C) CONNECTED(c) DARK(D) DESTROY_OK(d) ENTER_OK(e) FIXED(f) FLOATING(F) GAGGED(j) GOING(G) HALTED(h) HAVEN(H) HEAD(?) HTML(() IMMORTAL(i) INHERIT(I) JUMP_OK(J) KEEPALIVE(k) KEY(K) LIGHT(l) LINK_OK(L) LOKI(0) SHINY(1) TATO(2) WOOT(3) THEONLYWINNERINTHEWAROF1812WASTCHAIKOVSKY(4) WOMBAT(5) ELECTRICSOUP(6) MARKER7(7) MARKER8(8) MARKER9(9) MONITOR(M) MYOPIC(m) NO_COMMAND(n) NOACCENTS(~) NOBLEED(-) NOSPOOF(N) OPAQUE(O) OPEN_OK(z) PARENT_OK(Y) PUPPET(p) QUIET(Q) ROBOT(r) ROYALTY(Z) SAFE(s) SITEMON($) SPOOF(!N) STAFF(w) STICKY(S) TERSE(q) TRACE(T) TRANSPARENT(t) UNFINDABLE(U) UNINSPECTED(g) VACATION(|) VERBOSE(v) VISUAL(V) WIZARD(W) nails says, "For example, TinyMUX has a HEAD flag." HEAD FLAG: HEAD(?) () This is another marker flag, for faction heads and the like. As with STAFF, no powers come with it, it is purely a marker. Related Topics: nails says, "Check: help head" Mark says, "Flags can also be artificially created that have no impact on what that object can do." nails says, "You can then write softcode that uses this for authentication, so that it will give an error message to anybody attempting to use the command who does not have this flag set on themselves. Or, you can write a command that broadcasts a message to only connected players with that flag." Eve nods, ok, thanks. nails says, "There's also a vacation flag. Games will often use this when doing an idlepurge of players, and will spare players with the Vacation flag from fiery death to which they would otherwise be condemned." nails says, "But there are more interesting flags." nails says, "For example, the ANSI flag. When this is set on a player, it enables them (client permitting) to see ANSI highliting and/or colors." nails says, "The actual behavior differs between codebases, but that is how it works on TinyMUSH and TinyMUX." nails says, "There is the ever popular Wizard flag. Objects with this flag set on them have untold powers which they may lord over less fortunate beings." nails says, "Just remember, kids: With great power comes great responsibility." Eve grins nails says, "And I keep using the term 'set', so I should explain that. To set a flag on an object, you use the @set command. For instance: @set Eve=Immortal (flag names are not case sensitive)" nails says, "I've done this. Now Eve cannot be killed (see: help kill)" nails says, "(also see: help immortal)" Kaedria doesn't like the kill commands. nails says, "To unset a flag, use the @set command as before, but prefix the name of the flag with an exclamation point, also known as a bang. ie: @set eve=!immortal" Eve says, "oye!" nails says, "the ! means 'not'. When I see !immortal, in my head it sounds like 'not immortal'." Eve says, "damn" nails says, "Also of note: Some flags are restricted so that not everybody can set them. For example, Eve cannot set (or unset) the immortal flag on herself; you need to be a Wizard to do that. And Wizards themselves cannot set/unset the Wizard flag. Only the character with dbref #1 can do that." nails says, "Flag questions?" Eve says, "so far so good" nails says, "Good, good." nails says, "Lets move on." nails says, "So, you have objects. You have flags. Flags are settings that are turned on and off for individual objects." nails says, "When you use @set, you tell it the specific object you're talking about." nails says, "Objects have unique dbrefs, each has a specific type, and they can each have various flags set on them. What else can you do with an object?" Mark says, "You can make it produce other things!" nails says, "That's one of those rhetorical questions like in a textbook, Mark." Mark ohs nails says, "But I like bunnies." Mark :) nails says, "Lets talk about attributes." Kaedria thought she was gonna get lessons in reproduction too :( Mark says, "That's another talk night." Kaedria ohs and sighs hersle fup for that one. "Is it hands on?" Kaedria ahems, "Shutting up again." nails says, "Attributes have two parts to them: A name, and a value" fup=for nails says, "You set an attribute on an object. Attribute on object contains " nails says, "For example, lets use the most common attribute: DESC" nails says, "The Desc attribute is what contains the description of an object. One of the first things you are told when you log into a game is to set a description. You use a command something like this: @desc me=five foot two, eyes of bloo" nails says, "This 'sets' your Desc to 'five foot two, eyes of bloo'. This is to say: the attribute on object contains " nails says, "Any questions about what I mean by 'contain', or the like?" nails puts it another way: 'five foot two, eyes of bloo' is the 'contents' of your desc. nails says, "Furthermore, there are two types of attributes. There are the attributes that are built-in to the MUSH, of which Desc is one. Then there are User-Defined attributes." nails says, "This distinction is rooted in the history of MUSH, as the early versions of TinyMUSH did not have user defined attributes. The built-in ones were the only ones you could use." nails says, "The built-in attributes consider of things like succ, fail, odrop, alias. Most of these have corresponding hardcode commands that are used for setting them. ie @succ = or @alias me=snail" Ros grins at Mark. ;) nails says, "User defined attributes can be named anything that isn't already the name of a built-in attribute." nails says, "There is a command, &, which is used for setting these." nails says, "the & command is used like this: &foo =" nails says, "ie, can I do: &foo me=this is my foo attribute" nails says, "However, if I do &desc me=I am pretty, this will overwrite the description I set using the @desc command." Kaedria idles to feed her kid. nails says, "And TinyMUX will restrict me from using &alias me=blah to set my alias." nails says, "You can see what attributes are set on an object you own (including yourself- MUSH is all about liberty, and player objects own themselves) by typing examine . you can use exa or ex for short." Psyche says, "Another question, for regular user defined attribute I can understand like &foo me=foo but then why do attributes that are softcoded in need the have a &CMD? Like &cmd me=yadda or &cmd objectname/dbref=yadda." nails says, "You can do: exa me. This will show you a wealth of information, including your name/dbref/flags, attributes, stuff in your inventory, and your location. The attributes are what we're looking at now." nails says, "Actually, if you do that, you'll create an attribute named 'CMD' on the object." nails says, "Do you mean as a prefix?" nails says, "ie, you'll often see CMD_BURGLE: " Mark says, "The prefixes are usually just helpful guidance for coders to find all attributes of that type quickly via something like: examine foo/cmd*" Kaedria nods and believes she means that one, nailsy, "I think she's been looking at soe of my code and I always use cmd-" Psyche says, "Yea IU do." nails says, "This is just a convention some people use. It's not required by the codebase. I personally don't use this convention, and there's a whole discussion on Electric Soup regarding that topic: http://www.electricsoup.net/?q=node/87" Psyche says, "Not only your code, any code that I'v been asked to update or look at always had it." nails says, "I used to do things like &BURGLE1 obj=blah, etc" Mark says, "Conventions add an order of organization but are not necessary." Psyche ah's and nods. nails says, "Now I tend to use c.burgle for commands. Read over that thread and you'll see what different people use and what their rationales are." nails tried to burgle you! nails says, "But yeah, in conclusion: MUSH doesn't care." nails says, "More attribute questions?" Muse has been burgled! nails says, "Lets get lively, people." Mark says, "Many of us coder beasts tend to add them :)" Eve is following Ide says, "fire it up nails" Ide says, "I do have a question" Jazmin is good thus far. We're still in the realms of what I know, but not enough to offer pearls of sage commentary. nails nods? Ide says, "what can't you include in the attribute name when you set it?" nails says, "That varies between codebases, I believe. We're on MUX here, so.." nails says, "help & covers that." nails >> Attribute names may only contain letters, numbers, and the characters < -_.@#$^&*~?=+| >, and must start with a letter. Ide nods nails says, "All I've really covered at this point is the structure of objects and their data. That is after all what a database is, but that's not softcoding. Coding is partly about managing/storing that data, but it's also about doing stuff with it. It's about objects that come to (some form of) life, or creating new commands that do things the MUSH doesn't know to do by default. It's about creating the world inside the empty shell that MUSH provides and making respond, giving people something to interact with." nails says, "It's important to cover that first, though, because when you write softcode, the code itself is stored as data on objects. Code lives in attributes, attributes read and use code in other attributes on other objects, etc. Unlike a traditional programming environment where you have a text file, and maybe that is read by a program, or it is used by a compiler, in MUSH softcode, the code is like graffiti on the walls. It's a part of the environment." nails says, "Very cyber." Cadi says, "Nice way of putting it." Polymnia has arrived. nails says, "Hey, Polymnia. Just to let you know where we're at: We've gone over the basics of what objects are, flags and attributes and how to set them, and how that fits into the whole database picture." nails says, "I'm going to have to pause again, work has reared its head." Mark will field questions if you have any at this point. nails says, "No questions?" Ide says, "how useful is it to think of mushcode as unlike a traditional programming environment, when we can write softcode offline then upload?" Mark says, "That depends on the project at hand. If it is a general player coding a widget, there is no need. For global command objects and interfaces, I think doing it offline helps. Personally, I do most of my coding offline and use a revision control system to keep those objects in sync." Mark says, "The offline method allows you to format things in something resembling a human readable format and convert it when you upload. MUSHcode is not pleasant to look at inline." Kaedria hates doing her code offline, "Unless I have an offline mu* I can test on. I can't stand not being able to check the results to debug." Kaedria grins, "While I'm writing the code. I test every change I make every time I make the change. Mark nods, "True, Kaedria. I usually have an up/down process to keep it in synch." Sharinna has reconnected. Sharinna has partially disconnected. Mark says, "I like coding inline but I keep those changes external to the game so I can quickly resort a sane configuration when needed." nails says, "I'm much sloppier than that. I'm a terrible role model for coding." Jazmin says, "How many places/folks keep a sandbox/dev port?" Mark says, "Very few that I know of, Jazmin." Mark says, "I believe that very code intensive places such as Firan do." Jazmin nods. nails says, "Running a second game is easier to do if you're hosting the game on your own hardware. When it comes to using a hosting provider, it may affect your cost, so at that point it becomes a cost/benefit calculation." Mark says, "That line is a gray boundary." nails says, "Several codebases will actually run on Windows or Mac OSX, so people sometimes run 'test' games on their PCs." Mark nods to nails, "Having a testing site can be very helpful but you often need players in addition to the code to adequately test." Jazmin has visions of coders handing out sweets 'C'mere little player..' nails starts ignoring work again. Mark grins, "Actually, I've found that the people that are central to the game are very willing to help." Psyche says, "Can any of the codebases be run off of Linux?" nails says, "Most if not all." Mark says, "Almost all of them." Mark cannot think of any exceptions nails says, "Linux is probably the most common OS platform for MU* hosting." Mark says, "If nails is ready again, I'll shutup. You can page me with any questions I didn't get too." nails says, "So lets talk about code." nails says, "Coding is at a very basic level simply just a case of having an object run MUSH commands for you. Usually it's a case of it doing more than one command in a row, or doing the same command (or set of commands) repeatedly, or at certain times." nails says, "Obviously it's more complex than that, but a key tenet of MUSH coding is starting with something simple to build something complex." nails says, "The basic building blocks of code (I hate that term) are commands and functions." Mark thinks key elements nails says, "These are often confused by beginner coders who mix the two up, but we must go back to the start of the discussion and re-emphasize the need for attention to detail. Commands and functions are not interchangable." nails says, "There are plenty of metaphors to use for this. The way I describe it is that commands are like verbs, and functions are like nouns. To build a proper sentence, you need a verb to explain what is happening. Likewise, when writing code, you often need a command to tell the MUSH what is happening." nails says, "English has one set of rules, whereas with MUSH, you're dealing with the rules of the parser." nails says, "Here's an example. Type: time()" Huh? (Type "help" for help.) nails says, "Then type: think time()" Wed Mar 21 22:02:16 2007 nails says, "The first example will give you an error, whereas the second will give you the time (that's server time, ie Eastern Daylight)." nails says, "In these examples, 'time()' is a function where 'think' is a command. The MUSH parser expects to first see a command, and then arguments for the command to work with." nails says, "Put another way: commands are active, functions are passive." nails says, "In fact, functions are just really fancy variables. You can type: think and you don't need the function." nails says, "Does this make sense?" Eve nods Psyche says, "Actually, run that by me again please?" nails nodnods and thinks. Mark adds, "The heart of MUSHcoding is about functions but it must have a command preceding them to actually make an impact." nails says, "How about we work on an example. Is everybody here familiar with the @emit command?" Sharinna nods. Psyche nods nails dropped Noisy McLoudface. nails has just created the object Noisy McLoudface with the @create command. nails says, "I have @set the object Visual. The Visual flag modifies the object's behavior such that it can be examined by anybody." nails types -=> &c.bleet-broken noisy=$bleet: You hear a bleeting noise. nails types -=> &c.bleet-works noisy=$bleet2: @emit You hear a bleeting noise. nails says, "There are now two $commands (or dollar sign commands, or arbitrary commands) on this object." nails says, "Anybody unclear on what a $command is?" nails is going to cover it anyway. Muse says, "Nope!" You hear a bleeting noise. Nemesis hahas and shakes her head too. nails says, "One of the biggest parts of MUSH softcoding is creating your own commands, commands that are not built-into MUSH. The primary way to go about this is using $commands." nails says, "The way this works is by setting an attribute on an object where the contents start with a $. The format for this is: $command:code, where 'command' is what you type, and 'code' is what the object does when you type it." nails says, "as you can see from Mr. Noisy here, we have the commands 'bleet' and 'bleet2', each with different code." Jazmin is a morning person who's still getting over a flu bug and it's getting late here. Any objections to me just idling here to catch it on backspam? nails says, "'bleet' doesn't work. 'bleet2' does." nails says, "idle away. We don't have an idle timeout on Puggy. :)" Mark notes that Penn requires a Commmands flag to see those. Jazmin says, "Score. See ya in the morning. :)" nails nods. "Each of the codebases has a way of limiting what objects can have working commands coded on them, usually either a 'commands' or 'no_command' flag that either tags it as able or unable, respectively. nails says, "Some codebases let you set flags on individual attributes to give finer grain control, but we won't worry about that here. That can be a homework project." nails says, "So." nails says, "Why doesn't the 'bleet' command work?" nails says, "The basic structure is there: $:" Psyche says, "It doesn't have anything usable with it? Like say, @emit, @pemit, pose or anysuch?" nails says, "But the code doesn't do anything." nails says, "It's data without an action." nails says, "Lets try another example, but this time with functions." nails types -=> &c.noisytime-broken noisy=$noisytime: The time is [time()] nails types -=> &c.noisytime-works noisy=$noisytime: say The time is [time()] nails types -=> &c.noisytime-works noisy=$noisytime2: say The time is [time()] nails fixes that second one. nails says, "If you type: noisytime, you won't get any error message. you won't see any response." nails says, "What you're not seeing is that the MUSH is giving the Noisy McLoudface object a 'Huh' message for trying to run a bad command." nails says, "That's what the $command code is doing: it's telling the object to run a command, just as if it was a player typing it in." Noisy McLoudface says, "The time is Wed Mar 21 22:19:56 2007" nails says, "noisytime2 works. The first thing the MUSH parser gets is the 'say' command." nails says, "just like bleet2 works" nails says, "the command 'say', with an argument." Eve nods nails says, "It's the equivalent of English. If I walk up to you and say: "The store"" nails says, "You're like, yeah, what about it?" nails says, "If I say to you, "Go to the store", you know what I mean." nails says, "You might tell me to jump in a lake instead of going, particularly if you're Eve, but you still know what I mean." nails says, "That's what I mean by commands are 'active'. In fact, in some parts of MUSH documentation, commands are called 'actions'." Eve says, "lake. go." nails watches the lake get up and walk away. Eve grins nails says, "Psyche, does that help at all?" Psyche nods, "Muchly!" nails says, "So, commands take arguments." nails says, "When you use the 'say' command (or the " shortcut) you provide an argument. it's say " nails puts it this way. nails says, "This sentence is an argument to the say command." nails says, "Functions also take arguments." nails says, "consider the flags() function" nails types -=> say flags(me) nails says, "PXc01M~OW" nails says, "'me' is an argument to the function flag(), which itself is an argument to the say command." nails says, "Questions?" Psyche says, "Is there a set number of functions that can be strung along or nope?" nails says, "Yes." Psyche says, "Which is...?" nails says, "There is something called the function_invocation_limit. This is a configurable setting for a MUSH. The default on TinyMUX is 2500, but many games increase this." nails says, "How and where you'll run into this is a complex issue, but generally speaking you'll only hit this limit if you're doing either really really involved code, or you're running something against a whole lot of different pieces of data." Psyche nods. nails says, "The limit is tied to the command itself." nails says, "ie, if you 'say time()' repeatedly, the limit gets reset every time you do a new 'say'" nails says, "MUSH has piles of different limits in it, which you generally only worry about when you hit them :)" Mark says, "If you hit them, normally you are doing something wrong. There are exceptions but that limit is far beyond a novice." nails says, "Many games increase things like the invocation limit to 20,000 or higher. If you're hitting that... yeah." nails says, "Any other questions about arguments, to either commands or functions?" Mark notes that very few games have systems that hit the default limits. nails says, "There is one cardinal rule, which if broken is a cardinal sin." nails says, "Functions can be arguments to commands." nails says, "Commands *cannot* be arguments to functions." nails says, "example" nails types -=> say ifelse(10,true,false) nails says, "true" nails types -=> say ifelse(0,true,false) nails says, "false" nails types -=> say ifelse(10,num(mark),num(nails)) nails says, "#2" nails says, "Mark's dbref is #2" nails types -=> say ifelse(0,num(mark),num(nails)) nails says, "#9" nails says, "Mine is #9." nails says, "Functions can be arguments to functions." nails types -=> say ifelse(0,num(mark),@emit foo) nails says, "@emit foo" nails says, "You see that it did not run the @emit command." nails says, "It just considered it data." nails types -=> say ifelse(0,num(mark),@set nails=immortal) nails says, "@set nails=immortal" nails says, "Doesn't change my flags." nails says, "Commands don't work if they are inside functions." nails says, "Does that make sense?" Psyche nods. Cadi aahs, alright. Makes sense. Eve says, "yeah" Mark says, "This is a cardinal rule that many new coders fail to understand." nails says, "That's a very common mistake. You'll find a function that does something you want, you'll find a command that does something you want, and you try to string together code that does what you want in a certain order." nails has to apologise again for going so slow. Work has bad timing. nails says, "Any questions at all?" nails says, "Any signs of life?" Eve says, "heh, I'm still following." Kaedria is still half here. Psyche is getting it down. nails says, "In some cases, commands can call other commands." Boo is a quarter here. Logging though and so far I'm witcha. nails says, "For example, the @wait command. @wait