Home > Tutorials > Setting up scripting utilities for TRS2006 Tutorial

Setting up scripting utilities for TRS2006 Tutorial

In this tutorial you will learn how to set up text editors to compile and encrypt scripts internaly.

NOTE The encryptor included with TRS2006 original is faulty.

Use the version included with TRS2004 or TRS2006 SP1 instead.

Gamescript Compiler GSC.exe
UltraEdit
ConTEXT

 

GameScript Encription GSE.exe

UltraEdit
ConTEXT

 

UltraEdit Compiler

To setup a shortcut to the compiler program we need to create a new custom tool. Goto the "Advanced" menu and select "Tool Configuration" from the list.

 

Figure 1 Tool configuration menu entry

 

Figure 2 Tool Configuration window

 

Once open we need to create a tool with the following options;

Command Line "TRS2006Path\Bin\gsc.exe" %n%e -i"TRS2006Path\Scripts" -pC:\temp
Working Directory %p
Menu Item Name TRS2006 Compiler
Save Active File Checked
Output to List Box Checked
Capture Output Checked

NOTE1: Change the TRS2006Path to the installation location of TRS2006 on your computer.
NOTE2: The final section of the first parameter causes the output file of the compilation process to be relocated to C:\temp. Change the path if you do not want the gsl files to be located there.

Once you have the above settings entered then click on the "Insert" button to add the tool to the list. If after you have added the tool you need to make changes then you need to click on the "Replace" button to see any changes. If you wish you can add an icon by clicking on the "Advanced..." button.

 

Figure 3 Added tool

 

Figure 4 Returned message from compiler

 

When you have a gamescript (.gs) file open and you click on the new tools icon the compiler should run and a message appears in UltraEdit with the results of the compilation. If there were any errors then simply click on the error and the line in the script should automatically be scrolled to.

 

ConTEXT Compiler

To setup a shortcut to the compiler program we need to modify the "Environment Options". Goto the "Options" menu and select "Environment Options" from the list.

 

Figure 1 Environment options menu entry

 

Figure 2 Execute keys tab settings

 

Once the "Environment Options" are open select the "Execute Keys" tab and then select a function key from the list. Then we need to enter the following options;

Execute "D:\Program Files\Games\TRS2006\Bin\gsc.exe"
Start in: "%p"
Parameters %n -i"D:\Program Files\Games\TRS2006\Scripts" -pC:\temp
Capture console output Checked
Compiler output parder rule: "%n(%l)"

NOTE1: Change the TRS2006Path to the installation location of TRS2006 on your computer.
NOTE2: The final section of the "Parameter" setting causes the output file of the compilation process to be relocated to C:\temp. Change the path if you do not want the gsl files to be located there.

Once you have the above settings entered then click OK and the settings will be associated with the selected function key.

 

Figure 3 Compiler results shown in ConTEXT

 

When you have a gamescript (.gs) file open and you press the selected function key the compiler should run and a message appears in ConTEXT with the results of the compilation. If there were any errors then simply click on the error and the line in the script should automatically be scrolled to.

 

UltraEdit Encription

To setup a shortcut to the compiler program we need to create a new custom tool. Goto the "Advanced" menu and select "Tool Configuration" from the list.

 

Figure 1 Tool configuration menu entry

 

Figure 2 Tool Configuration window

Once open we need to create a tool with the following options;

Command Line "D:\Program Files\Games\TRS2006\Bin\gse.exe" encrypt %n.gs %n.gse
Working Directory %p
Menu Item Name TRS2006 Encryptor
Save Active File Checked
Output to List Box Checked
Capture Output Checked

NOTE1: Change the TRS2006Path to the installation location of TRS2006 on your computer.

Once you have the above settings entered then click on the "Insert" button to add the tool to the list. If after you have added the tool you need to make changes then you need to click on the "Replace" button to see any changes. If you wish you can add an icon by clicking on the "Advanced..." button.

When you have a gamescript (.gs) file open and you click on the new tools icon the encryption program should run. If there were problems with the process then a message will appear in UltraEdit with the results of the encryption.

 

ConTEXT Encryption

To setup a shortcut to the compiler program we need to modify the "Environment Options". Goto the "Options" menu and select "Environment Options" from the list.

Figure 1 Environment options menu entry

 

Figure 2 Execute keys tab settings

Once the "Environment Options" are open select the "Execute Keys" tab and then select a function key from the list. Then we need to enter the following options;

Execute "D:\Program Files\Games\TRS2004\Bin\gse.exe"
Start in: "%p"
Parameters encrypt %n
Capture console output Checked
Compiler output parder rule:  

NOTE1: Change the TRS2006Path to the installation location of TRS2006 on your computer.

Once you have the above settings entered then click OK and the settings will be associated with the selected function key.

When you have a gamescript (.gs) file open and you press the selected function key the encryption program should run. . If there were problems with the process then a message will appear in ConTEXT with the results of the encryption.

 

Was this tutorial helpful? Not enough or too much detail? Points not explained properly? Suggest any improvements? Please use the Tutorial Enquiry Form

 

 

Trainz and Trainz Railroad Simulator are trademarks of Auran

Best viewed at 1024 x 768 or higher

Pages best viewed with Cooper and Cooper Black font installed.

Copyright © 2007 P. Campbell. All rights reserved. Revised: February 15, 2008