### Author Topic: Door problem  (Read 2144 times)

#### z993126

• BFF
• Posts: 128
##### Door problem
« on: December 10, 2011, 11:57:54 pm »
Here's a simple set of rooms and doors.  It only allows me to refer to 'east door' from room420, not 'west door'.  Not sure why.

Code: [Select]
`/* /domains/dungeons/room/one/rm420.c * 2011-Dec-08 T. Cook * ----------- * 2011-Dec-10 T. Cook added 400 to x-coordinate */#include <lib.h>#include <terrain_types.h>#include ROOMS_Hinherit LIB_ROOM;static void create(){ room::create(); SetClimate( "temperate" ); SetTerrainType( T_INDOORS ); SetAmbientLight( 25 ); SetShort( "a dungeon" ); SetCoordinates( "404,2,0" ); SetLong( "This is the north end of a corridor in a dungeon." ); SetWorld( "Dungeon" ); SetTown( "One" ); SetExits( ([ "east"  : "/domains/dungeons/room/one/rm520", "west"  : "/domains/dungeons/room/one/rm320" ]) ); SetDoor( "east",  "/domains/dungeons/doors/one/door1-3" ); SetDoor( "west",  "/domains/dungeons/doors/one/door1-2" );}void init(){ ::init(); }/* EOF */`
Code: [Select]
`/* /domains/dungeons/room/one/rm520.c * 2011-Dec-08 T. Cook * ----------- * 2011-Dec-10 T. Cook added 400 to x-coordinate */#include <lib.h>#include <terrain_types.h>#include ROOMS_Hinherit LIB_ROOM;static void create(){ room::create(); SetClimate( "temperate" ); SetTerrainType( T_INDOORS ); SetAmbientLight( 25 ); SetShort( "a dungeon" ); SetCoordinates( "405,2,0" ); SetLong( "This is a dungeon." ); SetWorld( "Dungeon" ); SetTown( "One" ); SetExits( ([ "west"  : "/domains/dungeons/room/one/rm420" ]) ); SetDoor( "west",  "/domains/dungeons/doors/one/door1-3" );}void init(){ ::init(); }/* EOF */`
Code: [Select]
`/* /domains/dungeons/room/one/rm320.c * 2011-Dec-08 T. Cook * ----------- * 2011-Dec-10 T. Cook added 400 to x-coordinate */#include <lib.h>#include <terrain_types.h>#include ROOMS_Hinherit LIB_ROOM;static void create(){ room::create(); SetClimate( "temperate" ); SetTerrainType( T_INDOORS ); SetAmbientLight( 25 ); SetShort( "a dungeon" ); SetCoordinates( "403,2,0" ); SetLong( "This is a dungeon." ); SetWorld( "Dungeon" ); SetTown( "One" ); SetExits( ([ "east"  : "/domains/dungeons/room/one/rm420" ]) ); SetDoor( "east",  "/domains/dungeons/doors/one/door1-2" );}void init(){ ::init(); }/* EOF */`
Code: [Select]
`/* /domains/dungeons/doors/one/door1-2.c * 2011-Dec-09 T. Cook */#include <lib.h>inherit LIB_DOOR;static void create(){ door::create(); SetSide( "east", ([ "id" : ({ "door", "heavy door", "east door" }), "short" : "a door", "long" : "This is a heavy wooden door.", "lockable" : 1 ]) ); SetKeys( "east", ({ "copper key", "master key" }) ); SetSide( "west", ([ "id" : ({ "door", "heavy door", "west door" }), "short" : "a door", "long" : "This is a heavy wooden door.", "lockable" : 1 ]) ); SetKeys( "west", ({ "copper key", "master key" }) ); SetClosed( 1 ); SetLocked( 1 );}void init(){ ::init(); }/* EOF */`
Code: [Select]
`/* /domains/dungeons/doors/one/door1-3.c * 2011-Dec-09 T. Cook */#include <lib.h>inherit LIB_DOOR;static void create(){ door::create(); SetSide( "east", ([ "id" : ({ "door", "heavy door", "east door" }), "short" : "a door", "long" : "This is a heavy wooden door.", "lockable" : 1 ]) ); SetKeys( "east", ({ "copper key", "master key" }) ); SetSide( "west", ([ "id" : ({ "door", "heavy door", "west door" }), "short" : "a door", "long" : "This is a heavy wooden door.", "lockable" : 1 ]) ); SetKeys( "west", ({ "copper key", "master key" }) ); SetClosed( 1 ); SetLocked( 1 );}void init(){ ::init(); }/* EOF */`
Code: [Select]
`/* /domains/dungeons/obj/one/key1.c * 2011-Dec-10 T. Cook */#include <lib.h>inherit LIB_ITEM;static void create(){ item::create(); SetKeyName( "key" ); SetId( ({ "key", "copper key" }) ); SetAdjectives( ({ "copper" }) ); SetShort( "a copper key" ); SetLong( "This is a plain copper key with no markings." ); SetMass( 1 ); SetBaseCost( 10 ); SetDisableChance( 100 );}void init(){ ::init(); }/* EOF */`
« Last Edit: December 11, 2011, 12:01:36 am by z993126 »

#### z993126

• BFF
• Posts: 128
##### Re: Door problem
« Reply #1 on: December 11, 2011, 12:56:45 am »
Turns out that the problem lies in the fact that the doors were identical.  Changing the order of SetSide() calls in one fixed things.

#### z993126

• BFF
• Posts: 128
##### Re: Door problem
« Reply #2 on: December 11, 2011, 01:18:04 am »
The ACTUAL problem was in the first id of the doors being "door".  Changing that to a unique value is what really fixed things.