How do I define a variable as an object? Like, instead of “i is a number variable” I want “obj is an object variable”. Background: I’ve started a fighting system, and I want a variable “attacker” and a variable “defender” which can be one from a number of NPCs, or the player. Thanks!
1 Like
Attacker is a person that varies.
2 Likes
That works.
Obj is an object variable.
When play begins:
now obj is the player;
say "Obj is [obj] now.";
It may be better to use action rulebook variables rather than global variables. But really global variables will work fine for a simple game system.
2 Likes
Thanks, works! I would have tried that, but the documentation had zero hits for “object variable” so that I assumed it must be named somewhat differently.