And returning to the question about clearing screen. I failed getting the desired result based on your recommendations. Let me explain: I want the win message to be shown without a header. Like an introduce message. But no clear_screen, no theme setting didn't help achieving this.
I've erased everything already but try to reproduce. I've tried this (as you advised in the documentation thread):
: if (treasure_deposited() == treasure_total()) { : clear_screen hide_status_bar = "true" ; : print {(win_msg)}; : press_any_key; }
in the on_describe of treasure room. Maybe I put it in the wrong place.
Message is displaying, but after key press it going to standard screen with header. I can't get how to stop game here.
Vertsion 1.0.0. Beta 22
Ah, you want "win_game".
The standard treasure hunt mode will automatically wire up the win game, but as you chose "treasure_hunt_mode = bespoke", you have to use the win_game command yourself.
: if (treasure_deposited() == treasure_total()) { : clear_screen hide_status_bar = "true" ; : print {(win_msg)}; : win_game ; }
That's correct. treasure_hunt_mode applies to the whole game.
If you use default mode, it automatically determines the end of the game for you and prints the message in the all_treasures_found_win_game system message.
If you use bespoke mode, you have to determine the end of the game yourself. That's what Adventuron was describing. This is where you get the opportunity to clear the screen and remove the status bar.
Reading back through your thread, it looks like you want to clear the screen when the game is over. It's 2:00 a.m. here, so I haven't got time to solve your problem right now, but Adventuron did describe this in the documentation thread (the one that's now locked). He gave you two methods to do this. Can you please try this and get back to me if it doesn't work. Remember that the code he gave you goes into the on_tick{} block. If it doesn't work, post the whole of your on_tick{} block here.
I've tried as you described. Doesn't work.
on_tick { : set_integer var = "rnd_tick" {(random(count_descs))} ; : if (treasure_deposited() == treasure_total()) { : clear_screen hide_status_bar = "true" ; : print "You remember nothing, just have the feeling that this night was full of fear and adventure."; : win_game ; } }
And the result screen attached. I don't want the red header to be shown.
It looks like as soon as you print something, the status bar comes back. I'm not sure if this is by design or not. Unless Adventuron has a better solution, I think the best way to overcome your problem is to apply a new theme without a status bar before clearing the screen. Here is a complete game based on the treasure hunt example in the tutorial that does what you want.
start_at = treasure_room
treasure_room = treasure_room
start_theme = two
locations {
treasure_room : location "The treasure room";
tomb : location "A tomb";
}
connections {
from, direction, to = [
treasure_room, east, tomb,
]
}
objects {
lamp : object "a lamp" at = "tomb" treasure = "true";
}
game_settings {
treasure_hunt_mode = bespoke
}
on_tick {
: if (treasure_deposited() == treasure_total()) {
: set_theme "my_theme";
: clear_screen;
: print "You remember nothing. You just have the feeling that this night was full of fear and adventure.";
: win_game;
}
}
themes {
my_theme : theme {
extends = two
theme_settings {
layout = D X O
}
}
}