Re: how do I tweak object without changing the proto ty

From: Marc Gale (MARC@BGC.AC.UK)
Date: 08/27/98


<cut read_object function>

> Can somone please help me with this code. If I understood it right it
> creates a new object and returns a pointer to it.
> What I would like was to also make it tweak/change some of the values of
> the object read without changing
> the original  values of the proto type..so someone please explain how this
> stuff works, and what I need to change...
>
> Nocturnal :)

I'm assuming that the changes want to be isolated, as in, just for a
certain case, not every time you read any object.

If so, in the function that you are calling read_object from, place a
few lines *after* that call, to make the changes.

You should have something like

void my_function(whatever parameters)
{
  struct obj_data *obj;

  /* some stuff, including getting a virtual or real number, I'll
assume a real number */

  obj=read_object(number, REAL);

  /* You can stick the object tweaking stuff here */
  /* For example, to set value0 to 3 */

  obj->obj_flags->value[0]=3;
 }

I hope this is what you were after.

Marc


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST