[Inform] ORlib NPC movement

Skip to first unread message

Mark Simmons

Feb 20, 2002, 3:13:39 PM2/20/02
Hi, all,

Thought I share this just in case it's the slightest bit of use to someone
using ORlib for NPCs. It's probably crippling basic and could be improved
(I'm pretty new to Inform coding), but...

Basically, I wanted to place an NPC in a particular room, and for that NPC
to stay there until I arrived, at which point it would automatically start
following me around.

So, this is what I did:

with heartbeat[;

if (Zombie in Crypt && CanPlayerWitness()==false && Zombie hasnt general) {
print "Zombie: ~Excuse me... Would you mind popping down here so I can eat
your brains?~^^";
actor.can_move = false;

if (Zombie in Crypt && CanPlayerWitness()==true && Crypt hasnt general) {
print "Zombie: ~Ooh, dinner! Yum!~^^";
give Zombie general;
give Crypt general;
actor.can_move = true;
actor.follow_object = selfobj;


Obviously, the 'print' statements are a bit irrelevant, but helped in the
initial checking.


Reply all
Reply to author
0 new messages