From Data Realms Wiki
The Lua console is a very useful feature that allows you to test Lua expressions, access game functions, or just mess around. The console is displayed by pressing ~ or / on the keyboard. Statements are interpreted as a line of Lua in the context of the Cortex Command game engine.
ConsoleMan.ScreenSize is a number between 0 and 1 that indicates the percent of the screen that the console takes up. The following example makes the console take up half of the screen:
- ConsoleMan.ScreenSize = .5
Cortex Command's console includes functions to output console text to a file:
Simple Console Tricks
To change your funds type
This may seem like overkill just to change one variable, but it is necessary. The only things you should bother changing in this line are the two numbers in the final round brackets. The first is the number that the funds are changed to. The second is the team whose funds will be changed. By default the player is Team 0 and the computer controls Team 1.
Ever just wish you could kill all of the actors on the other team? Let's see what we can do with the console. To gib all actors in play, type
- for actor in MovableMan.Actors do actor:GibThis() end
This code gibs all actors, but that's not what we want. A little more needs to be added:
- for actor in MovableMan.Actors do if actor.Team == 1 then actor:GibThis() end end
Now this code checks if the actor's team is 1 and gibs it if it is. Note that "Health", "Team", and "Actors" use periods (.) instead of colons (:). This differentiates between member functions and member variables.
Give yourself super-actors or handicap the enemy by changing the Health variable. This uses a for statement like we used with GibThis(), but instead changes actor health. This line will change all of your actor's Healths to 200:
- for actor in MovableMan.Actors do if actor.Team == 0 then actor.Health = 200 end end
This code, on the other hand, will just make all enemies fall over dead:
- for actor in MovableMan.Actors do if actor.Team == 1 then actor.Health = 0 end end