[DG SCRIPTS] [OBJECTS] Adding a new command

From: Phillip A. Ames (kirk47@JUNO.COM)
Date: 10/09/98


OK all, I wanted to add some more flexibility to my DG Scripts and
Triggers, so I decided I'd try to get something working that would allow
me to set the values of an object, seeing as how there is no = operator
in DG.  I have what I wrote in about 5 minutes, just to see if it worked,
but it didn't, and as I don't know quite whats wrong, I'm going to smack
myself if any of you out there know what's wrong ;).  I added it to my
command tree, etc, but when I try to use something in my scripts like:

objvalset 0 1

to set the 1st value of the object to 1, it doesn't work.  It'll crash,
and point me to a line in interpreter.c with something in it about
arguments.  Can anyone see anything that I'm really screwing up on below?
 Thanks,

-Phillip
\/\/\/\/\/\/\/\/\/\/Code for DG Object Value Setting\/\/\/\/\/\/\/\/\/\/

OCMD(do_obj_value_setting)
{
    int arg1, arg2;
    obj_data *object;

    two_arguments(argument, arg1, arg2);

    if (!arg1 || !arg2 || !is_number(arg1) || !is_number(arg2))
    {
        obj_log(obj, "osetval: bad syntax");
        return;
    }
        GET_OBJ_VAL(object, arg1) =  arg2;
}


Phillip Ames    | Satisfaction is not guaranteed.
kirk47@juno.com | -Ferengi Rule of Acquisition #19
ICQ: 8778335    | AOL IM: Grathol
http://members.xoom.com/Gowron/index.html(Unfinished)

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
or call Juno at (800) 654-JUNO [654-5866]


     +------------------------------------------------------------+
     | 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