Wave Image
















  • help > w > debugging code
    This file consists of some general strategies to debug code in
    no particular order.
    
    1. If any fixes don't seem to be made after updating files, check
    if there are any 
    
    restore_object(SOMEFILENAME)
    save_object(SOMEFILENAME)
    
    present. What happens is that all global variables will be 
    saved in SOMEFILENAME, which may include (old) global variables that
    may have changed. Some examples where this has occurred: magewar rooms,
    damage_d, barovia quest, killquest list. 
    
    Easiest way to fix (which may depend on situation): Create a new
    function similar to:
    void fix_the_mercury(){
        restore_object(DATADIR);
        ... some code to fix variables
        save_object(DATADIR);
    }
    and then eval it.
    
    2. *Bad arg 1 to call_other(): got 'number', expected 'string/array/object'.
    
    Usually (but not always), due to some 
    
    object SOMETHING;
    SOMETHING->do_whatever();
    
    and object SOMETHING does not exist. 
    
    To fix: 
    if(SOMETHING){
        SOMETHING->do_whatever();
    }
    
    3. If you can't move out of any exits in a room, could be due to a init().. not
    passing back the call, i.e. something like
    
    void init() {
       add_action("_order","order");
       add_action("_order","buy");
    }