Lua Basics

A lot of FarCry itself is built in Lua, and thus easily modified.
• Open Far Cry/FCData/Scripts.pak with any zip utility. (it's a standard zip file)
• Here you can see and modify all sorts of things. Menu-screens, Hud, player attributes, etc.

Logs
FarCry creates a log file each time it runs. This file is at Far Cry/log.txt
• This file will contain details of various things. Including errors of various types.
• Script errors are typically at the bottom of the file
Common Knowledge
Logging
You can log to file in lua
• Use the System:LogAlways( "Your message here" ); command to print a message to log.txt and the console
• This should be equivalent to the CryLogAlways( ) command in the C++ SDK
Common Knowledge
LUA Debugger
FarCry ships with an included lua debugger. Instructions on enabling it are below

• Can be enabled by adding sys_script_debugger = "1" to your system.cfg or systemcfgoverride.cfg file. Enabling it via the console should be possible as well

• Then you need to open the lua script file you want to inspect. You need to create an error so the debugger will open.
• There's various ways, but calling a function that does not exist is one of the simplest ones. Such as: abc( );
• If you have a syntax error in your script, it won't be compiled and the debugger will not open. Check log.txt if the entire script won't run..
The Lua debugger included with FarCry
Common Knowledge | FarOut
Bind script to keypress
There's probably multiple ways to do this, but this method works fine if the game is running in Devmode.

Input:BindCommandToKey( "#Game:ChangeFrame( )" , "Right" , 1 );

^^ First argument is the Lua command to run. Some command that will run in Lua. Second argument is the key it will be bound to. Can find out the names of keys in the "Control Options" in the main menu.
^^ This particular example is calling a custom function in C++. Note the # in front of the command exactly as if it were to be run in the console.
Common Knowledge | FarOut