clear the screen
clear the screen
1 - Is there any way to clear the preview screen using script as opposed to the CLR button once you have printed to it with the 'print()' command?
Re: clear the screen
Just type
in the console and press enter.
Code: Select all
clearGrimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: clear the screen
Thank you but I was referring to the script itself. If I am in the dungeon maker I don't have the council unless I press F12 and then type clear and then press F12 again to get rid of the council input. If I am going to do all that I might just as well press the CLR button. What I am trying to do is clear the screen with a line of script in my code. I have created a small section of tiles and code on Level 1. I can place an item in a particular tile (I use 0,0), place my start position arrow in another (non-game) area of 3 tiles with buttons on the wall and then hit run. When one of the buttons is pressed the code will look at the item in 0,0 then look at all the levels in the dungeon and tell me how many of that item I have on each level. Another of the buttons will allow me to select a particular level and the third button will tell me what tiles contain the items on that level (ie. 1 at 5,19 - 2 at 6,24 etc.). In cases where there are a lot of items it would be nice to be able to clear the screen with the code at certain intervals because of the 15 lines of print limitation.
Re: clear the screen
Well, you can't actually clear the console from within a script that I know of, but you can get rid of existing lines with
Code: Select all
for i=1,20 do print("") endGrimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: clear the screen
You could add that to a general utility script as a function, and call it from any other script_entity.
Ut.script:cls()
Ut.script:cls()
Re: clear the screen
Thanks but I was already aware of that method. On my system, after 15 lines, the screen scrolls so line 16 is printed on line 15 and line 1 disappears. After using the loop the screen does clear but all succeeding lines are printed on line 15 rather then starting at the top.
Re: clear the screen
Clear screen relies on the os.execute(), and it's not present in LoG2; aside from that it obviously works via the button. So Petri would have to either mention his secret to this, or add a clear() function.RayB wrote:Thanks but I was already aware of that method. On my system, after 15 lines, the screen scrolls so line 16 is printed on line 15 and line 1 disappears. After using the loop the screen does clear but all succeeding lines are printed on line 15 rather then starting at the top.
Last edited by Isaac on Wed May 06, 2015 10:46 pm, edited 2 times in total.
Re: clear the screen
Well, clearing an ingame monitor doesn't necessarily require os.execute(), since it's totally contained within the game, and I assume it's what the OP wanted. There's no way to do it in Grimrock as a user other than typing "clear" though.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: clear the screen
*I would bet that there is some printed escape sequence that will clear the screen, but I haven't found it yet.
Re: clear the screen
Nope, just tried with all 256 characters. None clear the screen.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.