Trouble compiling with both command preloading and simple media effects (bisquixe) included

Given my recent troubles with image scaling, I thought I might try out bisquixe.

My project wouldn’t compile with it. I got this less than common error:

Error Message

Translating the Source - Failed

The application ran your source text through the Inform 7 compiler, as usual, and it found no problems translating the source. Something must have gone wrong all the same, because the second stage of the process - using the Inform 6 compiler to turn this translated source into a viable story file - turned up errors. This should not happen. The errors are written out on the Console tab, but will only make sense to experienced Inform 6 users (if even to them).

The best option now is probably to reword whatever was last changed and to try again. Subsequent attempts will not be affected by the failure of this one, so there is nothing to be gained by restarting the application or the computer. A failed run should never damage the source text, so your work cannot be lost.

If you are using Inform 6 inclusions, these are the most likely culprits. You might be using these without realising it if you are including an extension which contains Inform 6 inclusions in order to work its magic: so if the problem only seems to occur when a particular extension is in use, then that is probably what is at fault, and you should contact the extension’s author directly.

If not, then most likely the Inform 7 compiler is at fault. Please check that you have the currently distributed build of the system: if you have, please consider taking the time to fill out a bug report at the Inform bug tracker (Bugs | Inform 7).

Sorry for the inconvenience.

If I understand the console message correctly, the problem starts with VM_ReadKeyboard.

Console Info

C:\Program Files\Inform\Compilers\inform6
-wSDG +include_path=..\Source,.\ auto.inf output.ulx
Inform 6.41 for Win32 (22nd July 2022)
auto.inf(16475): Error: “VM_ReadKeyboard” is a name already in use and may not be used as a routine name (Routine “VM_ReadKeyboard” was defined at line 16130)

