Ingame console commands

From FIFE development wiki

(Redirected from Console commands)
Jump to: navigation, search

[edit] Introduction

This article is currently heavily outdated. We should consider to replace it with automated script documentation.

[edit] General information about the console

  • Console is made visible by pressing F10
  • The console is able to execute normal Lua 5.1 code
  • You can simply type a lua identifier to see it's value

[edit] Autorun Scripts

You can drop lua scripts into the content/scripts/autorun folder and the will be executed at startup. This way you can drop your lua snippets into that folder and have your helper/test functions available in the console without messing with the usual startup scripts.

[edit] Special FIFE console commands

[edit] Load maps

[edit] Command

Image:Command.png
load_map("path/mapname.map")
 

[edit] Example #1

Loads one of the New Reno maps from Fallout 2:

Image:Command.png
load_map("maps/newr1.map")
 

[edit] Example #2

Loads one of our XML maps:

Image:Command.png
load_map("content/maps/noise1_a.xml")
 

[edit] Delayed execution

[edit] Command

Single execution

Image:Command.png
Timer.singleshot( time_in_milliseconds, function )
 

Repeated execution

t = Timer( interval, function )
t:start()
...
t:stop()

[edit] Example #1

Take a screenshot in 10 seconds.

Image:Command.png
Timer.singleshot( 10*1000, engine.makeScreenshot )
 

[edit] Example #2

Print FPS to console every second.

t = Timer( 1*1000, function() console.print( engine.getFPS() ) end)
t:start()

[edit] Create screenshots

[edit] Command

Image:Command.png
engine.makeScreenshot()
 

[edit] Example #1

Takes a screenshot of the current screen and saves it in the Screenshots subdir as .bmp file:

Image:Command.png
engine.makeScreenshot()
 
Personal tools