Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Lua - console or not

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua - console or not Page: [1]
Login
Message << Older Topic   Newer Topic >>
Lua - console or not - 2/14/2017 8:58:20 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
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



_____________________________

Michael
Post #: 1
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua - console or not Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.000