I’m attempting to assign methods by class to generalize behavior across the game. However, I can’t seem to find how to do that without using actions, which feels like a pretty unnecessary step. When I try to create an object- or class-specific method, like so:
[ Initialise;
location = Home;
];
!------------------------------------------------------------------------------!
Object Home "Home Sweet Home"
with description "You're in your home!",
has light;
Object -> Rock "rock"
with name 'rock' 'stone' 'pebble',
description "Just a rock.",
after [;
Drop:
crack();
],
crack [;
self.description = "It's turned into a diamond!";
];
…then it yields the following error in Gargoyle:
Home Sweet Home
You’re in your home!
You can see a rock here.
> get rock
Taken.
> drop it
fatal error: illegal opcode (pc = 0x14d)
I’m pretty sure I’m doing something very wrong here, but I can’t see what.