Author Topic: In-game Lua Console  (Read 1462 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
In-game Lua Console
« on: 16 July 2013, 20:15:35 »
One little known feature of GAE that I found useful was the Lua console that it had. Pushing the ~ key would open a small window in the bottom right corner of the screen, in which you could type in Lua commands, which would be executed. This made testing of mods and scenarios very easy, as you could quickly generate units and such. I'd like to propose that a similar feature is added in MegaGlest, for the purpose of making it easy to test the game (and it would also satisfy the desires of those who want "cheat codes").

The console would be single line for simplicity. Every time the enter key is pressed, the contents of the current line would be parsed. If possible, it should be able to interact with Lua scripted scenarios as well, meaning you could change the value of a variable in a scenario (great for testing and debugging scenarios). The console should be disabled in multiplayer.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
Re: In-game Lua Console
« Reply #1 on: 31 July 2013, 12:33:29 »
Sounds as a good idea, maybe for the 3.9?
I translated Megaglest in italian and i keep the translation updated.

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Re: In-game Lua Console
« Reply #2 on: 30 September 2013, 17:20:00 »
+1. All other games using Lua that I know of have this console, and it can be quite useful.

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Re: In-game Lua Console
« Reply #3 on: 1 October 2013, 10:32:05 »
it sounds like a good idea, but I think it should be disabled by default and enabled via the advanced options in the create game menu and/or via start-up arguments like --lua_console=true

For implementation I thing the weak text-fields of MG (can't navigate by click or arrow keys within the text-field) will make such a console hard to use. So a better text-field would be needed for sufficient usage of such a console.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: In-game Lua Console
« Reply #4 on: 1 October 2013, 16:25:42 »
it sounds like a good idea, but I think it should be disabled by default and enabled via the advanced options in the create game menu and/or via start-up arguments like --lua_console=true
I don't really think it's necessary, since the console is opened with "~". A number of games (like many Bethesda games) do it this way. Opening the console should pause the game. The game is not meant to be navigated while the console is open.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Re: In-game Lua Console
« Reply #5 on: 1 October 2013, 22:43:16 »
Did you ever wrote a chat message in-game? 2nd lettrr wrong = delete almost everything :(

And Bethesda games usually are single player games so there is no need to enable/ disable console, but when playing against human player I don't want to loose because my opponent is typing the console faster.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: In-game Lua Console
« Reply #6 on: 2 October 2013, 00:59:46 »
Did you ever wrote a chat message in-game? 2nd lettrr wrong = delete almost everything :(
Oh, I didn't realize that. Presumably the left and right arrow keys should move the cursor, and the up and down arrow keys should move through the command history, like a shell terminal.

And Bethesda games usually are single player games so there is no need to enable/ disable console, but when playing against human player I don't want to loose because my opponent is typing the console faster.
In my opinion, multiplayer games should always disable the console, by default. However, because of the very valid testing purposes, it should be possible to use the console if all human players can somehow agree to it. I don't feel a command line flag is a good approach, as it would require the program to be relaunched by everyone to allow console commands. Instead, an option in the advanced settings of the host should allow the console to be enabled for multiplayer. For good measure, this option should issue an additional prompt to prevent cheating (only real use of the console for multiplayer is testing).

Honestly, though, I only ever had single player in mind. If the console is troublesome for multiplayer (eg, OOS issues), it can be completely disabled. A single player only console is still vastly more useful than no console, and I imagine most of the uses of a console will be for single player (cheats, testing, debug, etc).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert