Just as a side note, it is poor programming to do:
create_obj(get_obj_index(QUEST_ITEM1))
In ROM.
I would suggest this:
pObjIndex = get_obj_index(QUEST_ITEM);
if ( pObjIndex == NULL )
{
// error here
}
Obj = create_obj( pObjIndex );
You could hack create_obj to return on a null pObjIndex, but then you
wouldn't really have that error letting you know it was your QUEST_ITEM
(or whathaveyou) that really screwed it up....
Ammaross
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve
Boleware
Sent: Wednesday, December 11, 2002 2:02 AM
To: [email protected]
Subject: Re: A few more questions, sorry if have been awnsered.
> >1. when the item is loaded, at the same time, let it set the objects
level to characters level...
> >
> >obj->level == ch->level
> *SNIP*
> obj = create_obj(get_obj_index(QUEST_ITEM1),obj->level == ch->level);
first things first, i was hasty in my reply before.. there are multiple
things wrong with the above...
a) trying to assign the level of the obj before initing it..
obj->level == ch->level
obj = create_obj(get_obj_index(QUEST_ITEM1),obj->level ==
ch->level);
b) using the equality operator instead of assignment == vs. =
c) the function create_obj, at least in my version of ROM?
standard as far as i know, looks like so
create_object( OBJ_INDEX_DATA *pObjIndex, int level )
that last variable is what you need to use correctly..
like so: create_obj( get_obj_index(QUEST_ITEM1), ch->level);
that will set your obj level on creation to the correct level instead of
after creation assignment with obj->level = ch->level
^_^
> free_string(obj->description);
> sprintf(buf, "Please return this to {C%s{x if found. Thank
> you.",ch-name);
> obj->description = str_dup(buf);
> *end of snip*
<snip>
> Charlie
> the Noobz
once again,
Steve, the bored :)
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom