Lua scripting tools

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Lua scripting tools

Post by zuzuf » Sat Jun 06, 2009 3:56 pm

Ok, I've added some console commands to allow debugging Lua scripts (mission scripts and AIs only, it's impossible to deal with unit scripts the same way).
So all Lua debugging commands starts with the keyword lua:
  • lua debug mission - enter in mission mode (all commands used after this one affect mission script)
  • lua debug AI n - enter in AI debugging mode, all commands after this one will affect Lua scripts used by player n as its AI if any (if none, then following commands won't do anything).
  • lua stop - stops the thread
  • lua resume - resume the thread
  • lua kill - kills the thread (be careful with this)
  • lua crash - basically stops the thread for debugging (when a thread crashes, it remains in that state)
  • lua continue - uncrashes the thread ... is likely not to work if it has really crashed
  • lua load scripts/*/my_script.lua - loads the given lua script (kills and replace current running script if any)
  • lua run my lua command - runs some Lua code inside the LuaThread virtual machine, so you can do things like : lua run logmsg(my_bugged_variable)
Note that now you can type ')' in the console, it wasn't possible on some platforms with some keyboard configs, but now you have to clear your console input line before hiding it.
=>;-D Penguin Powered

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Lua scripting tools

Post by xpoy » Sat Jun 06, 2009 4:06 pm

COOOOOOOOOOOOOOOOOL!
It helpful, really great job! I could say what need what TA3D gave

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Re: Lua scripting tools

Post by Balthazar » Sat Jun 06, 2009 4:39 pm

Thanks! :D

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests