Howdy! Sorry for the question if its been answered elsewhere, but I am working on a project using Z5 so that I can customize the status line. I’ve seen in other games the status line be a few lines (rows) tall. How do I go about achieving this? I’d like to be able to display a bit more info and not have it be so crowded!
Thank you in advance!
Hey! So, first, I’m assuming you’re using the ZILF base library. (I’m not well versed with it, as I used the new-parser from Zork Zero.) I’m also guessing you’ve already found the UPDATE-STATUS-LINE (and I think INIT-STATUS-LINE, too).
So, first, you’ll want to find wherever it says <SPLIT 1> and change that to however many lines you want. That sets up the ability to do so. Then, look for the place it says <CURSET 1 [and something else is here]>, and read through those in order to get an idea of how to do it. I’m in a rush, so I can’t quite yet, but I’ll give an example from one of my projects in a while!
So, if you haven’t figured it out yet, I have a small example from the real zilf library. Okay, here’s the original:
<ROUTINE INIT-STATUS-LINE ()
<SPLIT 1>
<CLEAR 1>>
Actually, this is really weird. I’m not quite sure how this is working. <CLEAR -1>
clears the screen… Ok, I’m going to change this up.
We want to make two lines, so we’ll have to go to both of the lines, using <CURSET [row] [column]>
(sets the cursor position, but only in the upper window, and to do this you’ll need to change the window), then use <ERASE 1>
which erases the line. Also, SPLIT should be set to 2, so two lines are moved.
<ROUTINE INIT-STATUS-LINE ()
<SCREEN 1>
<SPLIT 2>
<HLIGHT ,H-INVERSE>
<CURSET 1 1>
<CLEAR 1>
<CURSET 2 1>
<CLEAR 1>
<HLIGHT ,H-NORMAL>
<SCREEN 0>>
Then, the UPDATE-STATUS-LINE originally looks like this:
<ROUTINE UPDATE-STATUS-LINE ("AUX" WIDTH)
<SCREEN 1>
<HLIGHT ,H-INVERSE>
<FAKE-ERASE>
<TELL !\ >
<COND (,HERE-LIT <TELL D ,HERE>)
(ELSE <TELL %,DARKNESS-STATUS-TEXT>)>
<SET WIDTH <LOWCORE SCRH>>
<CURSET 1 <- .WIDTH 22>>
<TELL "Score: ">
<PRINTN ,SCORE>
<CURSET 1 <- .WIDTH 10>>
<TELL "Moves: ">
<PRINTN ,MOVES>
<SCREEN 0>
<HLIGHT ,H-NORMAL>>
;"Fills the top row with spaces."
<ROUTINE FAKE-ERASE ()
<CURSET 1 1>
<DO (I <LOWCORE SCRH> 1 -1) <PRINTC !\ >>
<CURSET 1 1>>
You’re gonna want to do it your way, and if you send me an example of what you want to do, I can show you how to do it, but otherwise that’s a little complicated.
It’s all good. I got it working, I really appreciate the help! Also, New Parser? What decadence have I been missing out on?
Uhhhh, so basically I wanted to have a more complex parser that I could add loads of edits to, plus i wanted the EVERYWHERE syntax tag for ASK [object] ABOUT [anything] sorta stuff, so I took a mixture of source code from Zork Zero and the graphical games, changed it wildly (like 1/4 of it is not the same), and used it for my game (Milliways). I’m using it in my current WIP, though the parser code for that one is barely recognisable from the original…
Most ZIL instructions map directly to Z-code instructions. CLEAR maps to @erase_window.
@erase_window 1 clears window 1, i.e. the upper window AKA statusline.
https://inform-fiction.org/zmachine/standards/z1point1/sect15.html#erase_window
Infocom’s “New Parser”, new as of 1987. They used it for Zork Zero, Arthur, and Shogun.