Creating a new item

Posted by Kain on Wed 10 Jul 2002 01:44 AM — 6 posts, 22,669 views.

USA #0
Hi,

I'm trying to create a new item called "gun".

So I put the entries

case ITEM_GUN: in db.c
and
ITEM_GUN in mud.h

So then I go into Smaug and type "ocreate 1101 shotgun",
which creates a new object.
I then type in "oset 1101 type gun"

But then when I type in "ostat 1101", I get this message next to Vnum 1101 (where the type usually is):
LOG[*****] BUG: ITEM_TYPE_NAME: unknown type 65

Can anyone give me some advice as to what I'm doing wrong creating a new item?

Thanks
USA #1
gotta add stuff in build.c in char * const o_types []
Amended on Wed 10 Jul 2002 01:59 AM by Chris L
USA #2
Thanks, I put "gun" at the end of:

char * const o_types [] =

and I still get the same error.

This is driving me nuts, I know I'm doing something stupid
USA #3
I figured it out...

In mud.h where the types are defined there is a line after the enum list of types that says (in mine at least)

#define MAX_ITEM_TYPE ITEM_CHANCE

I couldn't really figure out what that meant, until I realized that ITEM_CHANCE was the last type in the list. So I changed this to ITEM_GUN (which I set as the last item in the list) and it worked like a charm.
USA #4
Can someone please tell me what I'm doing wrong...

ocreate 1101 newitem
oset 1101 blah
blah
blah
blah

what do I have to do to get these new items to save? In the past, I've always used an offline editor, so I've never down in within SMAUG.

Thanks
Australia Forum Administrator #5
To save you mean to appear next time? That is what resets are for, they put objects, mobs etc. into rooms.