Author Topic: add board to room == huuuuge error  (Read 2442 times)

Offline capo

  • Friend
  • **
  • Posts: 70
    • View Profile
add board to room == huuuuge error
« on: October 04, 2006, 06:55:57 pm »
Ok!! So Im trying to add a board to a room, here is the error report I get:



quote:




> add board to room

Indenting file...

"/tmp/indent.1160013162.tmp.dat" 36 lines 1061 bytes

Exit from ed.



Please enter the number of these that you want to add:

1

---

*Bad argument 1 to lower_case()

Expected: string Got: 1.

Object: /realms/capo/tmp/guild-foyergaabbafm1160013164 at line 26



'<function>' at /secure/obj/staff#16 (<function>) at /:0

'eventDoAddition' at /secure/obj/staff#16 (/secure/modules/generic.c) at line

220

'GetValue' at /secure/obj/staff#16 (/secure/modules/mapping.c) at line 126

'eventResumeMappingChange' at /secure/obj/staff#16 (/secure/modules/create.c) at

line 707

'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:26

'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:14

'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:14

'create' at /realms/capo/tmp/guild-foyergaabbafm1160013164 at line 15

'SetInventory' at /realms/capo/tmp/guild-foyergaabbafm1160013164

(/lib/props/inventory.c) at line 79

'eventLoadInventory' at /realms/capo/tmp/guild-foyergaabbafm1160013164

(/lib/props/inventory.c) at line 63

'eventLoadItem' at /realms/capo/tmp/guild-foyergaabbafm1160013164

(/lib/props/inventory.c) at line 40

'eventMove' at /domains/thieves_guild_test/obj/thief_board#26 (/lib/std/item.c)

at line 147

'eventMove' at /domains/thieves_guild_test/obj/thief_board#26

(/lib/props/move.c) at line 49

'CanReceive' at /realms/capo/tmp/guild-foyergaabbafm1160013164 at line 26

Trace written to /log/catch

---

*Bad argument 1 to lower_case()

Expected: string Got: 1.

Object: /realms/capo/tmp/guild-foyergaabbafm1160013164 at line 26



'<function>' at /secure/obj/staff#16 (<function>) at /:0

'eventDoAddition' at /secure/obj/staff#16 (/secure/modules/generic.c) at line

220

'GetValue' at /secure/obj/staff#16 (/secure/modules/mapping.c) at line 126

'eventResumeMappingChange' at /secure/obj/staff#16 (/secure/modules/create.c) at

line 707

'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:54

'unguarded' at /secure/sefun/sefun at /secure/sefun/security.c:92

'apply_unguarded' at /secure/daemon/master at line 431

'CATCH' at /secure/daemon/master at line 431

'<function>' at /secure/sefun/sefun (<function>) at /:0

'<function>' at /secure/sefun/sefun at /secure/sefun/reload.c:54

'CATCH' at /secure/sefun/sefun at /secure/sefun/reload.c:54

'cmd' at /secure/cmds/creators/update at line 109

'eventUpdate' at /secure/cmds/creators/update at line 148

'CATCH' at /secure/cmds/creators/update at line 148

'create' at /realms/capo/tmp/guild-foyergaabbafm1160013164 at line 15

'SetInventory' at /realms/capo/tmp/guild-foyergaabbafm1160013164

(/lib/props/inventory.c) at line 79

'eventLoadInventory' at /realms/capo/tmp/guild-foyergaabbafm1160013164

(/lib/props/inventory.c) at line 63

'eventLoadItem' at /realms/capo/tmp/guild-foyergaabbafm1160013164

(/lib/props/inventory.c) at line 40

'eventMove' at /domains/thieves_guild_test/obj/thief_board#27 (/lib/std/item.c)

at line 147

'eventMove' at /domains/thieves_guild_test/obj/thief_board#27

(/lib/props/move.c) at line 49

'CanReceive' at /realms/capo/tmp/guild-foyergaabbafm1160013164 at line 26

Trace written to /log/catch

/realms/capo/tmp/guild-foyergaabbafm1160013164: Error in update

*Bad argument 1 to lower_case()

Expected: string Got: 1.



Reload complete.

Indenting file...

"/tmp/indent.1160013164.tmp.dat" 36 lines 1061 bytes

Exit from ed.



---

*Bad argument 1 to lower_case()

Expected: string Got: 1.

Object: /domains/thieves_guild_test/room/guild-foyer at line 26



'<function>' at /secure/obj/staff#16 (<function>) at /:0

'eventDoAddition' at /secure/obj/staff#16 (/secure/modules/generic.c) at line

220

'GetValue' at /secure/obj/staff#16 (/secure/modules/mapping.c) at line 126

'eventResumeMappingChange' at /secure/obj/staff#16 (/secure/modules/create.c) at

line 716

'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:54

'unguarded' at /secure/sefun/sefun at /secure/sefun/security.c:92

'apply_unguarded' at /secure/daemon/master at line 431

'CATCH' at /secure/daemon/master at line 431

