Hello Im new to unix/linux and c. i used to do room descriptions and item creation for deaths gate before it opened and also for forbidden lands mud tho never got into coding. I have experience with pascal and the various basic languages. My question is im running circle 3.1 and i want to make it so the players start with some low level items. also when i gave my test guy a backpack and he enters the game the backpack is emptied into his inventory. any advice as where to start on these two issues?

First, a MUD is not a learning project. It has tens of thousands of lines toit, many of which are obscure and unclear to even moderately skilledprogrammers. Those little, ``Hello, world,'' programs are for learning,maybe little math tests, etc. A MUD is a pretty ambitous project to startwith. That's like trying to run before you can walk, and while there's moredifficult things than a MUD to start with, there's a ton of easier thingsyou should start with. Second, if you are persistent, get a good Creference book and read the code, try to comprehend what everything is doing(to some small extent). You should probably avoid comm.c as it is home tothe socket functions which general C books don't cover and are usuallyexplained in other books on network programming. Then try small projects,something similar to what already exists. This way, you can get away with acut-and-paste job and changing some of the code. Adding a simple version ofraces isn't all that difficult, just examine the class code in class.c andthe CON_QCLASS block in interpreter.c, cut, paste, and modify. Also look atstructs.h, for "#define CLASS_" You'll begin understanding more and more ofthe code as you copy and change it, eventually you'll be able to write awhole function by yourself. Spend time learning, going with haste will hurtyou more than it will help you.

1.3. I want to build my own MUD. Where do I start?

Many common questions arise from new MUD admins. It is a good idea to payattention to them and take their answers to heart. These include thingslike the following:

I don't have any coding experience with MUDs, but do have a lot of ideas formy own. I have played many MUDs for a LONG time, though.

yeh ive downloaded some code snippets and im not overly worried about inserting them as i do have experience with programming but my experience with c is very limited and from the late 90's so basically next to none. ive been using the builders guide and have allready done a zone of my own so im looking for some small project to code in myself.

cap, I started with Rom so it's similar.What you want to look at is where you're giving the players the items.In mine, I give them a newbie pack, with random food items, a few torches, some random cash etc.To do that; I first declare a new object (OBJ_DATA *newbiepack;), then figure out what is going inside.I do that via a vnum check (random switch statement between like 30 items).

While I don't/won't remember any details of horrible C MUD codebases, a good practice is to look at code which does what you want it to do in a different way.

For example, if you want to put an item on a new character, look at the code for the "get" command, which takes an item from somewhere and puts it in your inventory. Likewise, the code for the "equip" command would tell you how to wear/wield it, and the code for "put" would likely tell you how to move things into a container.

@Kardon I'd call that a FAQ a little snarky and heavily biased towards the the use of C and CircleMUD. C (and even C++) is much harder to work with than Java and CircleMUD is hardly simple. I get that it's sorta relevant here, but that's not the best tone or greatest advice in general regarding coding muds.

@Kardon I'd call that a FAQ a little snarky and heavily biased towards the the use of C and CircleMUD. C (and even C++) is much harder to work with than Java and CircleMUD is hardly simple. I get that it's sorta relevant here, but that's not the best tone or greatest advice in general regarding coding muds.

Fair enough, although right above your post you will (hopefully) notice that I answered the OP's question in appropriate detail. In retrospect, I should have just asked what their experience with C was.

thanks that gives me something to think about. i jsut finally managed to figure out how to change what info is seen with score/sco command on my own by looking at act.informative.c and looking at some score snippets. trying to add multi attack now. got it so it shows up on skills and you can practice it but it doesnt seem to actually being used when i have my immortal stand and watch my test dummy fight. not sure whats going on but hey i got one thing done on my list. woot!

and kardon Ive coded a cpl games in pascal which was a pain for pcs in high school. I also wrote some simple ones in basic, basica, qbasic including a very limited single player mud knock off for Ti graphing calculators back in the late 90's. I made a version of barren/solar realms from bbs's for a graphing calculator too. so nothing at all like c and certainly nothing near as complex as a mud or even a single file from the src directory. ive done building for deaths gate when it was getting ready to open, for forbidden lands and 1-2 others and I am just looking to go to the next level with a mud.

No. During the character creation process, the client is hopping around all different STATEs. State CON_PLAYING is the only state where the player is considered 'in game', so in order to move loaded objects to the PC, the PC needs to be logged in and 'functioning normally'.

Circle does a halfway clever thing by keeping a character Level 0 during the char creation process. In CON_MENU, the client picks a choice from the main menu (0 quits, 1 logs in, etc). See interpreter.c:1539. In the case of '1', the character logs in. A little ways further down you'll see that state is switched to CON_PLAYING (:1586). After this there is a GET_LEVEL check to see if the character is level 0 (newly created). Notice here that it calls a function called do_start, which is an in-game character initialization.

You can find do_start in class.c:1465. You'll immediately note some obvious assignments, such as level = 1, exp = 1, and assignment of max hitpoints, mana, movement… everything that is not initialized in the character creation process, stuff that needs to be in the CON_PLAYING 'game state' in order to function and save and be saved together. Since do_start only runs a single time, which is every time a level 0 character logs in, this is where you want to place code to load the newbie gear. If it were me I'd just add it at the end of the function, after the SITEOK flagging.