[ VM_ReadKeyboard
auto.inf(333): Error: No …Sub action routine found for action: “Wait”
auto.inf(9385): Error: No …Sub action routine found for action: “Inv”
auto.inf(9385): Error: No …Sub action routine found for action: “Take”
auto.inf(9385): Error: No …Sub action routine found for action: “Remove”
auto.inf(9385): Error: No …Sub action routine found for action: “Drop”
auto.inf(9385): Error: No …Sub action routine found for action: “PutOn”
auto.inf(9385): Error: No …Sub action routine found for action: “Insert”
auto.inf(9385): Error: No …Sub action routine found for action: “Eat”
auto.inf(9385): Error: No …Sub action routine found for action: “Go”
auto.inf(9385): Error: No …Sub action routine found for action: “Enter”
auto.inf(9385): Error: No …Sub action routine found for action: “Exit”
auto.inf(9385): Error: No …Sub action routine found for action: “GetOff”
auto.inf(9385): Error: No …Sub action routine found for action: “Look”
auto.inf(9385): Error: No …Sub action routine found for action: “Examine”
auto.inf(9385): Error: No …Sub action routine found for action: “LookUnder”
auto.inf(9385): Error: No …Sub action routine found for action: “Search”
auto.inf(9385): Error: No …Sub action routine found for action: “Consult”
auto.inf(9385): Error: No …Sub action routine found for action: “Lock”
auto.inf(9385): Error: No …Sub action routine found for action: “Unlock”
auto.inf(9385): Error: No …Sub action routine found for action: “SwitchOn”
auto.inf(9385): Error: No …Sub action routine found for action: “SwitchOff”
auto.inf(9385): Error: No …Sub action routine found for action: “Open”
auto.inf(9385): Error: No …Sub action routine found for action: “Close”
auto.inf(9385): Error: No …Sub action routine found for action: “Wear”
auto.inf(9385): Error: No …Sub action routine found for action: “Disrobe”
auto.inf(9385): Error: No …Sub action routine found for action: “Give”
auto.inf(9385): Error: No …Sub action routine found for action: “Show”
auto.inf(9385): Error: No …Sub action routine found for action: “WakeOther”
auto.inf(9385): Error: No …Sub action routine found for action: “ThrowAt”
auto.inf(9385): Error: No …Sub action routine found for action: “Attack”
auto.inf(9385): Error: No …Sub action routine found for action: “Kiss”
auto.inf(9385): Error: No …Sub action routine found for action: “Answer”
auto.inf(9385): Error: No …Sub action routine found for action: “Tell”
auto.inf(9385): Error: No …Sub action routine found for action: “Ask”
auto.inf(9385): Error: No …Sub action routine found for action: “AskFor”
auto.inf(9385): Error: No …Sub action routine found for action: “Touch”
auto.inf(9385): Error: No …Sub action routine found for action: “Wave”
auto.inf(9385): Error: No …Sub action routine found for action: “Pull”
auto.inf(9385): Error: No …Sub action routine found for action: “Push”
auto.inf(9385): Error: No …Sub action routine found for action: “Turn”
auto.inf(9385): Error: No …Sub action routine found for action: “PushDir”
auto.inf(9385): Error: No …Sub action routine found for action: “Squeeze”
auto.inf(9385): Error: No …Sub action routine found for action: “Yes”
auto.inf(9385): Error: No …Sub action routine found for action: “No”
auto.inf(9385): Error: No …Sub action routine found for action: “Burn”
auto.inf(9385): Error: No …Sub action routine found for action: “Wake”
auto.inf(9385): Error: No …Sub action routine found for action: “Think”
auto.inf(9385): Error: No …Sub action routine found for action: “Smell”
auto.inf(9385): Error: No …Sub action routine found for action: “Listen”
auto.inf(9385): Error: No …Sub action routine found for action: “Taste”
auto.inf(9385): Error: No …Sub action routine found for action: “Cut”
auto.inf(9385): Error: No …Sub action routine found for action: “Jump”
auto.inf(9385): Error: No …Sub action routine found for action: “Tie”
auto.inf(9385): Error: No …Sub action routine found for action: “Drink”
auto.inf(9385): Error: No …Sub action routine found for action: “Sorry”
auto.inf(9385): Error: No …Sub action routine found for action: “Swing”
auto.inf(9385): Error: No …Sub action routine found for action: “Rub”
auto.inf(9385): Error: No …Sub action routine found for action: “SetTo”
auto.inf(9385): Error: No …Sub action routine found for action: “WaveHands”
auto.inf(9385): Error: No …Sub action routine found for action: “Buy”
auto.inf(9385): Error: No …Sub action routine found for action: “Climb”
auto.inf(9385): Error: No …Sub action routine found for action: “Sleep”
auto.inf(9385): Error: No …Sub action routine found for action: “Quit”
auto.inf(9385): Error: No …Sub action routine found for action: “Save”
auto.inf(9385): Error: No …Sub action routine found for action: “Restore”
auto.inf(9385): Error: No …Sub action routine found for action: “Restart”
auto.inf(9385): Error: No …Sub action routine found for action: “Verify”
auto.inf(9385): Error: No …Sub action routine found for action: “ScriptOn”
auto.inf(9385): Error: No …Sub action routine found for action: “ScriptOff”
auto.inf(9385): Error: No …Sub action routine found for action: “Version”
auto.inf(9385): Error: No …Sub action routine found for action: “Score”
auto.inf(9385): Error: No …Sub action routine found for action: “LMode3”
auto.inf(9385): Error: No …Sub action routine found for action: “LMode2”
auto.inf(9385): Error: No …Sub action routine found for action: “LMode1”
auto.inf(9385): Error: No …Sub action routine found for action: “NotifyOn”
auto.inf(9385): Error: No …Sub action routine found for action: “NotifyOff”
auto.inf(9385): Error: No …Sub action routine found for action: “Pronouns”
auto.inf(9385): Error: No …Sub action routine found for action: “A_object_analyzing”
auto.inf(9385): Error: No …Sub action routine found for action: “A_all_encompassing_anal”
auto.inf(9385): Error: No …Sub action routine found for action: “A_nounless_analyzing”
auto.inf(9385): Error: No …Sub action routine found for action: “A_test_verb_trying”
auto.inf(9385): Error: No …Sub action routine found for action: “A_changing_the_test_act”
auto.inf(9385): Error: No …Sub action routine found for action: “A_asking_for_help”
auto.inf(9385): Error: No …Sub action routine found for action: “A_resuming”
auto.inf(9385): Error: No …Sub action routine found for action: “A_leaving_story_mode”
auto.inf(9385): Error: No …Sub action routine found for action: “A_frobbing”
auto.inf(9385): Error: No …Sub action routine found for action: “A_canalyzing”
auto.inf(9385): Error: No …Sub action routine found for action: “A_all_encompassing_cana”
auto.inf(9385): Error: No …Sub action routine found for action: “A_gexamining”
auto.inf(9385): Error: No …Sub action routine found for action: “A_cchecking”
auto.inf(9385): Error: No …Sub action routine found for action: “A_hiding_the_status_lin”
auto.inf(9385): Error: No …Sub action routine found for action: “A_revealing_the_status_”
auto.inf(9385): Error: No …Sub action routine found for action: “A_failing_to_act_on”
auto.inf(9385): Error: No …Sub action routine found for action: “A_looking_toward”
auto.inf(9385): Error: No …Sub action routine found for action: “A_failing_to_look_in_th”
auto.inf(9385): Error: No …Sub action routine found for action: “A_failing_to_see_from_t”
auto.inf(9385): Error: No …Sub action routine found for action: “A_failing_to_look_back”
auto.inf(9385): Error: No …Sub action routine found for action: “A_meowing_at”
auto.inf(9385): Error: No …Sub action routine found for action: “A_scratching”
auto.inf(9385): Fatal error: Too many errors: giving up

Compiler finished with code 1

Unless I’ve missed one, the two extensions that I’m using that mention VM_ReadKeyboard are
Simple Multimedia Effects by Mathbrush and Command Preloading by Daniel Stelzer.

It could be something else! But the project compiles ok with only one or the other.

My guess is that this is not a common combination, and I don’t need a fix to finish my project. I just thought I’d bring it up.

Ah, yep, that would do it. Both of those extensions try to overwrite the default VM_ReadKeyboard with their own versions, and Inform doesn’t know how to reconcile the differences.

Fortunately, those differences aren’t irreconcilable! They touch different parts of the function. So you can combine them into this:

[ VM_ReadKeyboard  a_buffer a_table done ix;
    if (gg_commandstr ~= 0 && gg_command_reading ~= false) {
        done = glk_get_line_stream(gg_commandstr, a_buffer+WORDSIZE,
        	(INPUT_BUFFER_LEN-WORDSIZE)-1);
        if (done == 0) {
            glk_stream_close(gg_commandstr, 0);
            gg_commandstr = 0;
            gg_command_reading = false;
        }
        else {
            ! Trim the trailing newline
            if ((a_buffer+WORDSIZE)->(done-1) == 10) done = done-1;
            a_buffer-->0 = done;
            VM_Style(INPUT_VMSTY);
            glk_put_buffer(a_buffer+WORDSIZE, done);
            VM_Style(NORMAL_VMSTY);
            print "^";
            jump KPContinue;
        }
    }
    done = false;

	! === DRACONIS'S CODE ===
	
	VM_PrintToBuffer(a_buffer, INPUT_BUFFER_LEN-WORDSIZE, TEXT_TY_Say, (+ preloaded input buffer +));
	glk_request_line_event(gg_mainwin, a_buffer+WORDSIZE, INPUT_BUFFER_LEN-WORDSIZE, a_buffer-->0);
	((+ preload-reset +)-->1)();

	! === END OF DRACONIS'S CODE ===
	
    while (~~done) {
        glk_select(gg_event);
        switch (gg_event-->0) {
          5: ! evtype_Arrange
            DrawStatusLine();
          3: ! evtype_LineInput
            if (gg_event-->1 == gg_mainwin) {
                a_buffer-->0 = gg_event-->2;
                done = true;
            }
        }
        ix = HandleGlkEvent(gg_event, 0, a_buffer);
        if (ix == 2) done = true;
        else if (ix == -1) done = false;
    }
    if (gg_commandstr ~= 0 && gg_command_reading == false) {
        glk_put_buffer_stream(gg_commandstr, a_buffer+WORDSIZE, a_buffer-->0);
        glk_put_char_stream(gg_commandstr, 10); ! newline
    }
  .KPContinue;
    VM_Tokenise(a_buffer,a_table);
    ! It's time to close any quote window we've got going.
    if (gg_quotewin) {
        glk_window_close(gg_quotewin, 0);
        gg_quotewin = 0;
    }

	! === MATHBRUSH'S CODE ===

	if ((glk_gestalt(gestalt_LineInputEcho, 0)) && echoed_already == 0) {
		glk_set_style(style_Input);
		for (ix=WORDSIZE: ix<(a_buffer-->0)+WORDSIZE: ix++) print (char) a_buffer->ix;
		style roman;
		print "^";
	}
	echoed_already = 0;

	! === END OF MATHBRUSH'S CODE ===

    if (KIT_CONFIGURATION_BITMAP & ECHO_COMMANDS_TCBIT) {
		print "** ";
		for (ix=WORDSIZE: ix<(a_buffer-->0)+WORDSIZE: ix++) print (char) a_buffer->ix;
		print "^";
	}
];

…unfortunately, the hard part is putting this change in without just confusing Inform further. I don’t actually know a good way to do that short of making a new extension that includes all the code from both.

1 Like

In my extension, all of that code is only used if you’re using Bisquixe’s hyperlinks.

If you’re not using Bisquixe’s hyperlinks, you can ‘turn off’ that code by using an almost-blank extension. Here’s how I did it just now:

I went to ‘create new extension’ and made one called ‘Hacking’. Then I put just this in it:

Hacking by Mathbrush begins here.

Book 1 - Removing links (in place of Book 2 - Links in Simple Multimedia Effects by Mathbrush)

Hacking ends here.

Then I saved it, ‘installed it’, and wrote
‘Include Hacking by mathbrush’.

The only thing this extension does is delete the hyperlinks part of my code (because ‘in place of’ overwrites the whole section and we’re replacing it with a blank section). Takes about 3 minutes.

If you do need both parts, then you can use the same ‘in place of’ trick to blank out my code and then use ‘in place of’ to replace the appropriate part of the other extension.

(if you don’t want to do this yourself, you can download this and put it in the same folder as Simple Multimedia Effects and then put ‘Include Hacking by Mathbrush’ in your code).
Hacking.i7x (150 Bytes)

2 Likes

The trouble with that is that Command Preloading doesn’t break itself down by sections (which is a mistake on my part, honestly); it just consists of the following three lines of I7:

The preloaded input buffer is initially "".
To empty the preloaded input buffer (this is preload-reset): now the preloaded input buffer is "".
To preload the command (T - text): now the preloaded input buffer is T.

Plus the replaced I6 routine.

So probably the best way to do it would be to make a new version of Command Preloading with two volumes, one for use without Simple Multimedia Effects (that works like the current one) and one for use with Simple Multimedia Effects that replaces the appropriate book of your extension.

2 Likes

That would make sense. Although I expect Bisquixe to become irrelevant in the next few years (games made with it now will still work!) as sound support and easier image adding makes it into base Inform/quixe/parchment, so I wouldn’t go through a ton of trouble!

1 Like

Thanks for the discussion and consideration! I’m pretty committed to preloading because it’s part of my story mode extension, which is an accessibility feature. However, I’ve been thinking of revisiting that code, since I’ve learned a lot about Inform in the past couple of years.

Though… I do have something where I might be able to do something different… hm.

Thanks!

1 Like

For anyone finding this in a search:

I tweaked the compatibility hack above for Inform 10.

Hacking.i7x (254 Bytes)

2 Likes