[HELP] Hybrid Choices repeated room description

Hi everyone,

So I’m using the Hybrid Choices with Inform 7. After an initial CYOA setup at the beginning of the game, where the player is in a room whose printed name is the title (for the banner’s sake), the player is cyoa teleported to the first real room. This room acts like a “menu” so unless the player inputs one of the choices, the room description is printed instead. I need this to be a room and not a CYOA page or an extension-based Menu because I need some other, secret actions to also be available, and the CYOA parser stuff didn’t work for me.

The movement to the Menu room and the every turn rule printing, combined, produces a duplicated text, despite cyoa teleport being a replacement for move ..., without printing a room description (I’ve tried using that code instead too). Can someone help me figure out how to fix this?

Code
Secret Room is a room.
Menu is a room.
abouting is an action out of world. goaling is an action out of world. starting is an action out of world. secreting is an action applying to nothing.
menu-turn is a page.
	a page-toggle rule for menu-turn:
		say "And soon, because there is...[paragraph break]";
		wait for any key;
		say "[banner text]";
		cyoa teleport to Menu;
		wait for any key.
	it is an end-page.
[...]
every turn:
	if the player is in Menu:
			if the current action is not abouting or goaling or starting or looking or secreting:
				try looking instead.
2 Likes

I’m having trouble reproducing the effect you described.

I downloaded version 7 of Hybrid Choices, and had to change 3 of its rule definitions to compile. I then ran this exact code:

"Sandbox" by Brian Rushton

Include Hybrid Choices by AW Freyr.
Include Basic Screen Effects by Emily Short.

Secret Room is a room.
The description of secret room is "I can see everything around here!";

Menu is a room. The description of Menu is "You are in the menu".
abouting is an action out of world. goaling is an action out of world. starting is an action out of world. secreting is an action applying to nothing.

When play begins:
	switch to CYOA at menu-turn;
	
menu-turn is a page.
	a page-toggle rule for menu-turn:
		say "And soon, because there is...[paragraph break]";
		wait for any key;
		say "[banner text]";
		cyoa teleport to Menu;
		wait for any key.
	it is an end-page.

every turn:
	if the player is in Menu:
		if the current action is not abouting or goaling or starting or looking or secreting:
			try looking instead.

The output for me doesn’t print the room descriptions at all, but does print the banner text twice:



And soon, because there is...

Sandbox
An Interactive Fiction by Brian Rushton
Release 1 / Serial number 231229 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD

Sandbox
An Interactive Fiction by Brian Rushton
Release 1 / Serial number 231229 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD

>l
>look
>rules
Rules tracing now switched on. Type "rules off" to switch it off again, or "rules all" to include even rules which do not apply.

>look
[Rule "accept numbers rule" applies.]
[Rule "accept testing commands during CYOA rule" applies.]
[Rule "accept system commands during CYOA rule" applies.]
[Rule "accept items rule" applies.]
[Rule "print cyoa error message rule" applies.]
[Rule "declare everything initially unmentioned rule" applies.]
[Rule "determine visibility ceiling rule" applies.]
[Rule "announce items from multiple object lists rule" applies.]
[Rule "set pronouns from items from multiple object lists rule" applies.]
[Rule "before stage rule" applies.]
[Rule "instead stage rule" applies.]
[Rule "investigate player's awareness before action rule" applies.]
[Rule "player aware of his own actions rule" applies.]
[Rule "check stage rule" applies.]
[Rule "carry out stage rule" applies.]
[Rule "print passage whilst looking in cyoa mode rule" applies.]
[Rule "display all choices rule" applies.]
[Rule "after stage rule" applies.]
[Rule "investigate player's awareness after action rule" applies.]
[Rule "report stage rule" applies.]
[Rule "other people looking rule" applies.]
[Rule "last specific action-processing rule" applies.]
[Rule "A first turn sequence rule" applies.]
[Rule "every turn stage rule" applies.]
[Rule "prevent every turn events rule" applies.]
[Rule "A last turn sequence rule" applies.]
[Rule "notify score changes rule" applies.]
>

So do you have some other code that prints the room description, or am I just using an outdated version of hybrid choices?

I have 7.1 from friends of Inform (it prints the double banner, too)

So… this specific setup is a little confusing. If I had to guess, there’s something about startup that’s creating some interesting behavior. Is that how you’re using this? Startup?

The code I’m seeing doesn’t exit cyoa mode, even though it should. If I add something to make the story exit cyoa mode ("switch from cyoa mode, without looking), I see the double output. Now, there’s a couple of things that could be causing that. I think doing this all at startup changes things slightly. Since CYOA isn’t out of world (I don’t think), I’m not certain what the implications are of getting in and out without actually making a choice. It may assume that it gets a turn all to itself for situations like this.

I added “looking” to the every turn rule (made it a negligible action), since that would also print a room description twice.

Sorry if this isn’t what you’re looking for, I had a hard time visualizing the setup.

I used Brian’s code as a base.

Thank you two for your help! I managed to get it fixed on a test project (removing the irrelevant bits) but it aggravatingly didn’t work in the real thing, even though I copy-pasted the code. Nevertheless, it’s fixed now, using a workaround involving a boolean variable and some conditionals.

1 Like