Vorple Multimedia by Juhana Leinonen

This topic is for discussions related to Vorple Multimedia by Juhana Leinonen

Juhana;

To include a piece of music, one uses a phrase like:
Release along with a file of “Theme” called “El Carretero.mp3”.

Can one use “Theme” in the play music or play sound statements?
If so, what exactly is the syntax?

For playing the sounds you have to use the filename.

play music file "El Carretero.mp3";

Or, if you want the music to loop,

play music file "El Carretero.mp3", looping;

Hi Juhana,
I’m just getting started with Inform 7 and have a couple of questions for you:

  1. I read in the Inform 7 documentation that playback of audio files is not supported in macOS. Is that still true, even with Vorple Multimedia?
  2. I see that VM supports GIFs. Does it support animated GIFs? If it did, that would be a great way to play a short, repeating video clip in the game, like a levitating sword slowly rotating in the air, or something like that.
    Thanks, and thanks also for creating the Vorple extensions!
    Scott

Normal VM limitations don’t apply, because everything is shown and played using the web browser directly. So audio files and animated gifs are ok.

The only caveat is that most browsers don’t allow audio autoplay, so sounds and music can be played only after the player has typed their first command or clicked something on the page.

2 Likes

Thanks Juhana. I have another question. Does VM support 360 degree image viewing? I’m imagining describing a room in IF7 but then also displaying a 360 image of the room that the user can use to actually look around the room, or more closely examine an object, or look behind something to discover something else, etc. I sometimes think that object and room descriptions in IF can tend to give away too much of a clue. For example, “Upon looking around the room, you notice a logo of a swan above the door.” That makes it pretty obvious that the image of the swan is significant and likely a clue that will come in handy later. If instead, the user were to get a 360 degree view of the room, whether they notice the swan over the door or not is really up to how observant they are, as opposed to whether they recognize the repeating pattern of textual descriptions of objects and rooms often containing clues. If VM doesn’t currently support 360 degree images, are you considering adding support later? (Please say yes! :laughing:)
Thanks again,
Scott

1 Like

There is no separate VM, so you can use any Javascript solution that works on the browser. I would imagine that there are 360-degree picture Javascript libraries available, although I’ve never used one. If you include one of them on the same page where the game runs you can trigger it from Inform code.

1 Like

Thanks, Juhana, I’ll look into that further.

Firstly, Vorple is phenomenal; building Inform 7 in tandem with it has been incredibly fun and straightforward. Thanks a ton for it! :slight_smile:

In Inform 7, I’m running into a situation where an .mp3 will play for a given action, but not an action that involves placing something in a container.

The context is that someone discovers a boulder in a meadow; on that boulder is a worn out bowl-shaped mortar for grinding nuts. There’s also a pestle nearby that can be picked up. If the player simply drops the pestle, they’ll hear the sound of it hitting grass; if the players tries to drop the pestle into the mortar (defined as a container), they should hear the sound of it hitting stone.

Here’s the code:

After dropping pestle:
play the sound effect "pestledropgrass.mp3";

After dropping pestle in mortar:
play the sound effect "pestledropmortar.mp3";

Now, the first part of the code works just fine; it plays “pestledropgrass.mp3” when you do: drop pestle

However, when you type “drop pestle in mortar”, nothing plays and you get the generic message: “You put the pestle into the mortar.”

I’ve tried multiple ways to rephrase this action, but without success; the best I can do is something like “After dropping pestle when the player is on the boulder:”, which will allow the sound to play.

Given that I get the generic “You put x into y.” message, I’m thinking that the built-in dropping action is not respecting my code for some reason I can’t decipher. Is there something about dropping items into a container that I should redefine? (Similarly, “put” or “place” doesn’t give me any desired results either.)

(While I can navigate my way through complex Inform 7 code, I still consider myself very much of a novice in the ways one goes about creating actions and manipulating the syntax. I am convinced there’s a simple solution to this that is evading me!)

Thanks!

When you drop something into a container the action is “inserting into” so this should work:

After inserting the pestle into the mortar:
  ...

The easiest way to find the correct action for a command is to use the ACTIONS debugging command while playing the game:

>actions
Actions listing on.

>drop pestle in mortar
[inserting the pestle into the mortar]
You put the pestle into the mortar.
[inserting the pestle into the mortar - succeeded]

>

1 Like

Another way to figure out what the action is from the command is to go to Index -> Actions -> Commands and find the first word of the command, then the rest of the phrase. This also gives you a link you can click on to see the other forms of the same action as well as the applicable rules.

1 Like

@Juhana @mirality - pardon my super late reply, but both of your responses were exactly what I needed. It hadn’t dawned on me to deploy the Actions debugging command, but I’ve used it quite a bit since then. Cheers!

1 Like

Hello!
I’m “converting” a Glulx game with sound that uses the Music extension by Daniel Stelzer into a browser version that uses Vorple Multimedia. As a general rule every room has a sound attached to it.
I am using this bit of code for that:

A room has some text called the background audio. 
The current room is a room that varies.

After going (this is the play background audio rule):
		play music file background audio of the location, looping;
		continue the action.

When the game launches there is a first page with the banner text, a brief intro, and a y/n question This “page” does not have sound, but helps to trigger the sound in case auto play is disabled.
So far it works as it is playing the sounds, but I’m having some issues:

  • The sounds won’t play on Safari, I have checked that the auto play and play sound is enabled. And I have a first page in which the sounds are not there, and then they should start, but nothing. It does work in Firefox, Chrome, and Edge.

  • The audio won’t stop on restart, not even after the story ends and you decide to restart.

(I need to add that I am using a Mac computer with Big Sur, Inform 7 and everything is up to date.)

I’m happy to expand or clarify any point, or add more bits of the code as I tried to keep it short.

Thanks in advance!