Author Topic: Drink code & error  (Read 2319 times)

vakuta

  • Guest
Drink code & error
« 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


Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Drink code & error
« Reply #1 on: September 21, 2006, 08:24:20 am »

SetStrength("5");



 



should be



 



SetStrength(5);



Offline capo

  • Friend
  • **
  • Posts: 70
    • View Profile
Drink code & error
« Reply #2 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.