Cutting the forced VERSION command out of transcript-on process

As you probably know, when you type TRANSCRIPT, the game runs the version command automatically at the head of the transcript. I’m creating a particular beta build where this is confusing for testers unfamiliar to IF and just pushes crucial-at-that-moment info off the screen. So I want to kill the VERSION dump at this point.

I don’t have genuine I6 skills, only hacky ones. My attempt to hack was to knock the line ‘VersionSub()’ out of SWITCH_TRANSCRIPT_ON_R in Glulx.i6t. Either this is outright wrong, or I’m implementing it wrong, or both. Here’s what I put in my I7 project:

Summary
Include (-

[ SWITCH_TRANSCRIPT_ON_R;
	if (actor ~= player) rfalse;
	if (gg_scriptstr ~= 0) return GL__M(##ScriptOn, 1);
	if (gg_scriptfref == 0) {
		gg_scriptfref = glk_fileref_create_by_prompt($102, $05, GG_SCRIPTFREF_ROCK);
		if (gg_scriptfref == 0) jump S1Failed;
	}
	! stream_open_file
	gg_scriptstr = glk_stream_open_file(gg_scriptfref, $05, GG_SCRIPTSTR_ROCK);
	if (gg_scriptstr == 0) jump S1Failed;
	glk_window_set_echo_stream(gg_mainwin, gg_scriptstr);
	GL__M(##ScriptOn, 2);
	.S1Failed;
	GL__M(##ScriptOn, 3);
];

-) instead of "Switch Transcript On Rule" in "Glulx.i6t".

In a vanilla I7 project, this doesn’t compile. Error is: "No such constant as “GL__M”

-Wade

It looks like you’re trying to use some code that had been written for 6G60 or previous in one of 6L02, 6L38, 6M62. If it’s 6M62, this should do it (it’s untested, but it was created with 6M62’s Glulx.i6t)… (Possibly works in the 6L’s, I didn’t check whether this function changed between versions.)

Include (-

[ SWITCH_TRANSCRIPT_ON_R;
        if (actor ~= player) rfalse;
        if (gg_scriptstr ~= 0) { SWITCH_TRANSCRIPT_ON_RM('A'); new_line; rtrue; }
        if (gg_scriptfref == 0) {
                gg_scriptfref = glk_fileref_create_by_prompt($102, $05, GG_SCRIPTFREF_ROCK);
                if (gg_scriptfref == 0) jump S1Failed;
        }
        ! stream_open_file
        gg_scriptstr = glk_stream_open_file(gg_scriptfref, $05, GG_SCRIPTSTR_ROCK);
        if (gg_scriptstr == 0) jump S1Failed;
        glk_window_set_echo_stream(gg_mainwin, gg_scriptstr);
        SWITCH_TRANSCRIPT_ON_RM('B'); new_line;
        !VersionSub();
        return;
        .S1Failed;
        SWITCH_TRANSCRIPT_ON_RM('C'); new_line;
];
-) instead of "Switch Transcript On Rule" in "Glulx.i6t".

Urgh, yes, thanks for making me realising this. I must have pulled out the I6 template years ago, but have been referring to its contents ever since. I need to get a new template, plus check I haven’t created weird errors in my 6M62 project by hacking code from an old template.

Your code works! Though it just says ‘starting a transcript of’… and then nothing. Which is sort of amusing. Any chance we can drop the project title in?

-Wade

Its absence looks like a small bug in I7.

And I noticed it’s easy to have our cake and eat it too, so this one writes the version info only to the transcript file, not the screen.

The switch the story transcript on rule response (B) is "Start of a transcript of [story title]."

Include (-
[ SWITCH_TRANSCRIPT_ON_R output_stream;
        if (actor ~= player) rfalse;
        if (gg_scriptstr ~= 0) { SWITCH_TRANSCRIPT_ON_RM('A'); new_line; rtrue; }
        if (gg_scriptfref == 0) {
                gg_scriptfref = glk_fileref_create_by_prompt($102, $05, GG_SCRIPTFREF_ROCK);
                if (gg_scriptfref == 0) jump S1Failed;
        }
        ! stream_open_file
        gg_scriptstr = glk_stream_open_file(gg_scriptfref, $05, GG_SCRIPTSTR_ROCK);
        if (gg_scriptstr == 0) jump S1Failed;
        output_stream = glk_stream_get_current();
        glk_stream_set_current(gg_scriptstr);
        VersionSub();
        glk_stream_set_current(output_stream);
        glk_window_set_echo_stream(gg_mainwin, gg_scriptstr);
        SWITCH_TRANSCRIPT_ON_RM('B'); new_line;
        return;
        .S1Failed;
        SWITCH_TRANSCRIPT_ON_RM('C'); new_line;
];
-) instead of "Switch Transcript On Rule" in "Glulx.i6t".
2 Likes

Wonderful, thanks!

-Wade

Agree with Zed: having a VERSION at the top of the transcript helps in sorting out ßtesting reports (hint: head(1) :wink: ), so, IS a bug, so perhaps ought to be reported…

Best regards from Italy,
dott. Piergiorgio.