[I7] Coding my cat

Hello, I’m relatively new to writing IF, and to inform, and well, everything that is not zork. I’m working on a small game for my wife for our anniversary (not for about a year, so I’ve got time to work on it) but I’m struggling with how I might implement… our cat (well, one of them).

I borrowed some code from the manual to make them wander around for awhile (like Artemis in the examples), but I would like to have this particular cat… well, barf on the carpet. It’s not a particularly endearing habit of his, but it’s become a bit of a joke between my wife and I, so she would really laugh if she experienced the joy that is cat barf in the game as well.

I tried:

Every turn: If a random chance of 1 in 25 succeeds: now the location of the barf is the location of umlaut [he's the cat]; continue the action.

But I can’t seem to get past the fact that Inform really doesn’t want to do that. (various changes in the word order change the error message, but it’s all basically saying that it doesn’t like the syntax for my “now” phrase.). I do have a “the barf is an item that is in cat-limbo” statement earlier on, so the barf exists, I just want it moved into play. (actually, I’m trying to create a mechanic where there can be up to say 15 barfs in play at any time, and when she cleans one up, it goes back to the queue to be redistributed.

Does anyone have any thoughts? I’d appreciate some help :smiley:

Try “now the barf is in the location of umlaut”.

You can’t change “the location of the barf” directly – that’s something Inform figures out by looking where the barf is. Compare “now the temperature plus 2 is 3” – we know that means the temperature has to be 1, but Inform would rather have us tell it that the temperature is 1.

You can also use this.

move the barf to the location of umlaut;

Hope this helps.

Hey, thanks!

It did help… Until I broke it again. :confused:

This is what I’ve got (in total) for Umlaut:

[code]Umlaut is a male cat. The description of Umlaut is “[if strange]Formerly wee-and-spotty, now he’s just spotty. For some strange reason he thinks that he’s a labrador retriever, most of the time.[else]Good old Umlaut. While a lot of trouble, he is so gentle with the kids. If only he’d stop telling you every time he was about to vomit.[end if]”

After examining strange Umlaut, now Umlaut is friendly. Understand “Merf” as Umlaut. Understand “Meef” as Umlaut.

Umlaut is in the Master Bedroom.

Every turn:
if Umlaut is in a room (called the current space):
let next space be a random room which is adjacent to the current space;
if Umlaut is visible, say “Umlaut heads to [the next space]”;
move Umlaut to next space;
if Umlaut is visible, say “Umlaut arrives from [the current space].”;

Every turn:
if the number of cat vomits in Merfy Limbo is greater than zero:
if a random chance of 1 in 25 succeeds:
move one cat vomit from Merfy Limbo to the location of Umlaut;
if Umlaut is visible:
say “Oh wonderful. Umlaut has just yakked on the floor in front of you.”
say “You hear the sound of Umlaut yakking in the distance.”


and inform tells me:

So you can see that I borrowed from the “red pens” example - and created a room to store all my cat barf, and what I want to do is move one - from the room - into the current location of umlaut… but only until the room is empty. I’m going to add an action later for cleaning up the barf which puts it back into Merfy Limbo. Which more or less represents the whole of what my cat is like, haha.

Are there any thoughts on what I could do here?

“from Merfy Limbo” isn’t being recognized as what you want. I think you can try “move a random cat vomit that is in Merfy Limbo to the location of umlaut”, though the syntax for these can sometimes be a bit fussy.

(If you don’t include “random” then Inform will complain that you haven’t specified your object specifically enough – “random” gives it a way to pick one, even if the choice doesn’t actually matter.)

Awesome! That worked!

Thank you so much! I’m really liking working in inform, but I’m thinking that my skill level hasn’t quite caught up with the difficulty of all the things I want to do :slight_smile: Time will tell!