Log:Basic Coding
Basic Coding | |
---|---|
Participants | 9 November, 2017 Annapurna teaches babycode! |
Location | |
Annapurna says, “Hellooooo” You say, “Helloooooo~” Haruki says, “Hi” Annapurna says, “Checking to see if Vorp's coming.” You say, “Are you logging for people who can't attend, Anna?” Haruki says, “TodaY I am sick and particularly stupid so I don't expect to understand anything but gonna sit here anyway” Vorpal has arrived. Annapurna says, “You may already know some of what I'm going to tell you, so bear with me.” Annapurna says, “I don't know what level of knowledge people have already.” Haruki has none Haruki says, “Mu code is utterly baffling to me” Annapurna says, “Alrighty. First thing to bear in mind: players, exits, rooms, items, they are all the same thing as far as code is concerned.” Annapurna says, “They all have database references (dbrefs).” Annapurna says, “They are code objects.” Annapurna says, “They are objects of a particular "type"” Annapurna says, “Player objects, exit objects, room objects, etc.” Annapurna says, “If you look at yourself, you will see your name up at the tippity top of your desc.” Annapurna says, “Next to that, you'll see a bunch of letters and numbers tucked into ()” Annapurna says, “The number is your dbref.” Annapurna says, “There are less spammy ways to get that number.” Annapurna says, “But we'll skip those for now.” Haruki says, “The letters?” Annapurna says, “Those are flags.” Annapurna says, “Since you are a Player object, your list will start with P. :)” Annapurna points to: help flag list Haruki says, “Thanks!” Annapurna says, “Now, by default, you as a player object can control any object you are listed as the owner of.” Annapurna says, “So you can @desc yourself, any rooms or items you own, set code on them, move them around, etc.” Annapurna says, “There are all sorts of @powers which players can be given, to allow them to, say, look at things in distant places, or build things, or...” Annapurna says, “If you are a Wizard, you get (almost) all of those.” Annapurna says, “The veryvery first Player object created on these games, #1, is God.” Annapurna says, “Olympus here.” Annapurna says, “God is the only one with the ability to set the Wizard flag, and certain things can't be done to #1.” Annapurna says, “And certain things can ONLY be done BY #1.” Annapurna says, “Wouldn't Riker be pleased.” Haruki laughs Vorpal says, “HA!” Michelle giggles Haruki says, “I am surprised you made a pop culture joke!” Annapurna says, “I grew up on Star Trek because my dad was obsessed.” Annapurna laughs. Vorpaldoesn't think tng is still pop culture. You say, “TNG isn't universal? wat? :P” Vorpal says, “Same woth me, Anna!” Annapurna says, “Picard is forever. <3” Annapurna says, “So!” Annapurna says, “You as regular players have none of those fancy @powers, so you can only modify yourselves/objects you own.” Annapurna says, “That is Basic Code Thing #1.” Annapurna says, “If you don't own it, you can't change it.” Annapurna says, “That's why, say, if you type 'ex here' you will just see that someone else owns it.” Annapurna says, “ex is short for examine.” Annapurna says, “You can type 'e' as an even shorter shortcut.” Vorpal says, “izzat an owner cmd?” Annapurna points at: help examine Haruki says, “ACK! I forgot do't type ex me” Annapurna says, “Yeah, even worse for wizzies, Haruki.” Annapurna says, “We see more of your attributes than you do.” Rowan comes in from the temproom hub. Rowan has arrived. Franklyn comes in from the temproom hub. Franklyn has arrived. Annapurna says, “Welcome, welcome.” Annapurna says, “+repose should have the last bit.” Rowan waves and hides in a corner to listen while she makes lunch. Annapurna says, “So far we have established that Rule #1 is that you can only modify objects YOU own.” Annapurna says, “And how to see your dbref (look at yourself) and flag list (help flag list).” Annapurna says, “So!” Annapurna says, “On to touch on "attributes" in more detail.” Haruki has disconnected. Haruki has connected. Annapurna says, “Oops. Looks like we lost a Haruki.” Annapurna says, “Ah! There he is.” Haruki ducttapes Annapurna says, “The way TinyMUX code works, almost everything is stored in "attributes" set on an object.” Annapurna says, “You can examine your attributes with 'examine'” Annapurna says, “Like.. ex me/desc” Annapurna says, “Examine <target>/<attribute name>” Annapurna says, “ex me/d* would pull up anything starting with d.” Annapurna says, “The * is a wildcard.” Annapurna says, “Like when you're playing Uno, and get a card which can be any colour.” Annapurna says, “* means "I could be anything"” Annapurna says, “We'll touch more on uses for those shortly.” Annapurna says, “In this code base, commands are stored as attributes, too.” Annapurna says, “They just have to start with a specific sequence.” Annapurna says, “I'll get to that in a moment. First, I want to be very clear: what you are writing is called an "arbitrary" command.” Annapurna says, “As opposed to an @command, or a hard coded command like look or think or examine.” You say, “I was wondering if this was softcode. Thank you.” Annapurna says, “We as staffers write a + in front of things as a simple way of indicating that it is softcode, custom stuff.” Annapurna says, “So +finger was written by staff, not by TinyMUX itself.” Annapurna says, “Things like that.” Annapurna says, “You don't NEED to start your command with a +.” Annapurna says, “Only thing you can't use is a number.” Annapurna says, “Same goes for attributes. You can never start an attribute name with a number.” Annapurna says, “Now, in a similar vein, the system itself doesn't care what you name a command attribute.” Annapurna says, “Howeeeever...” Annapurna says, “We are human beings.” Annapurna says, “We like being able to easily search for things with our fleshy eyeball blobs.” Annapurna says, “So it's customary to start command attributes with something like cmd- or cmd_ or c. or...” Annapurna says, “I usually use cmd- myself, but it makes absolutely no difference, and it's entirely your choice.” Annapurna says, “The part which DOES matter is what goes INTO that command attribute.” Annapurna says, “Now we're touching on that magic sequence I mentioned earlier.” Annapurna says, “I'll give you an easy example of one I coded on November.” Annapurna says, “I wanted a cheaty simple way to teleport directly into Ninth Spectrum Paintball without having to +travel to the room outside.” Annapurna |