MOO Is Easy!!! Just give it a chance!
Submitted:|| 24th August, 2003
I seemed to get used to it within 2-3 days, learning most basics in 1 day. Mainly what gets people stumped is what things are & what they do. So here is an article that will help some people through MOO(2)!
I currently still use MOO2 because it is easiest for me & I use it until I feel I am ready to move to higher hights. Anyway, I learned many basics & thought I would share them with others who may need a little help!
MOO2 is very easy to learn if you are willing to give it a chance & put a little bit of time into it. You have to really want to do it though! I have yet to make a fullproof 2 player game, but its not far from were I am! Take it 1 step at a time (starting with a simple chat program).
MOO Vs MOO2
Some people I know think that its better to start with MOO because its more basic & is less flooded with all the features. But as I moved to MOO2 I found it is a lot better to start with, because it uses an interface almost exact to Moo's & works from what I see exactly the same, only it includes new features like, seeing how many people are connected to the server, & how many users are connected!
So basically what I am saying is, start with MOO2, its the same thing only better!
MOO2 yes is very easy, but only if you understand what is what & how it works with other parts of MOO2!
Connect: Basically connects you to a server... MOO2 comes with a server side, this will let you start your own server! Its perfect for newbies, because it uses your computer to connect, not another server that some times is up & sometimes isn't. The MOO Server Side runs a server with the server address at the top (this dose not include the name in () at the end ) & is only open when MOO Server Side is open.
When you click connect under MOO it will first ask you for the server name. (In MOO Server Side, this is at the very top.) Second the port. I will explain ports later on in the article. Once you have both these in, you are set & if the server is up on that port then you will connect. Isn't that just SO easy?
Disconnecting, basically what it dose is closes the connection. This will also sign you off if you are signed on. I will explain sign-of & signoff next. Once you are disconnected you will need to reconnect before you are able to sign on.
Ports are mainly what servers run on, defaultly MOO Server Side runs on port 1200, but this can be changed easily. Warning though, if 2 servers are running with the exact same name, but on different ports, they will NOT be able to send messages to each other. Ports sometimes can be blocked though by firewalls & such. How I see ports is, ways of letting more then 1 person having the same server name. Like cities... 2 cities can have many addresses, but if 1 happens to have the same address as another in it, mail men still can't get confused (if you added the city name ) because they wont be looking at another city for that address, just the city you labeled. Ports work almost exactly the same, you need to label to port that the server is in.
Signing On & Off
When you sign on, you are then able to send messages to other people, these messages also bounce back to you. But you can ONLY be signed on if you are Connected to a server. Once you get disconnected you will automatically be signed off. This dose NOT mean though that once you sign on you are automatically signed on!
See, signing on works a little differently then connecting, because you need to add a name for that sign on & then list what channel to sign into. More about channels later on... No sense righting something new on names though. Basically it works like AOL, each person as a sign on name. Mine just happens to be 'Goldansilver2000', now when you sign on you need a name to go with you! This can be anything, even if other people in the channel have the same name! There are ways to avoid this though (I think) but you will learn them as you become more advanced with making online programs!
Signing off, just like disconnecting, signing off works the same, only it will only sign you off, it will NOT disconnect you.
Channels (NOT SUBCHANNELS!)
Need I repeat, these are channels, not subchannels ... many people I know sometimes get these confused. I will explain subchannels later on in the article. Basically channels are like rooms were different people sign in to. I have yet to experiment it people from 1 channel can talk to people in another, but I am sure it is posable, just not in the same sign on, because each sign on needs to be on its own channel. It may be posable to be signed on 2 times, 1 time in 2 channels, being able to talk in 2 channels at once. Channels are what subchannels run through & what people sign on to. If you remember trying to use the sign on command, you would type in the name you want to use, then come up to a spot were you had no idea what to type... This is were the channel goes. A channel is a script so it can be anything from numbers to letters & a channel can have any type of name you want, just be sure that if you are sending messages through the channels, make sure they have the exact same name, or the message wont be going anywhere, but to you. As I said, channels are like rooms.
Setting an alias is really just setting the name of your sign on! The alias is your sign on name, istead of signing off & signing back in with the new name, just use the Set Alias & it will let you change it while being signed on!
Sending Text is sending text, I am still puzzled what all the other text sending operations are besides send object coordinates, but I wont go there. Sending text uses subchannels within a channel. When you go to send a text it will ask you for 2 things, the Text, which comes in a string, but can easily show values with the
Str$( >Enter number here< )
command. This comes in use when I use text messages for sending X & Y positions, it seems easier for me, maybe just because I use this method in making splitscreen games.
Anyway, the second thing you will be asked is the subchannel, each subchannel has its own number value, when you want to get the text sent, you will use this subchannel, so the game knows what subchannel to load it from. To keep things from get chaos I just use values in order 1, 2, 3, 4, 5, ... (DO NOT USE 0!!)
Now that you sent the text... What's the basic way on GETTING this sent text?
Simple... I've had problems using the Always command so I found a better one... In MOO2 there is an event in Get Message called Test to receive, you will then be asked the subchannel. This event then only is triggered when there is text sent to the channel you put down. There are many other ways to do this, but this is probably the best, for a simple chat program, because it doesn't clog things up with always running commands searching for what may not be there yet! Sometimes also speeding the running of other events & the app!
Anyway, to get used to how this text is gotten I use the Edit Object to get the text using the event.
Set Text> RecText$( MOO2, > Enter value here < )
Were it asks you for the value, this is were you put the channel you want to load the text from! If this works right, when you or anyone else connected & signed on sends text to the channel you have, it will set the Edit Objects text to what they sent.
What's that? You sent values?
Well, you the reverse event to what I gave you ... you know, the one that turns values to text. Here is one that turns text to values!
Val( >Enter string here< )
Note that this acts like a strainer, blocking letters & causing all the numbers gotten to be put together as one super number. Example: The event Val(1A2B3C) would get me the number 123.
Tip, for sending coordinates, send them through different channels. I have yet to find the limit for channels, if there even is one, so don't worry, there should be plenty!
Getting Info from MOO2!
MOO2 unlike MOO has MANY ways of getting info from the server & channels. Like receiving texts, & getting your IP address, or the IP's of other users, Its pretty easy to tell the difference between if its a text needed, or a value. Because texts start out with & values start out with the number 0.
Note: I have yet to discover about a few things, like the Server INI, Auto Tracking, & setting channels.
Anyway, that's mainly the basics of making an online app/game. So play around with MOO2, learn its power & how to put it to work! Its very easy once you get the hang of it, & after a while you may even move to higher hights like MOOClick & MOOGame!
So Good Luck & happy programming!!
Comments on the article are welcome!