can I make a function clear the console? "clear" no good

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

can I make a function clear the console? "clear" no good

Post by Komag »

I'd like to have a function in the game clear the console - possible?

I tried just saying "clear" like

Code: Select all

function doClear()
  clear
end
code not accepted, doesn't work
Finished Dungeons - complete mods to play
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: can I make a function clear the console? "clear" no good

Post by msyblade »

Hmm, this is a good question. Surprised that the function does not work. Perhaps there is a trigger function in that case, such as "print" is used before the command. like "command clear" or something. i'm gonna check it out, but it may be just obscure enough not to have an answer printed yet. (Especially if you're not aware of it, kinda think of you as "the encyclopedia" around here! :D
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: can I make a function clear the console? "clear" no good

Post by Komag »

well that was fast...

I thought of a new idea, to have the gui print a blank space, so you just hold the key for a second and the console flies away upward all cleared off!

in my gui hook code:

Code: Select all

if g.keyDown("c") then pr.nt("") end -- to clear the console
works pretty well

...even better:

Code: Select all

  if g.keyDown("c") then
     for i=1,20 do pr.nt("") end end -- to clear the console
this clears it instantly by hitting c for a moment instead of having to hold it for a full second
Finished Dungeons - complete mods to play
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: can I make a function clear the console? "clear" no good

Post by msyblade »

you want to do this without the player knowing, correct? so you could trigger it with a hidden plate etc. Or is this just for your personal use. (Was picturing players getting a console message that spoiled a puzzle hint on the fly.) I almost want to consider the console like an entity, where it could be id'd, like "console: clear()", now i just wanna go mess with it,lol
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: can I make a function clear the console? "clear" no good

Post by Komag »

it could work however you want, same code really, just a for-loop 20x to print a blank line.

I'm primarily wanting it for my upcoming testing sessions of my just-completed project, so I can have my console on but clear it very easily and quickly whenever I want. And also for my testers (after my own run-through) so they can see the console but also clear it fast as well.
Finished Dungeons - complete mods to play
Post Reply