Talos Mud Development Blog

One mans quest to blog about Mud Development

Archive for the ‘Convesions’ Category

Old Code Converted To 3.0

leave a comment »

So I imported my old domain from 2.1.18 all the way up to the current 3.0, but man there are some crazy little changes that occured.  Like new verbs that upset the addactions that I had coded up.  Here’s what I learned:

create an object that uses this code:


OLD CODE: stage.c

static void create() {
    SetShort(“White Dove Inn – Performers Stage”);
    SetLong( (: LongDesc :) );
    SetExits( ([
 “east” : “/domains/talos/whitedoveinn/room/dancefloor2.c”
      ]) );
    SetItems( ([
       : “A pull rope to open and close the curtains.”
      ]) );



New Code: stage.c

  WDI_OBJ”stage_rope.c”: 1,
 ]) );


New Code: stage_rope.c

#include <lib.h>
#include “../whitedoveinn.h”

inherit LIB_DUMMY;
inherit LIB_PULL;

int pullRope(object who);

static void create()
 SetId(({“rope”, “curtain rope” }));
 SetShort(“a curtain rope”);
 SetLong(“A rope used to open and close the curtain.”);
 SetPull( (: pullRope :) );

int pullRope(object who)
 write(“Trying to ‘Pull Rope’\n”);
 return 1;

There are two very important facts here: on the object you need to have the LIB_DUMMY so that it doesn’t show up in the room inventory, and then all you have to do is have your item call the code alread created: environment(this_player())->pull_rope();



Written by Troy

January 18, 2010 at 6:39 am

Posted in Convesions

Tagged with , ,