Dumb Guy looking to New Game / Continue ( / Bonus ? )

I tried “instead of starting the game for the first time, end the game saying” but that was…

let’s not even talk about it.

the intro is kinda huge so it’d be cool if before any of that the player had the chance to restore a saved game.

Anyone got a bit of code to help a brudda out?

If you help me, I promise I won’t say brudda again.

Brudda.

Here’s my code from HL, adapted to 6L38.

This is tied to a yes-or-no question, which is actually a yes-or-no-or-RESTORE question. You might ask “Do you want to skip the intro?”

When play begins:
	say "Here's a question> ";
	if player consents-or-restores:
		say "You answered 'yes'!";
	else:
		say "You answered 'no'!";

To decide whether player consents-or-restores: (- YesOrNo(true) -).

Include (-
[ YesOrNo canrestore    i j;
    for (::) {
        #Ifdef TARGET_ZCODE;
        if (location == nothing || parent(player) == nothing) read buffer parse;
        else read buffer parse DrawStatusLine;
        j = parse->1;
        #Ifnot; ! TARGET_GLULX;
        if (location ~= nothing && parent(player) ~= nothing) DrawStatusLine();
        KeyboardPrimitive(buffer, parse);
        j = parse-->0;
        #Endif; ! TARGET_
        if (j) { ! at least one word entered
            i = parse-->1;
            if (i == YES1__WD or YES2__WD or YES3__WD) rtrue;
            if (i == NO1__WD or NO2__WD or NO3__WD) rfalse;
            if (canrestore && i == RESTORE__WD) {
            	RESTORE_THE_GAME_R();
            	! If it failed, we've printed a message; skip the "please enter yes or no" line.
            	print ">> ";
            	continue;
            }
        }
        YES_OR_NO_QUESTION_INTERNAL_RM('A'); print "> ";
    }
];

[ YES_OR_NO_QUESTION_INTERNAL_R; ];

-) instead of "Yes/No Questions" in "Parser.i6t".

I have no idea what that does but it does run but doesn’t do anything… o.o and it doesn’t get in the way of anything and it then just … does things. like run the rest of the story.
maybe i did’ed it wrong.

It does nothing in the Mac IDE because that doesn’t implement “restore”. (I dunno why not.) Test it in a real interpreter.

…sorry, I don’t know why I said that. It actually works fine in the Mac IDE. (Just tested.)

Does Frotz count?

Because it did nothing in Frotz. :c

You’re using Z-code? I tested it in Frotz, that worked too.

You’re using 6L38, right?

yup. o_o doesn’t nothing.

EDIT: it started doing something:

'NOTHER EDIT:
now it’s constantly going “please answer yes or no” even though i’m in the room. o.o dammit dammit dammit kicks the chair

MORE EDIT:
If i type “YES” it goes > and does nothing until i tick it off and get to answer NO again.
If i type “NO” it continues the game but these interruptions are often and very messy. :frowning:

That’s weird. Can someone else try this?

i’m gonna ask the stupidest thing all month and say:

Aint there a “restore a saved game;” line in there? or “start a new game;” something something thing-a-ma-bob?

I’m afraid that did nothing for me either.

…and, er, isn’t this simpler? (granted, without the flexibity of having RESTORE as a possibility)

When play begins: say "Restore a saved game (Y/N)?[run paragraph on] "; if player consents: try restoring the game; else: say "Welcome, then!";

I’ve seen quite a few games ask both questions, tell you the truth. First they ask, do you want to restore? Then they ask, do you want to see the intro? This is usually good enough.

…actually, it’d be even easier to use a Title Page extension.

EDIT - I adapted Identity Theft (an Inform example). I think this’ll do what you want.

[code]Place is a room.

Instead of looking when intro: do nothing.

Rule for printing the banner text when intro: do nothing.

Rule for constructing the status line when intro: do nothing.

When play begins:
now the command prompt is "See the intro (Y/N) or restore a saved game? ".

To decide whether intro:
if the command prompt is "See the intro (Y/N) or restore a saved game? ", yes;
no.

After reading a command when intro:
now the command prompt is “>”;
if the player’s command includes “yes/y”:
say “INTRO. There, you’ve seen it.”;
otherwise if the player’s command includes “restore/load”:
try restoring the game;
otherwise if the player’s command includes “no/n”:
say “Ok, then, here’s the game.”;
otherwise:
say “I don’t think that was one of the options, was it? Naughty naughty.”;
now the command prompt is "See the intro (Y/N) or restore a saved game? ";
reject the player’s command;
say line break;
say banner text;
move the player to starting room;
reject the player’s command.

Starting room is a room. “This is where it starts. Exciting, isn’t it.”[/code]

If in doubt, this is what you’ll want to do - find an example that does what you want, sort of, and tweak it until you get what you’re looking for. :slight_smile:

Note I was a bit free with my text-matching. If the player types “Oh yes I most certainly wish to see the intro”, it’ll be treated as a yes. If the player is a smart-ass and types “Yes I do want to restore n all.” it’ll be considered as “yes”, because that’s the first keyword I checked for.

… wait what?
title page extension?

there’s an app for that?

Sure. Just look in the Extensions, and if you haven’t got that one just go to the Public Library (within the I7 IDE). You’ll want “Title Page” by Jon Ingold. The example even shows how to add extra options.

… so weird. i can find it via google inform7.com/extensions/all-extensions/ … did i forget how to internet?

As Peter said, the latest version is in the Public Library, accessible through the I7 IDE. Go to the “Extensions” tab, then select “Public Library”.

is there a way to “LOOK” automatically when loading a game save?
now it just gives an empty lot and it’s pretty sad :frowning:

Try this:

[code]restore the game rule response (B) is “[restore_text]”

To say restore_text:
try looking;
say “[italic type](game successfully restored)[roman type]”.[/code]

This was actually fun, because it wouldn’t work perfectly. It kept adding an extra line break!

The reason I added that “(game successfully restored)” message, and purpusefully did NOT put a period at the end is that it was the only way I found to avoid that extra line break. If I just ended it with “try looking”, no matter what else I did, it would always add the extra space.

EDIT - Erm, I should explain what I did, though, this is not as self-explanatory as the previous code, and you should know about it. I edited the default response from the “restoring a game” mechanism. Instead of saying “Ok.”, it’ll now say “[restore_text]”. This gives me freedom to do, within limits, pretty much whatever I want, because I can define the phrase “[restore_text]” to actually do stuff. Which I did! When I still thought I could make a game I used this method a lot.

I’d never used responses before, I didn’t know whether this subterfuge would work. I was very pleased that it did.