Problem with Patroller by Michael Callaghan

I’m trying to make a Patroller using this extension, and I set him to be Aimless (which means he wanders about at random), but I keep getting this error message.

*** Run-time problem P60: Attempt to set a variable to the wrong kind of object: you wrote ‘now Way is the best route from the CurrentRoom to the NextRoom, using even locked doors’, which sets the value to nothing - but that doesn’t have the kind ‘direction’.

Does anyone have any suggestions?

Peter

BTW, I’m new at this. I’ve been working on my first game for about three days. You guys have been very helpful, so thank you.

Is the patroller in a room with no exits?

Wow, Groundhog Day! I am trapped into reliving the same intfiction.org posts again and again… :astonished: :wink:

Just joking, but coincidence has it that I answered this exact same question a couple of days ago: [url]https://intfiction.org/t/i7-with-patrollers-extension-v10-by-michael-callaghan/2337/1]. There is what I would consider a small bug in the Patroller extension, and I indicate in that topic how you can solve it.

Victor,

Thank you very much, sorry about the double post. Your fix seemed to do the trick. That particular run time error is gone. Now I get this one instead:

*** Run-time problem P60: Attempt to set a variable to the wrong kind of object: you wrote ‘now NextRoom is the Target’, which sets the value to nothing - but that doesn’t have the kind ‘room’.

I tried to adapt your fix from the first error by saying, “if the Target is a room;” but that didn’t work and I’m stuck again.

I gotta fix this though.

Peter

Weird, I’d say at first sight that that should fix it. Perhaps it is easier to just circumvent these problems by making sure that all patrollers are always in rooms connected to the rest of the map? The reason that things are going wrong is that there sometimes is no way from the patroller’s location to wherever it should go; and the extension has been written with the assumption that there is always such a way. If you make sure all patrollers in your game are placed in rooms that connect to all other rooms, the problems should disappear. Could you try that?

My rooms are connected!

Actually, it did fix the run time error, sorry. But now the patroller seems to only want to go north, always, even if nothing is north. When he’s in the northernmost room, he just stays put, even if there are exits s, e or w… At least when I was getting run time errors, the patroller was moving as he should.

I’m lost.

Peter

Could you post the part of your code which defines this patroller?

Another user e-mailed me about this issue a few days ago and a fix is in the works. I should be in a position to mail it to the extension keepers in the next couple of days.

Michael

Thank you Micheal! (Callaghan, I presume?)

I will check back later for an update. In the meantime, I’ll ignore the problem and keep building my game.

Peter