Playing a video in-game gives trouble

Hi all!

There is a part of my game where the player watches a video online.

Video is an object in Bedroom. "The thumbnail is of a cute cat. The PLAY button flashes."

Instead of playing the video:
	say "You press play. The cat purrs. Cute!"

But I get the error

“You wrote ‘Instead of playing the video’, which seems to introduce a rule taking effect only ‘playing the video’. But this does not look like an action, since there is no sign of a participle ending ‘-ing’ (as in ‘taking the brick’, say) - which makes me think I have badly misunderstood what you intended.”

I get this error a lot and I never really understand why. Clearly there is a verb here.

I tried…

  • looking in the index-- the default definition of “play” applies to “one visible thing”, I would think the video is visible?
  • redefining “play” with the "understand ‘play’ as something new’ rule, but that doesn’t get me anywhere. Inform still doesn’t understand ‘play’ in this context

I feel like this is something obvious that I’m just not seeing. Any help would be much appreciated.

Did you make your own “playing” action? I don’t think that’s built in, unless I’ve missed it.

4 Likes

Oh jeez. I thought it was a default action but I might have misread it. I just made one…

Playing is an action applying to one visible thing. Understand "play" as playing. 

Now I get “I only understood you as far as wanting to play.” Hm.

Edit: forgot to say thank you for your reply!

2 Likes

Yeah, unless you’re using an extension that defines it, Inform doesn’t include the action “playing” out of the box. So you just need to define it:

playing is an action applying to one thing.  understand "play [something]" as playing.

You might also want to do this as a carry out or report rule rather than an instead one; overuse of instead rules can create challenges later, so it’s usually best to be judicious about them.

Edit: you need to write the understand statement as “play [something]” if it’s an action applying to one object, since that token (the word in square brackets) tells Inform where to find the object. For an action applying to nothing, you don’t need the token, though).

2 Likes

The “play [something]” tip was super helpful. I had it as just “understand ‘play’ as playing” but adding the [something] made it work in the context of “play the video”.

Also, I’ll make it a carry out rule, that sounds like good practice. Thanks so much!

1 Like

As a last tip, I’d make a play button and add (taking Mike’s ‘carry out’ suggestion)

instead of pushing the play button:
	try playing the video.

someone’s bound to try that. Good luck!

2 Likes

Thanks very much!!

1 Like

One of the ways I check is to play the game in the IDE, type ACTIONS and then try my action in several different ways. With actions turned on, the parser will notify you if there’s a synonym.

Instead of creating a new action PLAY [SOMETHING] you could make play a synonym for “push” - that way you round up someone trying PUSH THUMBNAIL.

"Kyute Klip"

Laboratory is a room.

A video is in Laboratory. "There's a thumbnail icon of a cute cat on the screen. It looks like a video."

Video can be pushable. Video is pushable.
Understand "thumbnail/icon/cute/cat" as video.

Understand "play [something]" as pushing.

After pushing video:
    say "You press play. The cat purrs. Cute!"

Laboratory

There’s a thumbnail icon of a cute cat on the screen. It looks like a video.

actions

Actions listing on.

touch icon

[touching the video]

You feel nothing unexpected.

[touching the video - succeeded]

After touching video:
	try pushing the noun.

Laboratory

There’s a thumbnail icon of a cute cat on the screen. It looks like a video.

touch icon

You press play. The cat purrs. Cute!

2 Likes