Axe Software Forums
  Quest Developer Forum
  Test for is character in the room


Author Topic:   Test for is character in the room
Jim Trash posted 20-08-2001 03:16 GMT     
Hello, good evening, morning, afternoon, whatever.
Bit of a beginners question here but I've got a character I want to follow the player around. I'm using 'afterturn' to point to a procedure that does movechar and prints a message. Unfortunately everything is a turn and so it prints the message at inapropriate moments.
Can anyone tell me how I can test if the NPC is already in the room afore the rest of the procedure runs ?

Kind regards

Jim

Luridii posted 20-08-2001 09:29 GMT          
Assuming Bob is the NPC

if not is <$locationof(Bob)$; #quest.currentroom#> then do <movechar procedure>

That will run the procedure to move the NPC into the room the player is currently in if the NPC is not currently in it

Computer Whizz posted 20-08-2001 09:31 GMT          
Right....
first off you should change the NPC's to objects and upgrade to quest 3.0.

Now. When you check if something is here (ie. present in the room!) then you say:
if here (#non-playable-char#) then {
blah...
blah...
blah....}
else {
msg <#char# move's around aimlessly>}

quote:
NOTE: You can take out that "else" below if you want the player to do something and nothing to come up!

Any other help you need?
----Actually I'm wondering why MaDbRiT hasn't replied since he's usually here at 7:00!!!

Computer Whizz

Computer Whizz posted 20-08-2001 09:34 GMT          
DAMN YOU LURIDII!!!!

You had to post 2 minute's before me didn't you!?!

My arch-nemisis strikes again!!!

:)

Computer Whizz

Luridii posted 20-08-2001 12:30 GMT          
OMG Thats so funny!

Mwa ha ha :)

Computer Whizz posted 20-08-2001 12:44 GMT          
No need to get nasty!!

When you posted your response to this fellow, why did you decide to use $locationof(blah)$ blah??
I went straight away to "if here (#object#)"
It's much easier to code and it does the same job!

......hhmmmmmm, guess it's just different opinions I guess.

Computer Whizz

Luridii posted 20-08-2001 12:54 GMT          
lol, umm i dunno!
Oh well, they both work :)
MaDbRiT posted 20-08-2001 13:01 GMT          
quote:

----Actually I'm wondering why MaDbRiT hasn't replied since he's usually here at 7:00!!!

Ah - well today I had to start work early, not wait until the streets are aired at 7.00 as I usually do ;-)

( Actually I was out taking photos- beautiful dawn here this morning )

Al

Computer Whizz posted 20-08-2001 13:24 GMT          
Really?
Where about's are you? Mid-lands, Up North, Norfolk Broads-way, C-something-or-rather (where the solar eclipse passed over!)?

Oop's.... it's happening again! We're going off-topic .

Computer Whizz

Jim Trash posted 21-08-2001 01:39 GMT          
Many thanks for the replies.
I was kicking myself only moments after sending the message as I went back to read the ref. manual again and this time the HERE command fair leaped out and thwapped me around the head.

ah well

Thanks everyone