Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 07-30-2010, 03:27 PM   #1
Gray
New Member
 
Join Date: Apr 2010
Posts: 1
Gray is on a distinguished road
New to coding, trying something simple

Hey all. I'm a fairly new coder - my experience has been very limited, and my relevant courses taken many years ago. I recently lost my coder for the MUD I own, and I've been attempting to pick up the mantle on my own. Not just because there isn't anybody else, but because it sure is more empowering not to go through a second party every time I'd like to see a modification.

Basically what I'm trying to do is this, and I imagine it will be pretty simple: I'd like to make it so the tell command is logged, and the player can input a command to see, say, his last 20 tells - a tell history so to speak.

My trouble is having absolutely no clue how to go about that. I suppose I'm asking for advice or guidance on how to start and proceed. Even better, if there's a snippet around for a Diku base that does something like this (that has idiot-proof instructions?? Lol.) that would be even better.

Thanks very much in advance for any assistance given.

-G.
Gray is offline   Reply With Quote
Old 07-31-2010, 12:03 AM   #2
Parhelion
Member
 
Join Date: Oct 2007
Name: Sarah
Location: Tempe, AZ
Home MUD: Ethos
Posts: 71
Parhelion is on a distinguished road
Send a message via AIM to Parhelion
Re: New to coding, trying something simple

What sort of codebase / language are you using?

Sometimes, you can find snippets that do something similar to what you want; while you want to make the feature on your own, you can use the code in these snippets as a starting template.

Another thing you can do is look at your codebase to see if it does something similar elsewhere. You want to log tells. Does your MUD log any sort of channels? What about status logs? See if it has a feature that has a similar functionality to the last-tells feature -- anything where the game may read a log and strip out relevent information to print. Studying these sorts of things may give you ideas about how to modify your own feature.

I'm not certain how familiar you are with programming in general, so here's something else you might want to try:

Sit down and decide exactly how you want your feature to work - step by step.
What exactly happens when a player sends a tell?
How will the game record this tell? Will it add all tells to one giant log that can be read by admin, or will it be stored in some sort of virtual buffer?
What might happen if there is nothing in this buffer when the player tries to check their last tells?
How would it save across login-logout and disconnects - or even should it?

While it may be tedious, you can draw out a visual representation of how the MUD will encounter and answer these questions in a diagram. Then you can take that and just replace the "English logic" with code. It'll definitely help you figure things out if you're not familiar with syntax, since design will be one less thing to worry about.
Parhelion is offline   Reply With Quote
Old 07-31-2010, 11:02 AM   #3
Newworlds
Legend
 
Join Date: Aug 2007
Name: NewWorlds
Home MUD: New Worlds
Posts: 1,425
Newworlds will become famous soon enoughNewworlds will become famous soon enough
Re: New to coding, trying something simple

You might also seek another lead programmer and work closely with them.
Newworlds is offline   Reply With Quote
Old 08-01-2010, 01:51 AM   #4
Threshold
Legend
 
Join Date: Apr 2002
Home MUD: Threshold RPG
Posts: 1,260
Threshold will become famous soon enough
Re: New to coding, trying something simple

There are a number of different ways to go about this. Your first decision is how you want to log tells. Do you want to store it as data on the player? Do you want to store them in a text file? Do you want to store them in some other way? After deciding that, you just set or write the info when the tell is sent, and then recall the last 20 when they use whatever command for checking their last tells.

I don't doubt that it is empowering, but it can also be dangerous.

I am going to recommend that you either keep looking for a programmer, or find a mud where you can apprentice/work as a "wizard."

Tinkering is a great way to learn, but if you do not have a good foundation it won't be long until you cannot even get the mud to boot up. At that point, coming to a forum for that kind of help is not going to have the turnaround time you really want.
Threshold is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 11:58 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2022