'<function>' at /secure/sefun/sefun (<function>) at /:0

'<function>' at /secure/sefun/sefun at /secure/sefun/reload.c:54

'CATCH' at /secure/sefun/sefun at /secure/sefun/reload.c:54

'cmd' at /secure/cmds/creators/update at line 109

'eventUpdate' at /secure/cmds/creators/update at line 148

'CATCH' at /secure/cmds/creators/update at line 148

'create' at /domains/thieves_guild_test/room/guild-foyer at line 15

'SetInventory' at /domains/thieves_guild_test/room/guild-foyer

(/lib/props/inventory.c) at line 79

'eventLoadInventory' at /domains/thieves_guild_test/room/guild-foyer

(/lib/props/inventory.c) at line 63

'eventLoadItem' at /domains/thieves_guild_test/room/guild-foyer

(/lib/props/inventory.c) at line 40

'eventMove' at /domains/thieves_guild_test/obj/thief_board#36 (/lib/std/item.c)

at line 147

'eventMove' at /domains/thieves_guild_test/obj/thief_board#36

(/lib/props/move.c) at line 49

'CanReceive' at /domains/thieves_guild_test/room/guild-foyer at line 26

Trace written to /log/catch

/domains/thieves_guild_test/room/guild-foyer: Error in update

*Bad argument 1 to lower_case()

Expected: string Got: 1.



Reload complete.

SetInventory modification complete.





Here is the code for the room:



code:


/domains/thieves_guild_test/room/guild-foyer
Guild Foyer
   This is the guild foyer.  Here the different members of the guild can come,
congregrate and discuss many different things if they so wish.  The room
branches off to the training facility, the armory, and a lounge where members of
the guild may rest if they so wish.

   
> about here
/domains/thieves_guild_test/room/guild-foyer.c

#include <lib.h>
#include <rooms.h>

inherit LIB_ROOM;

void create() {
    object ob;
    room::create();
    SetClimate("indoors");
    SetAmbientLight(30);
    SetShort("%^RESET%^%^BOLD%^Guild Foyer%^RESET%^");
    SetLong("   This is the guild foyer.  Here the different members of the
guild can come, congregrate and discuss many different things if they so wish.
The room branches off to the training facility, the armory, and a lounge where
members of the guild may rest if they so wish.");
    SetInventory(([
        "/domains/thieves_guild_test/obj/thief_board" : 1,
      ]));
    SetExits( ([
        "north" : "/domains/thieves_guild_test/room/guild-training",
        "east" : "/domains/thieves_guild_test/room/guild-lounge",
        "south" : "/domains/thieves_guild_test/room/guild-entrance",
        "west" : "/domains/thieves_guild_test/room/guild-armory.c",
      ]) );
}

int CanReceive(object ob)
{
    if(ob && lower_case(ob->GetClass()) != "thief")
    {
        message("info","You may not enter these halls.",ob);
        return 0;
    }
    return 1;
}

void init(){
    ::init();




and here is the code for the board:



code:


> more thief_board.c
#include <lib.h>
#include <vendor_types.h>
inherit DIR_LIB "/bboard";
#include <daemons.h>

void create(){
    ::create();
    SetKeyName("Thief Board");
    SetId( ({"board", "thief board", "thief board", "Thief Board"}) );
    SetAdjectives( ({"generic","sample","thief board"}) );
    SetShort("Thief Board");
    SetLong("This is the Thief Board.");
    SetMass(20);
    SetBaseCost("denarii",10);
    SetVendorType(VT_TREASURE);
    SetNoCondition(1);
    set_board_id("thief_board");
}

void init(){
    ::init();
}






Could someone help me out here? This error is a little confusing!

Offline capo

  • Friend
  • **
  • Posts: 70
    • View Profile
add board to room == huuuuge error
« Reply #1 on: October 04, 2006, 07:06:24 pm »
code:

/*
int CanReceive(object ob)
{
    if(ob && lower_case(ob->GetClass()) != "thief")
    {
        message("info","You may not enter these halls.",ob);
        return 0;
    }
    return 1;
}
*/








LOL



This was the culprit... it was saying Dumbass you're not a thief, you're a board... go away".... now I need to change object ob to a player, right?

Offline capo

  • Friend
  • **
  • Posts: 70
    • View Profile
add board to room == huuuuge error
« Reply #2 on: October 04, 2006, 07:10:50 pm »
Fixed it... simple change for a crazy error (that I caused)



code:
int CanReceive(object ob)
{
    if(playerp(ob) && lower_case(playerp(ob)->GetClass()) != "thief")
    {
        message("info","You may not enter these halls.",ob);
        return 0;
    }
    return 1;
}

Offline capo

  • Friend
  • **
  • Posts: 70
    • View Profile
add board to room == huuuuge error
« Reply #3 on: October 04, 2006, 08:13:59 pm »

Try this one more time...





if(playerp(ob) && lower_case(ob->GetClass()) != "thief")



is the correct iteration if anyone was following along at home.