Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   New to coding, trying something simple (http://www.topmudsites.com/forums/showthread.php?t=6164)

Gray 07-30-2010 03:27 PM

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.

Parhelion 07-31-2010 12:03 AM

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.

Newworlds 07-31-2010 11:02 AM

Re: New to coding, trying something simple
 
You might also seek another lead programmer and work closely with them.

Threshold 08-01-2010 01:51 AM

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.


All times are GMT -4. The time now is 05:00 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022