Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ PennMUSH
➜ Running the server
➜ command creation and other global questions
command creation and other global questions
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Daniel P
USA (97 posts) Bio
|
Date
| Fri 20 Feb 2009 05:13 PM (UTC) |
Message
| Alright..this is the first time I've actually tried to admin my own MUSH and it's working fairly well, as far as room and object creation goes. However, I'm having a hard time understanding the global "Master Room," custom command creation and other things.
What does it mean when a user-defined command is global (created in the Master Room)? Does this mean that the command will work wherever you are? Or does it mean that it will work for anyone?
Speaking of custom commands, what is the proper, non-hack (I don't want to bother with compilers, if I can help it because I don't have time to learn C) technique for creating new commands that will apply to all players? I tried the one from the other post <http://www.gammon.com.au/forum/?id=1707> and created a successful WAVE * function for One (MasterWizard). Now how do I push the wave command to all created players without logging into every single one and "&DO_WAVE me ...?" Would it be a simple "replace 'me' with 'Global Commands' as shown in <http://www.gammon.com.au/forum/?id=1073>?
Quick question: is the "DO_WAVE" an important programatic term, or is it just a programmatic mnemonic that "everyone uses" and actually could be anything?
On another similar, only different note, I tried the @command examples detailed in HELP @COMMAND3 and received the error that 'That command has not been implemented.'
Okay, I'll quit now, because I think that a lot of these quesions are tied together and may have a single explanation that will fix everything for me.
Thanks.
-Daniel | Top |
|
Posted by
| Nick Gammon
Australia (23,057 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sat 21 Feb 2009 01:24 AM (UTC) |
Message
| I haven't played with PennMUSH for a while, and the PennMUSH site may well give better-informed answers.
However my understanding is that commands put in the "master" room are checked for, if the command cannot be found locally, for all players in all rooms.
So for example, you might make a command "north" which replies "you cannot go that way", to catch rooms that haven't implemented a north direction.
Quote:
Quick question: is the "DO_WAVE" an important programatic term, or is it just a programmatic mnemonic that "everyone uses" and actually could be anything?
No, I just made an object to implement the wave command and decided to call it that. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Daniel P
USA (97 posts) Bio
|
Date
| Reply #2 on Sat 21 Feb 2009 04:04 PM (UTC) |
Message
| Thanks a ton for a quick answer. I didn't find much on the PennMUSH website but I'll keep checking. I suppose trial and error would be the best teacher of them all..
-Daniel | Top |
|
Posted by
| Daniel P
USA (97 posts) Bio
|
Date
| Reply #3 on Sat 20 Mar 2010 10:01 PM (UTC) Amended on Fri 30 Apr 2010 12:36 AM (UTC) by Daniel P
|
Message
| Okay..so just wrapping this up since it got left hanging. And since I managed to figure it out, maybe it'll be useful to someone else who might prefer Penn over...SMAUG?
Custom 'soft-code' commands exist on objects created within the game (like the Bundle of Hay that Nick created in his tutorial or even a room object!)
Every soft-code command is generally called an attribute along with other things like functions, stored text and things called 'listeners.'
The DO_WAVE mentioned earlier is just the name of the attribute. It could be anything like "CMD_WAVE" or "WAVE_YOUR_HANDS_IN_DA_AIR".
The bit before the first ":" and after the "$" in the attribute text is the command that you would type into the game. The bit AFTER the first colon will be the script that is executed as a result of that command.
So to write a custom command, an example would be:
@CREATE Commands
&DO_WAVE Commands = $wave:@pemit %# = You wave.;@oemit %# = %N waves.
"@CREATE Commands" will create a new thing named Commands (a THING is one of the four types of objects, the other three being PLAYER, ROOM and EXIT).
"&DO_WAVE Commands = " is the declaration of a new attribute called DO_WAVE set on the Commands object. The contents of this attribute will be everything after the "=" sign.
"$wave:" says that the command WAVE will execute the following script which is "@pemit %# = You wave;@oemit %# = %N waves." This script basically sends two messages. The first sends "You wave." to the player who called the command and the second sends "<person> waves." to everyone else in the same location as the person.
As for the Master Room (default room #2), any object with a bunch of these commands placed in this room will listen for calls to those commands from anywhere, where-as if that object were anywhere else, only people in its location could execute its commands.
In short:
@create Commands
&DO_WAVE Commands = $wave:@pemit %# = You wave.;@oemit %# = %N waves.
wave
You see -> You wave.
Everyone else sees -> Daniel waves.
Okay. There it is. Finally wrapped up this subject now that I've figured out the initial question.
-Daniel | 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.
17,251 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top