Trainz/GameScript

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Warning icon.svg
Warning:  This page is being used as a test bed for new template abilities that will significantly aid editing and threading of pages. AS SUCH, if the appearance is funky for a few days, it's a work in progress, so please bear with me!
  • Questions to: FrankB 23:53, 12 August 2015 (UTC)

GameScript is a derivative successor C-based programming language of the Trainz 1.3-Trainz UTC era's TrainzScript application which gives Trainz it's expandability and interactive features. In TRS2004 the language was generalized into a system of Rules, contained in Sessions user changeable using the new Session Editor feature of the Surveyor module. The Rules were a combination of Icons, input or assignment code, and run time script using said data input that together with the Trainz script library of the install, allowed an easier implementation of most of the TrainzScript.exe utility capabilities then available to scenario writer's—which was limited to a group of content creators' with programming skills. The GameScript generation is entirely dependent upon Content Manager and the runtime GUI applications to vett, error check and validate the new script's ability to compile and load.


GS file[edit]

GameScript is a C-like computer language which generate GS files— Gamescript source files for inclusion in assets and the game's script libraries.

Many interactive assets depend on these script files to interface with the Trainz run time modules. Script updates account for a common reason an interactive or animated asset becomes obsolescent or may not function, as the script libraries from release to release (including updates like hotfixes and service packs) usually evolve a few of the library files. The other main effect of this version drift is the sometimes impossible difficulty of taking an asset using an advanced TBV with a need for such a script update to an earlier version of Trainz, such as TS2009, the TC's, or even TRS2004/TRS2006. In general, most assets can be retrograded, but when they can't, a script language feature in the code build and it's successors is the main reason such an asset cannot.

Example
In the summer of 2014, Andi06 published a new set of assets depending upon TS2012's service pack 1 and the fourth hotfix in the series. TS2012-SP1+hf3 COULD NOT ever work with the new diamond crossing assets. The software hooks needed in the runtime modules surveyor and Driver just didn't exist before hotfix 4 for TS12. This is also an example (one of many) where the programmers responded to a request from the users and improved Trainz by granting our wish. Most such improvements have been user demand generated. A good reason to stay active monitoring the Auran forums.

 

Notes, Footnotes & References[edit]

Config.txt files are endemic and ever present in Trainz assets, for no asset can be defined without this type of Computer Science container. The keyword-value_of_key pairing must always be kept in mind in editing or creating Trainz content. The TrainzBaseSpec contains values and containers which are most common in asset defining config.txt files.  

Notes

 

Footnotes

 

References

logo
Trainz Basic Knowledge reference
TOC | BeginningsFun | AM&C | Creation | InBook Refs ORP Refs:  • Index • Containers • Kinds • Tags | Appendixes  • Vers
Loupe light.svg
 Glossary
 HKeys-CM
 HKeys-DVR
 HKeys-SUR
 HKeys-WIN
 Mouse use
 Notations