Skip to content
Josh Goebel edited this page Mar 28, 2021 · 12 revisions

External Editor

There are two methods by which you can run code from an external Lua file:

  1. add dofile('game.lua') as the first line of the built-in editor and place game.lua in the correct location:
  • For Windows, the file should be in the same folder as your your executable.
  • For Unix/Linux it should be in the directory from which you started the tic binary.
  • For Android you need to specify the full path to your Lua file. For example, dofile('/sdcard/game.lua').
  1. use tic cart.tic -code game.lua command line parameters to inject your code to the cartridge

Note: dofile() is deprecated in 0.80 development versions - you can save your game as a lua file directly if you wish to use an external editor, for example:

save mygame.lua

The saved file will include your code and, at the end, all resources saved within XML-style tags. Care should be taken to avoid manually editing this data unless this is what is required. TIC will automatically re-load any changes into its code editor.

Extensions/packages for text editors

Clone this wiki locally