The Thief is a NPC with a little more complicated action pattern than your usual wandering commoner. Here's his daily routine:
- Check the Party's GameScore and subtract it from the maximum GameScore
- If the result is less than 10, it's a 10% chance that the Thief surprisingly appears just behind the back of a random PC
- If the result is bigger the 10 he shows up in one of 45 selected rooms. If there's a door nearby he comes out of it, if not he makes a dramatic appearance from some dark corner.
- When finally in place he decides to take some action. If he sees a PC he
a) Rob him/her of one inventory item and rushes away to leave through the nearest door
b) He picks up whatever item that lays around on the floor and leave the room
c) He steals the PC's light source (he's a sneaky guy) and leaves the PC in the dark :)
d) He just hangs around for a while waiting for the PC to interact with him or just leave him to himself - If the Thief shows up at an empty location with no PC around he picks up whatever item that lays around on the floor and leave the room
- Then it just to start over hoping the PC has gained some more GamePoints so he can sneak up behind him/her more often.
Don't seem to hard does it? Well, at least for me it took a lot of complicated scripting to make sure that it will work in all the situations. Some of the recently solved problems:
- The thief never jumps. He is spawned and destroyed for every move. To ensure he never gets stuck. This of course have some implications on handling the thief's death. How to handle the things he steal (so I don't destroy them) and not spawning more that one thief at a time.
- I have a queue system to handle the synchronizations between the module HeartBeat and the thief's actions and a lot of functions like ThiefLeave(), ThiefRobPC(object oObject), ThiefSpawn(location lLocation) and ThiefRobRoom() the the queue system calls.
- One of the most difficult things to fix was selecting a true random PC to sneak up on. I had to keep track on if the PC is in an area where the thief can go. Then see if the PC had a chance to sneak out from this area before the spawning of the Thief and activation of his actions could happen.
- One function I thought was fun to implement was the different appearances the Thief can take. I have total 5 different looks and names of him that are used. I may come up with some more.
- The Thief isn't hostile by default (hey, why should he? If you're not alive there's no-one to rob to get food for the day.) so the famous sword doesn't glow with it's faint bluish glow. So I had to make some adjustments to make the sword glow anyway.
[edit]
Here's a really nice and very rare poster for the Zork User Group by David Ardito . You can see the Thief in the right-down corner. Enjoy!
Have a nice day!
/Amraphael
3 comments:
Funny how I can recognize more than a few places in the poster now, even if I've never played the game. Guess it shows the quality of your ZORK rendition. ^_~
@Elf des coquillages
One other funny thing is that I found this poster on the Internet yesterday. I haven't seen it before but as you say, one can recognize several places. I suppose it tells us about how strong the written word is and that the artist was good at interpreting the game.
Thanks a lot for for kind comment.
Not sure if you're still monitoring comments on this blog or not...
But I'm quite interested in the pic of the Zork poster you have here. Do you have a larger/better scan of the poster? I've been trying to get a copy of that poster for a while now, and would be quite happy to have even just a high quality digital scan of it.
Post a Comment