28 Feb, 2015, capntroz wrote in the 1st comment:
Votes: 0
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?
28 Feb, 2015, Kardon wrote in the 2nd comment:
Votes: 0
From the CircleMUD FAQ:
Quote
1.2. I'm new to C and/or coding. What do I do?

First, a MUD is not a learning project. It has tens of thousands of lines to
it, many of which are obscure and unclear to even moderately skilled
programmers. Those little, ``Hello, world,'' programs are for learning,
maybe little math tests, etc. A MUD is a pretty ambitous project to start
with. That's like trying to run before you can walk, and while there's more
difficult things than a MUD to start with, there's a ton of easier things
you should start with. Second, if you are persistent, get a good C
reference 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 to
the socket functions which general C books don't cover and are usually
explained in other books on network programming. Then try small projects,
something similar to what already exists. This way, you can get away with a
cut-and-paste job and changing some of the code. Adding a simple version of
races isn't all that difficult, just examine the class code in class.c and
the CON_QCLASS block in interpreter.c, cut, paste, and modify. Also look at
structs.h, for "#define CLASS_" You'll begin understanding more and more of
the code as you copy and change it, eventually you'll be able to write a
whole function by yourself. Spend time learning, going with haste will hurt
you 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 pay
attention to them and take their answers to heart. These include things
like the following:

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

Read the FAQ. MUD Experience doesn't help a huge amount. Code experience
does.


With that being said, how "new" are you to C?
28 Feb, 2015, capntroz wrote in the 3rd comment:
Votes: 0
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.
28 Feb, 2015, Skol wrote in the 4th comment:
Votes: 0
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).
obj_to_obj( create_object( get_obj_index( item ), 0 ), newbiepack ); 
// This creates an object from 'item' the #, but creates it inside the newbiepack.

At the end, I got obj_to_char (newbiepack, ch). This moves it to the player and they then have it.

Circle code is similar to rom, so look for functions like that (the ones that move items around, look in comm or fight etc).
01 Mar, 2015, quixadhal wrote in the 5th comment:
Votes: 0
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.
01 Mar, 2015, Kardon wrote in the 6th comment:
Votes: 0
Your best bet may be to look at the do_load command in act.wizard.c, it does everything you are looking for.

Specifically, this snippet here:
struct obj_data *obj;
obj_rnum r_num;

if ((r_num = real_object(atoi(buf2))) == NOTHING) {
send_to_char(ch, "There is no object with that number.\r\n");
return;
}
obj = read_object(r_num, REAL);
if (CONFIG_LOAD_INVENTORY)
obj_to_char(obj, ch);


Obviously you would want to change atoi(buf2) to the actual vnum you want to load.
02 Mar, 2015, Nathan wrote in the 7th comment:
Votes: 0
@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.
02 Mar, 2015, Kardon wrote in the 8th comment:
Votes: 0
Nathan said:
@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.
02 Mar, 2015, tingonic wrote in the 9th comment:
Votes: 0
Here is how I handle this in my circle-derived code. Found inside a load_newbie_gear function that loads starting gear & class-specific items at the end of char creation.

//Make sure you declare

struct obj_data *obj;
obj_rnum r_num;

// For each object instance. 100 = object's vnum in this example

r_num = real_object(100);
obj = read_object(r_num, REAL);
obj_to_char(obj, ch);
28 Apr, 2015, capntroz wrote in the 10th comment:
Votes: 0
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!
28 Apr, 2015, capntroz wrote in the 11th comment:
Votes: 0
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.
29 Apr, 2015, capntroz wrote in the 12th comment:
Votes: 0
so im thinking that between

init_char(d->character);

and

save_char(d->character);

is where i should be loading the newbie equipment onto the charecter?



case CON_QCLASS:
load_result = parse_class(*arg);
if (load_result == CLASS_UNDEFINED) {
write_to_output(d, "\r\nThat's not a class.\r\nClass: ");
return;
} else
GET_CLASS(d->character) = load_result;

if (GET_PFILEPOS(d->character) < 0)
GET_PFILEPOS(d->character) = create_entry(GET_PC_NAME(d->character));
/* Now GET_NAME() will work properly. */
init_char(d->character);
save_char(d->character);
write_to_output(d, "%s\r\n*** PRESS RETURN: ", motd);

STATE(d) = CON_RMOTD;

mudlog(NRM, LVL_IMMORT, TRUE, "%s [%s] new player.", GET_NAME(d->character), d->host);
break;

case CON_RMOTD: /* read CR after printing motd */
write_to_output(d, "%s", MENU);
STATE(d) = CON_MENU;
break;
30 Apr, 2015, tingonic wrote in the 13th comment:
Votes: 0
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.
04 May, 2015, capntroz wrote in the 14th comment:
Votes: 0
thanks! so much stuff to look thru…..
0.0/14