Trainz/GameScript
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.
Be advised this new Trainz Wikibooks topic page is rough and incomplete. It was last edited on 3 April 2021, and is still under heavy construction. Work needed: Someday hope to turn this into a page giving a scripting overview. Initially, develop with an eye on script interactivity in repairing assets. The actual reference should be in an /refs/GameScript sub page, whilst modification pages under the /AM&C group pages. This Page UNDERCONSTRUCTION: Content here is likely to be changed significantly in a short amount of time. All Trainzer's and Wikibookians with knowledge in this subject are welcome to help out. You can remove this tag and replace it with {{Trainz-stub}} or with section stub templates ({{Trainz-sect-stub}}) on unfinished sections when the 'page' has become more mature. |
GS file
[edit | edit source]- 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 | edit source]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
- Trainz printed or pdf file Manuals, applicable version - usually in the ..\extras or ..\extras\manuals folder
- TrainzOnline Wiki Config.txt file page and various other pages
- TrainzOnline Wiki: Content Creator's Guide pages (various)
- Various CCG and Auran websites