Using Context with Trainzscript

From TrainzOnline
Revision as of 00:00, 4 February 2010 by Windwalkr (Talk | contribs)

Jump to: navigation, search
  • Context is a freeware programmer's editor which can be downloaded from http://www.contexteditor.org/downloads.html.
  • Highlighters for script files and for config.txt files can be downloaded by clicking here. These are not essential but they do show keywords, text strings and numbers in different colours and help to show where there might be missing quote marks and other problems with your code. A highlighter for config.txt files is included.
  • Install the program and copy the highlighter files to \Program Files\Context\Highlighters.
  • To integrate the compiler select Option\Environment Options from Context's menu and then select the Execute Keys tab.
  • Click on Add and enter the file extension gs
  • In the box at the top select one of the function keys and make these entries:

ContextOptions.jpg

  • Click OK to close the dialogue.
  • Close Context.
  • Create a new file called compile2006.bat in C:\Program Files\Auran\ (use whatever name and location you prefer)
  • Add this text to the batch file, you may need to modify paths or filenames:
@echo off
set gsc="C:\Program Files\Auran\TRS2006\Bin"
set include="C:\Program Files\Auran\TRS2006\Scripts"
%gsc%\gsc.exe %1 -i%include% -pc:\windows\temp
set gsc=
set include=
pause
  • Reopen Context and load a script file.
  • Press F11, your script file will be saved and then checked by the compiler, if all has gone well you will see this:

CompiledOK.jpg

  • If there are any problems with the script details will be given together with the line number of the error.
  • Interpreting these can be something of a black art, don't worry it will become easier as time passes.
Personal tools