How to always print something before the room's description?

Hello. I’m facing with an issue as I want to print stuff (eventually it’s going to be ascii art to illustrate room) before the room’s “banner” including the description, room name and so on. So I did something like this:


After going to the Bedroom:
	if pillow is on bed and pen is on Night table:
		say "pb pnt";
	else if pillow is on bed:
		say "pb";
	else if pen is on Night Table:
		say "pnt";
	else:
		say "bleh";
	say "[line break]";
	produce a room description with going spacing conventions.

This kinda works (it prints stuff depending on what is in the room as expected) HOWEVER it is not printed upon player’s spawn in the world (the Bedroom is the first room of the story).

Does this do what you want, or do you want it before the room name?

Before printing the locale description:
	say "foobar.";

Edit: I just read your post more closely. oops. Just a minute :slight_smile:

I want it before the room name.

Just tried to put it in “when play begins” as well, but it printed it before the story name (which is not what I want).

Try this:

Carry out looking (this is the foobar rule):
	say "foobar.";
	
The foobar rule is listed before the room description heading rule in the carry out looking rulebook.
1 Like

Wouldn’t that just print it regardless of which room player is in? I don’t want to show art for bedroom when player is in the kitchen!

Carry out looking when the location is the Bedroom (this is the foobar rule):
1 Like

You’d probably want to check a property of the room.

A room has some text called the artwork.

Carry out looking (this is the room artwork rule):
    say "[fixed letter spacing][artwork of the location][variable letter spacing][paragraph break]".

The room artwork rule is listed before the room description heading rule in the carry out looking rulebook.
4 Likes

@darkhog, I don’t know whether you’ve considered this yet, but think about how ASCII art will look at different window sizes. Make sure they don’t get messed up if someone plays without full screen, or if their dimensions differ from yours.

2 Likes

Thanks, I’ve ended up with

Carry out looking (this is the asciiart rule):
	if the location is the Bedroom:
		print bedroom art;
	if the location is the Kitchen:
		say "Gbrrllll".
The asciiart rule is listed before the room description heading rule in the carry out looking rulebook.

(“print bedroom art” is an instruction defined using To… so the code can be more maintainable) Had to do if ladder because different locations=different artworks and I don’t want to add thousands different rules for displaying them.

1 Like

The good thing about adding a thousand different rules is that you can put each rule with the definition of the room it goes with, which may be convenient.

1 Like

This is an important point. I did an ascii art game, and it was a PITA to make sure it looked right. My advice is:
1.) Get it tested on every interpreter, tweak it if needed, and just deal with the fact that it’ll be a little squattier or more elongated in some of them.
2.) Have a screen-reader mode that describes the images. This turned out to be really important when ClubFloyd played it, because they can’t view ascii. Plus, that makes it accessible for people who use screen readers.

If you want to see how I did it, the game is Of Their Shadows Deep.

1 Like

Another option, which feels a bit crude but is often the most effective, is to lay out your ASCII art exactly how you like it on your own device, then save it as an image and display that instead. That’s how Kerkerkruip’s graphics work.

Or, if you still want true ASCII, have some sort of test to determine what the ideal setup is. I’m imagining something like:

Set the spacing of the lines so that the following looks like a square:

- - - - - 
|        |
|        |
- - - - -

Which resolution is better (e.g. for small vs. large screens):

  ^~^  ,
 ('Y') )
 /   \/ 
(\|||/)
      ,_     _,
      |\\___//|
      |=6   6=|
      \=._Y_.=/
       )  `  (    ,
      /       \  ((
      |       |   ))
     /| |   | |\_//
     \| |._.| |/-`
      '"'   '"'
1 Like