Scripting

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(Scripting in TRS19 and beyond)
 
(3 intermediate revisions by 3 users not shown)
Line 14: Line 14:
 
[[TrainzScript User Interface]] - ''implementing user interfaces in TrainzScript.''
 
[[TrainzScript User Interface]] - ''implementing user interfaces in TrainzScript.''
  
[[New TrainzScript Features]] - ''recent additions to the scripting environment (TS2009).''
+
[[New TrainzScript Features - TS2009]] - ''recent additions to the scripting environment (TS2009).''
  
  
Line 33: Line 33:
 
With TANE SP2 and beyond, we are introducing some major differences in the way routes are loaded and saved. Since we are moving towards information being streamed in as required, scripts will need to be updated to handle these new methods.
 
With TANE SP2 and beyond, we are introducing some major differences in the way routes are loaded and saved. Since we are moving towards information being streamed in as required, scripts will need to be updated to handle these new methods.
  
Here are some links that will assist scripters in discovering more about the new features. We will update the referece information over time, but meanwhile, feel free to update the wiki yourself with examples of your work.
+
Here are some links that will assist scripters in discovering more about the new features. We will update the reference information over time, but meanwhile, feel free to update the wiki yourself with examples of your work.
  
* [[Asynchronous_Route_Streaming]] - 'Explanation of the new streaming process'
+
* [[Asynchronous_Route_Streaming]] - An overview of route streaming and how it affects script
* [[Category_List]] - 'List of categories to identify how the asset is used within Trainz that can be used by scripters'
+
* [[Category_List]] - Lists asset category codes, which are used to identify or search for assets by type/capability
 +
* [[Session_Rule_Implementation]] - A script-focused overview of correct Session Rule behavior
 
* [http://forums.auran.com/trainz/showthread.php?133200-Internal-test-build-83648 TrainzDev forum thread]
 
* [http://forums.auran.com/trainz/showthread.php?133200-Internal-test-build-83648 TrainzDev forum thread]
 
* [http://forums.auran.com/trainz/showthread.php?137463-Sniffing-messages-sent-to-gameobjects-may-be-not-loaded Sniffing Messages forum thread]
 
* [http://forums.auran.com/trainz/showthread.php?137463-Sniffing-messages-sent-to-gameobjects-may-be-not-loaded Sniffing Messages forum thread]
Line 42: Line 43:
 
* [https://forums.auran.com/trainz/showthread.php?143549-Category-filter-in-GetNamedObjectList(-)-for-TrackMarks-and-Triggers&highlight=GameObjectID GameObjectID forum thread]
 
* [https://forums.auran.com/trainz/showthread.php?143549-Category-filter-in-GetNamedObjectList(-)-for-TrackMarks-and-Triggers&highlight=GameObjectID GameObjectID forum thread]
 
* [https://forums.auran.com/trainz/showthread.php?140135-Deriving-GameObject-from-object-name-in-SP2&highlight=GetNamedObjectList Deriving GameObject from object name in SP2]
 
* [https://forums.auran.com/trainz/showthread.php?140135-Deriving-GameObject-from-object-name-in-SP2&highlight=GetNamedObjectList Deriving GameObject from object name in SP2]
 +
 +
=Scripting in TRS19 and beyond=
 +
From June 2022 assets uploaded to the Download Station with scripts using obsolete methods will be rejected.  In addition to the above information, a number of WiKi pages specifically address how these obsolete methods can be replaced. See:
 +
 +
* [[HowTo/Upgrade_obsolete_script_functions]] - A hub for how to upgrade/replace uses of various obsolete script functions.
 +
* [[HowTo/Search_for_objects_in_the_world]] - A discussion, with examples, of commonly used searches.
 +
* [[HowTo/Upgrade obsolete script functions - simple examples]] - Practical examples of fixing the more simple obsolete functions.
  
 
=Feedback=
 
=Feedback=

Latest revision as of 13:14, 26 August 2022

Contents

[edit] Script References

TrainzScript Language Reference - learn the syntax and runtime environment of the TrainzScript language.

TrainzScript Library Reference - read through the API documentation of the system libraries included with Trainz.

TrainzScript Message Reference - documentation covering the messaging system in Trainz.

Getting Started in TrainzScript - tutorials covering the first steps in writing asset scripts.

iTrainz - learn how to establish communication between scripts running on different users' machines and manage persistent data keyed to the local user's account.

TrackSearch - perform runtime analysis of the track layout of a route, including junctions, signalling and trains.

TrainzScript User Interface - implementing user interfaces in TrainzScript.

New TrainzScript Features - TS2009 - recent additions to the scripting environment (TS2009).


[edit] Script usage within Trainz

Scripted Assets - customize the behavior of your content using script.

Session Rules - create flexible rules which act as building blocks and allow scripters and non-scripters to configure their sessions.

Script Libraries - implement reusable library code and distribute it as a standalone asset, allowing yourself or other scripters to make use of your functions without embedding a specific version of your code within each new asset.

Object Instance Scripts - customise a specific object instance within a route or session without the need to create a unique asset.

iTrainz Servlets - develop server scripts for the iTrainz environment.

Incubator - a home for new script technologies.

[edit] Scripting in Trainz A New Era SP2 and beyond

With TANE SP2 and beyond, we are introducing some major differences in the way routes are loaded and saved. Since we are moving towards information being streamed in as required, scripts will need to be updated to handle these new methods.

Here are some links that will assist scripters in discovering more about the new features. We will update the reference information over time, but meanwhile, feel free to update the wiki yourself with examples of your work.

[edit] Scripting in TRS19 and beyond

From June 2022 assets uploaded to the Download Station with scripts using obsolete methods will be rejected. In addition to the above information, a number of WiKi pages specifically address how these obsolete methods can be replaced. See:

[edit] Feedback

Script Feature Requests - have a cool idea, but missing that one crucial API? Request it here.


[edit] Categories

Personal tools