View Single Post
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