Author Topic: AddItem() not adding the item  (Read 1794 times)

Offline z993126

  • BFF
  • ***
  • Posts: 128
    • View Profile
AddItem() not adding the item
« on: October 10, 2011, 06:12:32 pm »
the mermaid well room isn't loading the pool to be jumped into, for some reason.  I can clone it and drop it and it'll work, but that's...not what it's supposed to be doing.  :/

/realms/ardneh/area/room/mermaid_well.c
Code: [Select]
#include <lib.h>
#include <daemons.h>
#include <terrain_types.h>
#include <medium.h>
#include <respiration_types.h>
#include "../customdefs.h"

inherit LIB_FISHING;
//inherit LIB_ROOM;

mixed longdesc();

static void create(){
//room::create();
fishing::create();
SetClimate( "indoors" );
AddTerrainType( T_INDOORSWINDOW );
SetMedium( MEDIUM_LAND );
SetRespirationType( R_AIR );
SetAmbientLight( 30 );
SetGravity( 1.0 );
SetShort( "Mermaid Well" );
SetLong( (: longdesc :) );
SetItems( ([
"room" : "This is a low-ceilinged chamber.",
"water" : "The water is clear, fading to dark depths in the well."
]) );
SetExits( ([
"south" : MY_DIR "/workroom"
]) );
SetChance( 80 );
SetFish( ([ "/realms/ardneh/area/meals/damselfish_swallowtail" : 16 ]) );
SetSmell( "The air smells of brine and fish." );
SetListen( ([ "default" : "You can hear the faint splish-plup of the water against the rocky walls." ]) );
SetTouch( ([ "default" : "The stone floor is cool to the touch." ]) );
SetTouch( ([ "water" : "The water is cool and wet." ]) );
AddItem( new( "/realms/ardneh/area/etc/mermaidpool" ) );
}

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

mixed longdesc(){
string str;
int i, imax;
str = "\tA deep pool, roughly five metres in diameter, spans most of this circular stone " +
"chamber.  Its grey walls are damp with moisture, and shallow, broad steps around " +
"the pool's edge lead down into the water.";
if( GetFish() ){
str += "  Light glitters faintly on the scales of the small fish swimming in its " +
"azure depths.";
}
    if( query_night() ){ str += "  The stars of the night sky sparkle "; }
    else{ str+= "  The sun shines "; }
str += "through a round opening in the centre of the domed ceiling.";
return str;
}

/realms/ardneh/area/etc/mermaidpool.c
Code: [Select]
#include <lib.h>
#include <jump.h>

inherit LIB_DUMMY;
inherit LIB_JUMP;

int eventJump( object who ){
who->eventMoveLiving(
"/realms/ardneh/area/room/wellsurface",
"$N dive into the pool.",
"$N dives into the pool."
);
return 1;
}

static void create(){
dummy::create();
SetKeyName( "mermaidpool" );
SetId( ({ "pool", "well" }) );
SetAdjectives( "deep" );
SetShort( "a deep pool" );
SetLong( "A deep pool, roughly five metres in diameter, spans most of this circular stone " +
"chamber.  Its grey walls are damp with moisture, and shallow, broad steps around " +
"the pool's edge lead down into the water." );
AddJump( "pool", "/realms/ardneh/area/room/wellsurface", JUMP_INTO );
}

/realms/ardneh/area/room/wellsurface.c
Code: [Select]
#include <lib.h>
//#include <dirs.h>
#include <terrain_types.h>
#include <medium.h>
#include <respiration_types.h>

inherit LIB_FISHING;

mixed longdesc();

varargs static void create(){
fishing::create();
SetClimate( "indoors" );
SetTerrainType( T_INDOORSWINDOW );
AddTerrainType( T_SURFACE );
SetMedium( MEDIUM_SURFACE );
SetRespirationType( R_WATER | R_AIR );
SetDayLight( 30 );
SetNightLight( 30 );
SetShort( "the surface of a pool" );
SetLong( (: longdesc :) );
SetExits( ([
"north" :     "/realms/ardneh/area/room/mermaid_well",
"northeast" : "/realms/ardneh/area/room/mermaid_well",
"east" :      "/realms/ardneh/area/room/mermaid_well",
"southeast" : "/realms/ardneh/area/room/mermaid_well",
"south" :     "/realms/ardneh/area/room/mermaid_well",
"southwest" : "/realms/ardneh/area/room/mermaid_well",
"west" :      "/realms/ardneh/area/room/mermaid_well",
"northwest" : "/realms/ardneh/area/room/mermaid_well"
]) );
SetChance( 80 );
SetFish( ([ "/realms/ardneh/area/meals/damselfish_swallowtail" : 16, ]) );
}

mixed longdesc(){
mapping inv, items;
string str;

inv = ([]);
str = "This is the surface of a deep pool, roughly five metres in diameter, with walls made of large, flat " +
" rocks and shallow, broad steps around its edge.";
if( GetFish() ){ str += "  Light glitters faintly on the scales of the small fish swimming in its azure depths."; }
    if( query_night() ){ str += "  The stars of the night sky sparkle "; }
    else{ str+= "  The sun shines "; }
str += "through a round opening in the centre of the domed ceiling.";

SetItems( ([
({ "pool" }) : "A deep pool, roughly five metres in diameter, with walls made of large, flat rocks " +
"and shallow, broad steps leading out of it." + ( GetFish() ? "  Light glitters faintly on the scales " +
"of the small fish swimming in its azure depths." : "" ) + "  There is a round opening in the ceiling " +
"giving a glimpse of the sky.",
]) );
return str;
}

Offline z993126

  • BFF
  • ***
  • Posts: 128
    • View Profile
Re: AddItem() not adding the item
« Reply #1 on: October 10, 2011, 06:25:10 pm »
Hmm.  On closer examination, the room IS cloning the mermaidpool object, I just can't do anything with it.  I was at one point able to jump into the pool...what gives?

Offline z993126

  • BFF
  • ***
  • Posts: 128
    • View Profile
Re: AddItem() not adding the item
« Reply #2 on: October 11, 2011, 07:06:01 pm »
Found the problem.  Apparently SetID() isn't an array, in this case, so it wanted SetID( "pool", "well" );