So, I have a cat in my game. We’ll call him Garfield.
I want him to wander from room to room in the current region, but I don’t want him to open any doors.
I thought I had this worked out, but he’s still opening doors, which is pretty silly. I mean, I guess some cats can do that…but I really don’t want this one to!
Here’s a simplified version of what I’m attempting:
"Test" by "Frotzing" Include Basic Screen Effects by Emily Short. Include Locksmith by Emily Short. Include Menus by Emily Short. Include Glulx Text Effects by Emily Short. Include Variable Time Control by Eric Eve. Include Basic Help Menu by Emily Short. Use American Dialect. Use scoring. Include Rideable Vehicles by Graham Nelson. Include Complex Listing by Emily Short. Blue room is a room. The plastic door is a door. The plastic door is east of Blue Room and west of Red Room. The wooden door is a door. The wooden door is south of Blue Room and north of Green Room. The golden door is a door. The golden door is east of Green Room and west of White Room. The black door is a door. The black door is north of White Room and south of Red Room. Garfield is a male animal. Garfield is in Red Room. Colors is a region. Blue Room and Red Room and Green Room and White Room are in Colors. CatTraveling is a scene. CatTraveling begins when Garfield is visible for the first time. Every turn during CatTraveling: if Garfield is in a room (called the current space) and the player is not carrying Garfield and a random chance of 1 in 3 succeeds: let current region be the map region of the current space; let next space be a random room which is in the current region; let the way be the best route from the current space to the next space, using doors; if the next space is not the current space and each door in the way is open: try Garfield going the way;
Here’s a Transcript:
An Interactive Fiction by Frotzing
Release 1 / Serial number 200416 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD
You can see a wooden door and a plastic door here.
(first opening the plastic door)
You can see a black door, a plastic door and Garfield here.
Garfield opens the black door.
Garfield goes south.
>close plastic door
You close the plastic door.
Garfield arrives from the south.
Garfield opens the plastic door.
Garfield goes west.
I need Garfield to not attempt to go through closed doors. I thought “and each door in the way is open” would prevent that, but no dice.
I tried nixing the “using doors” part, but that caused the program to say “You’ll have to say which compass direction to go in. I didn’t understand that instruction.” when Garfield tries moving. So that won’t work.
Any help would be appreciated!