michaelm75au -> Lua - console or not (2/14/2017 8:58:20 AM)
|
As you know, several Lua commands show an error on the screen or continue with a result of nil. As an attempt to bring some consistency to this, commands executed in the console will usually show an error message (popup or printed message). It is nicer to see why the command fails... This may give unexpected results when testing a script. In order to see how the script runs without a console as in an Event Action, there is a new command 'Tool_EmulateNoConsole(true/false)'. Preceding your test script with Tool_EmulateNoConsole(true) will execute the script as if it was not in the console. Ex Tool_EmulateNoConsole(true) if ScenEdit_GetUnit({side='sidea', name='sam site'}) ~= nil then ScenEdit_DeleteUnit({side='sidea', name='sam site'}) end
|
|
|
|