[Inform] ORlib NPC movement

0 views
Skip to first unread message

Mark Simmons

unread,
Feb 20, 2002, 3:13:39 PM2/20/02
to
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.

Mark

Reply all
Reply to author
Forward
0 new messages