Author Topic: MegaGlest Lau Commands  (Read 1635 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
MegaGlest Lau Commands
« on: 10 October 2010, 02:02:51 »
GAE would greatly benefit from the implimentation of the following Lau commands, which are now in megaglest.

void enableAi(factionindex)
void disableHunger(factionindex)
void enableHunger(factionindex)
bool getAiEnabled(factionindex)
bool getHungerEnabled(factionindex)
void startPerformanceTimer()
void endPerformanceTimer()
Vec2i getPerformanceTimerResults()   (returns a 2D int array, item #1 is avg updateFps, #2 is avg RenderFps)
void DisplayFormattedText(format, ...)   (prints a message using printf style formatting and NOT using language files)

(Filtered out new commands that already have a GAE alternative, though, for compatability, they could perhaps be implimented too. It would certainly be nice if MG stuff also works in GAE  ;))

Full list and associated MG topic found here
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: MegaGlest Lua Commands
« Reply #1 on: 10 October 2010, 03:14:13 »
Say it with me now.  Lua.  Looooooo-aaaaahhhhhh.  Literally say it aloud to yourself.  Lua.  L-u-a. ;D

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: MegaGlest Lau Commands
« Reply #2 on: 10 October 2010, 06:45:38 »
We have also updated the MG wiki with most of the new LUA commands. Also a VERY SPECIAL note... we fixed a big problem in the lua code in MG (which has been around since original glest) where invalid lua was NOT reported as errors when running scenarios / tutorials in some cases but now all errors are properly reported making it MUCH easier to create / debug lua script. For example if i added the non existant command:

bob()

as a line in the lua script the script would run up to the point where it hit bob() but not any further and NO error was shown. The fixed code is in
lua_script.cpp / h  (SVN rev 1081).

Thanks

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: MegaGlest Lau Commands
« Reply #3 on: 10 October 2010, 09:41:56 »
... but now all errors are properly reported making it MUCH easier to create / debug lua script.

Like this?


Glest Advanced Engine - Code Monkey

Timeline | Downloads

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: MegaGlest Lau Commands
« Reply #4 on: 10 October 2010, 13:57:57 »
Indeed you guys already fixed this one. Originally I had looked at the GAE code and thought it was the same as vanilla Glest but that was because I had looked at the wrong area and was thrown off the path to the actual bug. Good work guys.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: MegaGlest Lau Commands
« Reply #5 on: 10 October 2010, 16:41:59 »
Say it with me now.  Lua.  Looooooo-aaaaahhhhhh.  Literally say it aloud to yourself.  Lua.  L-u-a. ;D
Dammit. No matter how hard I try, Lau Lua? Lau?? Lua!!! Will be the death of me.

Hmm, the error handling is nice, yes... Still, any chance we could see these Megaglest Lua (!) commands appear in GAE in the future?
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: MegaGlest Lua Commands
« Reply #6 on: 11 October 2010, 02:03:32 »
Hmm, the error handling is nice, yes... Still, any chance we could see these Megaglest Lua (!) commands appear in GAE in the future?

void enableAi(factionindex)
void disableConsume(factionindex)
void enableConsume(factionindex)
bool getAiEnabled(factionindex)
bool getHungerEnabled(factionindex)

Yes.

Quote
void startPerformanceTimer()
void endPerformanceTimer()
Vec2i getPerformanceTimerResults()   (returns a 2D int array, item #1 is avg updateFps, #2 is avg RenderFps)
void DisplayFormattedText(format, ...)   (prints a message using printf style formatting and NOT using language files)

(Filtered out new commands that already have a GAE alternative, though, for compatability, they could perhaps be implimented too. It would certainly be nice if MG stuff also works in GAE  ;))

No. Though some of the ones you filtered out could probably be implemented in Lua to make MG scenarios work in GAE.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

 

anything