Discourse-Frotz

Absolutely non-negotiable. It breaks the formatting completely. Just as it would HTML.

Hopefully fixed the bugs, and also added support for the fixed-width text style.

1 Like

I made an issue at https://gitlab.com/DavidGriffith/frotz/-/issues/207 to describe this load-move-print-save enhancement for Dumb Frotz.

1 Like

Iā€™m glad to see solutions to this moving foward. :)

1 Like

Yup, looking good!

Whatā€™s the code tag for?

[color=white][bgcolor=black] West of House Score: 0 Moves: 0 [/bgcolor][/color]

Thanks, responded there. (That should take some of the heat off this Discourse : ) )

The [code] tag is to use the fixed width font. I decided to use this instead of backticks because there is an explicit close tag. Which reminds me I should escape any stray backticks in the text. Any other characters that should be escaped?

1 Like

Great. Letā€™s see how the code tag works.

Thanks for the test story tool.

Is there any particularly highly formatted work of fiction we should test?

Backticks? Not sure. Letā€™s see what comes out of ā€˜real worldā€™ testing.

Probably also * and | may also need escaping, but Iā€™m waiting for your feedback.

Having thought about it a bit more, I expect all characters in []\`*|_#<>=-.+ need escaping, to stop any unwanted markdown and html formatting of the game text.

Hey borg ā€¦ maybe ā€¦ can you give me a particularly egregious example (story with loads) and I will test it out as is?

I noticed the menu of etude completely fails a nice render.

Can you post a screenshot from etude?

1 Like

Do you mean the MORE? This is added when frotz thinks you have reached the end of the page, which of course doesnā€™t make sense in this context. You can start dfrotz with -m to disable this, but I saw a glitch just now that I tried it. An alternative is to use -h 99 (or some other large number) to print more lines in one go.

1 Like

Sorry, I actually have -m on the feature branch.

Running this with the bbcode branch currently produces this:

(You know iā€™m half tempted to set up a standalone Discourse instance for us to test this)

The period between items 5 and 6 is the glitch I mentioned earlier. I donā€™t understand what is happening at the bottom of the picture, is this the user input box?

1 Like

Correct, it would be good to defeat that.

Wild guess, this may have something to do with the period at the start of the first menu line. I pushed a commit that escapes all markdown special characters (as above, including period), maybe this will help.

1 Like

After trying and discarding a few different approaches, I figured out how to hijack Frotzā€™s input. Now with a single command line invocation it will load the game file, load the save file, process one command, save the game, and then exit. Return codes are not yet supported and output needs cleanup. If there is no save file found, this should tell Frotz to start a new game, but Iā€™ve yet to implement that check.

Hereā€™s some sample play with Zork 1:

$ ./dfrotz -B "look" -L zork1.qzl -R ./ zork1.z3
Using normal formatting.
Loading zork1.z3.


Ok.

command:  look
>

West of House
You are standing in an open field west of a white house, with a boarded
front door.
There is a small mailbox here.

command:  SAVE
>Ok.


$ ./dfrotz -B "open mailbox" -L zork1.qzl -R ./ zork1.z3
Using normal formatting.
Loading zork1.z3.


Ok.

command:  open mailbox
>

Opening the small mailbox reveals a leaflet.

command:  SAVE
>Ok.


$ ./dfrotz -B "take leaflet" -L zork1.qzl -R ./ zork1.z3
Using normal formatting.
Loading zork1.z3.


Ok.

command:  take leaflet
>

Taken.

command:  SAVE
>Ok.


$ ./dfrotz -B "north" -L zork1.qzl -R ./ zork1.z3
Using normal formatting.
Loading zork1.z3.


Ok.

command:  north
>

North of House
You are facing the north side of a white house. There is no door here, and
all the windows are boarded up. To the north a narrow path winds through
the trees.

command:  SAVE
>Ok.
3 Likes