LPMuds.net

Lib Discussion => Dead Souls Support => Topic started by: vakuta on September 21, 2006, 08:23:04 am

Title: Drink code & error
Post by: vakuta on September 21, 2006, 08:23:04 am

Here is the error message and code for the drink file.  Code first:





#include <lib.h>

#include <meal_types.h>



inherit LIB_MEAL;



static void create() {

    meal::create();

    SetShort("a glass of water");

    SetLong("This tall, clear glass contains pure water.");

    SetMealType(MEAL_DRINK);

    SetStrength("5");

    SetId("glass","water");

    SetKeyName("glass");

    SetMass(3);

    SetMealMessages("You drink the water.  It's very good.", "$N drinks $P glass of water.");

    SetEmptyName("glass");

    SetEmptyShort("an empty glass");

    SetEmptyLong("This empty glass looks as though it used to contain water.");


   



}





void init() {

  ::init();

}



 



 



Ok, so it updates and clones fine, but when I try to drink it:



 



---

*Bad argument 2 to >

Expected: string Got: 100.

Object: /secure/save/creators/z/zaroth (/lib/race.c) at line 48



'<function>' at /secure/save/creators/z/zaroth (<function>) at /:0

'cmdAll' at /secure/save/creators/z/zaroth (/lib/command.c) at line 72

'direct_drink_obj' at /realms/zaroth/water#115 (/lib/meal.c) at line 39

'CanDrink' at /secure/save/creators/z/zaroth (/lib/race.c) at line 48

Trace written to /log/runtime

Title: Drink code & error
Post by: cratylus on September 21, 2006, 08:24:20 am

SetStrength("5");



 



should be



 



SetStrength(5);


-Crat

http://dead-souls.net

Title: Drink code & error
Post by: capo on September 21, 2006, 08:45:23 am

SetMealMessages("You drink the water. It's very good.", "$N drinks $P glass of water.");



not sure this is going to work out the way you want it to.