I’m curious if there’s a way to suppress indications of sounds or images when the interpreter doesn’t support them. For example, if I have a sound file as part of my game but the interpreter doesn’t support sound, the player will see something like “[Sound effect number 4 here.]”
It’s not clear why an author would want this to appear so I’m hoping there’s some way to entirely suppress such messages. Or basically just have some way of graceful degradation where the player isn’t confronted with the underlying mechanics.
I notice images do the same thing. For example, if you play Scroll Thief, you see [IMAGE 1 HERE]. I did go through Chapter 23 in Writing with Inform but I might have missed something. I haven’t looked into extensions yet which is my next stop … but I’m trying to avoid adding extensions for the time being, if possible.
Sheesh. Figured out an answer literally right after I posted this. I’ll provide what I do here for anyone who stumbles on this. I borrow from one of the existing extensions:
To decide whether glk/glulx basic/-- sounds/sound are/is supported:
(- glk_gestalt( gestalt_Sound, 0 ) -).
Then with that, you can do something like this:
When play begins:
display the Figure of Enchanter Logo;
if glk sound is supported:
play the sound of explosion.
These messages are printed in the I6 routines VM_Picture() and VM_SoundEffect(). You need to replace those. (Or do what you wrote above, that’s fine.)
Really, the game should display the “alt text” which can be provided in the blorb file. (See chapter 23.9.) However, there’s currently no way for the game code to access those strings.
These commands and others are built into Emily Shorts “Glulx Entry Points”.
If glulx sound is supported: [...]
If glulx graphics is supported: [...]
inform7.com/extensions/Emily%20S … index.html