As mentioned here, there are a few problems with old Inform 6 code segments within Glulx extensions (e.g. when using library messages or calls to the ProcessRulebook). This is my attempt to provide both a list with replacement lines as a quick reference when fixing Inform 6 code as well as a short manual how to find these replacements within the I6 template, if you, like me, didn’t have much to do with it until this point. Any additions or corrections are more than welcome. I’ll try to add more to the list as I go.
List of current replacement lines (old line -> new line)
[spoiler]BlkFree(text_of_command); -> BlkValueFree(text_of_command);
BlkFree(saved_command); -> BlkValueFree(saved_command);
return GL__M(##ScriptOn, 1); -> { SWITCH_TRANSCRIPT_ON_RM(‘A’); new_line; rtrue; }
GL__M(##ScriptOn, 3); -> SWITCH_TRANSCRIPT_ON_RM(‘C’); new_line;
GL__M(##Restart, 1); -> RESTART_THE_GAME_RM(‘A’);
GL__M(##Restart, 2); -> RESTART_THE_GAME_RM(‘B’);
INDEXED_TEXT_TY_Cast(players_command, SNIPPET_TY, saved_command); -> BlkValueCast(saved_command, SNIPPET_TY, players_command);
INDEXED_TEXT_TY_Create(); -> BlkValueCreate(TEXT_TY);
INDEXED_TEXT_TY_Cast(parsed_number, TEXT_TY, text_of_command); -> BlkValueCopy(text_of_command, parsed_number);
L__M(##Quit, 1); -> YES_OR_NO_QUESTION_INTERNAL_RM(‘A’);
L__M(##Miscellany, 74, actor); -> ACTION_PROCESSING_INTERNAL_RM(‘A’, actor); new_line;
L__M(##Miscellany, 72, actor); -> {REQUESTED_ACTIONS_REQUIRE_RM(‘A’, actor); new_line;}
L__M(##Miscellany, 69, obj); -> { STANDARD_IMPLICIT_TAKING_RM(‘A’, obj); }
L__M(##Miscellany, 68, obj); -> STANDARD_IMPLICIT_TAKING_RM(‘B’, obj, actor);
return L__M(##Miscellany, 67); -> BASIC_ACCESSIBILITY_RM(‘A’); new_line;RulebookFails(); reason_the_action_failed = BASIC_ACCESSIBILITY_R; rtrue;
return L__M(##Miscellany, 66); -> { ACTION_PROCESSING_INTERNAL_RM(‘I’); new_line; } rtrue;
return L__M(##Miscellany, 65); -> { ACTION_PROCESSING_INTERNAL_RM(‘H’); new_line; } rtrue;
return L__M(##Miscellany, 64); -> { ACTION_PROCESSING_INTERNAL_RM(‘G’); new_line; } rtrue;
return L__M(##Miscellany, 63); -> { ACTION_PROCESSING_INTERNAL_RM(‘F’); new_line; } rtrue;
return L__M(##Miscellany, 62); -> { ACTION_PROCESSING_INTERNAL_RM(‘C’); new_line; } rtrue;
return L__M(##Miscellany, 61); -> { ACTION_PROCESSING_INTERNAL_RM(‘B’); new_line; } rtrue;
return L__M(##Miscellany, 60); -> { ACTION_PROCESSING_INTERNAL_RM(‘E’); new_line; } rtrue;
return L__M(##Miscellany, 59); -> { ACTION_PROCESSING_INTERNAL_RM(‘D’); new_line; } rtrue;
L__M(##Miscellany, 58); -> {CARRY_OUT_REQUESTED_ACTIONS_RM(‘A’, actor); new_line; }
L__M(##Miscellany, 17); -> {BASIC_VISIBILITY_RM(‘A’); new_line;}
ProcessRulebook(SETTING_ACTION_VARIABLES_RB); -> FollowRulebook(SETTING_ACTION_VARIABLES_RB);
ProcessRulebook(ACTION_PROCESSING_RB); -> FollowRulebook(ACTION_PROCESSING_RB);
ProcessRulebook(VISIBLE_RB) -> FollowRulebook(VISIBLE_RB)
ProcessRulebook(PERSUADE_RB); -> FollowRulebook(PERSUADE_RB);
ProcessRulebook(UNSUCCESSFUL_ATTEMPT_RB) -> FollowRulebook(UNSUCCESSFUL_ATTEMPT_RB)
ProcessRulebook(SPECIFIC_ACTION_PROCESSING_RB, 0, true); -> FollowRulebook(SPECIFIC_ACTION_PROCESSING_RB, 0, true);
Complete code segments:
BeginActivity(IMPLICITLY_TAKING_ACT, noun);
if (ForActivity(IMPLICITLY_TAKING_ACT, noun)==false)
ImplicitTake(noun);
EndActivity(IMPLICITLY_TAKING_ACT, noun);
-> CarryOutActivity(IMPLICITLY_TAKING_ACT, noun);
BeginActivity(IMPLICITLY_TAKING_ACT, second);
if (ForActivity(IMPLICITLY_TAKING_ACT, second)==false)
ImplicitTake(second);
EndActivity(IMPLICITLY_TAKING_ACT, second);
-> CarryOutActivity(IMPLICITLY_TAKING_ACT, second);[/spoiler]
How to find replacements within the I6 template
First, you’ll need the old .i6t files for comparison. You can find them here under I6 template (be warned though that those seem to be quiet old. Even by 6G60 standard. So there might be some deviations when compared to newer extensions). The files within the archive can be found under ‘i6template->Tangled’.
The current .i6t files can be found in your Inform 7 folder (just follow the path of your Inform 7 shortcut) under ‘Inform7->Extensions->Reserved’
EDIT: As since version 6L38, the files are now found under ‘Inform 7->Internal->I6T’
Now, whenever your game compiles successfully but throws the error message ‘Translating the Source - Failed’ click on the ‘Console’ button in the upper right corner. If the bottom of the window reads ‘Compiler finished with code 1’, then you’re dealing with an Infomr 6 problem. The error message for the actual Inform 6 code should be fairly close to the bottom as well and should read like something like this: ‘auto.inf(3014): Error: No such constant as “GL__M”’.
Switch to the extension which includes the “constant” and look if there are any parameters used (e.g. ‘GL__M(##ScriptOn, 3)’). Also keep a lookout for two more things: the method name (usually the first thing that follows the open square bracket) and if the included code replaces segments within a .i6t file directly (can be seen at the end of an include segment. Example: ‘-) instead of “Switch Transcript On Rule” in “Glulx.i6t”’). The latter points directly to a file where you might want to look it up. The first may not point to a file directly, but may give the needed hint where within a .i6t file you want to look. Although it should be mentioned that this isn’t necessarily the case.