Arbitrary Printing of Characters at Different Locations

Hey, I know this is a sort of weird esoteric question, especially for us ZILF fans, but I am thinking of maybe working on a project involving a star map. For this, I planned on having each star system represented on the screen as a character. Then the player would press that character to choose that as the destination.

       A                                       
                                   X                     
                                                               J            L

         M                        N                  D
                  V                
                                                                 S

(Sort of like this.)

I tried a little bit of preliminary experimentation with CURSET and it didn’t really seem to be working for me. Is there any reasonable way I can achieve this? Thanks!

Outside of version 6 (YZIP), CURSET only works in the status line; this is a Z-machine limitation rather than a ZIL one (i.e. not one that you can work around with a fancier library). So you need to make the status line cover more of the screen to print the map into it. This is how the sonarscope in Seastalker is handled.

The alternative is HLIGHT 8, which sets a monospaced font in the main window. But this means you have to calculate the appropriate sequence of spaces and newlines yourself—and you can’t back up, so you have to print the whole map in one go. This is how the map in Enchanter is handled.

3 Likes

Okay… How about a bar for images? Not only do I need to know how to make the status bar bigger, I also don’t know how to add images. And if you want it along the side?

That’s possible in YZIP (aka Z6), though most interpreters don’t support it. Unfortunately it’s not something I’ve ever really worked with.

2 Likes

If targeting the maximum number of platforms, you’ll need to do a z3 version and this doesn’t allow you to change the cursor position.

If the map doesn’t change, my gut feeling is to change to mono-spaced font and print it as a string. The only thing you need to be careful of is that the lines aren’t too long or they’ll wrap around or get truncated, depending on the interpreter. I think the narrowest screen is the VIC-20 (22 characters wide).

Incidentally, most 8-bit platforms are mono-spaced by default.

1 Like