HowTo/Create an Interactive Session

From TrainzOnline
< HowTo(Difference between revisions)
Jump to: navigation, search
(Return to How To Index: added Category:How-to guides.)
m (Layers: added link to Layers wiki page)
 
(40 intermediate revisions by 9 users not shown)
Line 1: Line 1:
The Trainz session concept is very powerful. Unfortunately, all most people use it for is adding consists to a route, assigning some AI orders, and setting a few basic startup settings for the session in the default rules.
+
The Trainz [[session|"Session"]] concept is very powerful and yet also easy enough that anyone can create their own Sessions. The simplest Session involves adding consists to a route, assigning some AI orders, and setting a few basic startup settings for the session in the default rules.
  
This document is a quick introduction to sessions aimed at getting people to think beyond this most basic level of session, and to take more advantage of the power and flexibility of the session concept.
+
This document is a quick introduction to sessions aimed at getting people to think beyond that most basic level, and to take advantage of the power and flexibility of the session concept.
  
I am going to assume you are familiar with driver, and basic surveyor usage including placing scenery and trains. If this doesn't sound like you, then you may need a more basic introduction to Trainz Driver and Surveyor first.
+
It assumes you are familiar with Driver and basic Surveyor usage including placing scenery and trains. If you aren't familiar with these concepts, then you may need a more basic introduction to Trainz [[Driver]] and [[Surveyor]] and go through the [[HowTo/Create your first Session]] tutorial. For a more detailed look at Session Rules and how they operate, check out [[Session_Rules_Overview]].
  
=Your first interactive session=
 
  
It's time to create your first session.
+
=Creating an interactive session=
  
In the routes menu, find the route 'Springfield Industrial District' (you may have to unselect 'show only favorite routes'). I'm going to use this route because it's small, and everyone has a copy. Show the sessions, and then click 'new session'.
+
You might be interested in our Twitch TV video tutorial [https://youtu.be/sI6jzb3i4Tw HERE] on session creation.
 +
 
 +
In the routes menu, find the route 'Springfield Industrial District' (you may have to unselect 'show only favorite routes'). This example uses this route because it's small, and it is built-in with Trainz 12. Show the sessions, and then click 'new session'.
  
 
Place a CHN ND5-1 on one of the turntable tracks, and a CHN G70K tanker in the yard next to the turntable.
 
Place a CHN ND5-1 on one of the turntable tracks, and a CHN G70K tanker in the yard next to the turntable.
Line 17: Line 18:
 
Now open the 'Edit Session' dialog on the main menu. Change the session name and type something in for the description.
 
Now open the 'Edit Session' dialog on the main menu. Change the session name and type something in for the description.
  
If you are using TS2010, you should have something that looks roughly like this:
+
You should have something that looks roughly like this:
  
 
[[Image:Session-tutorial-1.jpg|640px]]
 
[[Image:Session-tutorial-1.jpg|640px]]
  
Remove the 'ConsistDataHandler' and 'QuickDrive' rules. Nice though they are, we don't want the player of this session to be able to arbitrarily create new vehicles.
+
If you are using [[TS2010]], remove the 'ConsistDataHandler' and 'QuickDrive' rules. Nice though they are, we don't want the player of this session to be able to arbitrarily create new vehicles. To delete the rule, click on it to select it, and then click the 'Delete' button.
 
+
To delete the rule, click on it to select it, and then click the 'Delete' button.
+
  
Note: If you are using TS12 or Trainz Mac, you won't have 'startup options' - 'QickDrive' has taken over this role. So instead of deleting those two rules, edit the 'QuickDrive' rule (highlight it and click the 'Edit' button), and check the "Gameplay Session" option in the QuickDrive options. Save the changes.
+
Note: If you are using [[TS12]], [[Trainz Simulator Mac]], or later, then you won't have 'startup options' - '[[QuickDrive]]' has taken over this role. So instead of deleting those two rules, edit the 'QuickDrive' rule (highlight it and click the 'Edit' button), and tick the "Gameplay Session" option in the QuickDrive options. Save the changes.
  
 
==Adding a displayed score==
 
==Adding a displayed score==
  
Add the 'Display Custom HUD' rule - click 'add', find 'Display Custom HUD' in the list, select it, and click the tick button.
+
Add the [[Display Custom HUD Rule]] - click 'add', find 'Display Custom HUD' in the list, select it, and click the tick button.
  
Add a 'Variable Modify' rule. Once you've added this, click the 'Edit' button, and you can set the rule properties. Anything you can click on is underlined. Click on 'Add', and set this to 'Change'. Also set the number to '0'. It should look like this:
+
Add a [[Variable Modify Rule]]. Once you've added this, click the 'Edit' button, and you can set the rule properties. Anything you can click on is underlined. Click on 'Add', and set this to 'Change'. Also set the number to '0'. It should look like this:
  
 
[[Image:Session-tutorial-2.jpg|640px]]
 
[[Image:Session-tutorial-2.jpg|640px]]
  
Confirm these changes by ticking the 'Properties' dialog.
+
Confirm these changes by clicking the tick button on the 'Properties' dialog.
  
Add a 'Variable Show' rule.
+
Add a [[Variable Show Rule]].
  
 
==Checking the user makes a train correctly==
 
==Checking the user makes a train correctly==
  
Add a 'consist check' rule. Select 'Complete whenever a train matching the description exists'. This opens up several more options. Under 'Specific Vehicles', click the plus, and add our ND5. Repeat this and add the G70K as well. Also tick 'Enforce strict exclusive checking'. It should look like this:
+
Add a [[Consist Check Rule]]. Select 'Complete whenever a train matching the description exists'. This opens up several more options. Under 'Specific Vehicles', click the plus, and add our ND5. Repeat this and add the G70K as well. Also tick 'Enforce strict exclusive checking'. It should look like this:
  
 
[[Image:Session-tutorial-3.jpg|640px]]
 
[[Image:Session-tutorial-3.jpg|640px]]
Line 47: Line 46:
 
'Enforce strict exclusive checking' will make the consist check rule check the consist more thoroughly - so if someone picks up too many vehicles in the yard, it won't trigger.
 
'Enforce strict exclusive checking' will make the consist check rule check the consist more thoroughly - so if someone picks up too many vehicles in the yard, it won't trigger.
  
Confirm these changes by ticking the 'Properties' dialog.
+
Confirm these changes by clicking the tick button on the 'Properties' dialog.
  
 
Finally, Add a 'Variable Modify' rule at the bottom, under 'Consist Check'. We will click the right arrow button once to indent the rule one level to the right.
 
Finally, Add a 'Variable Modify' rule at the bottom, under 'Consist Check'. We will click the right arrow button once to indent the rule one level to the right.
Line 57: Line 56:
 
==Driving your first session==
 
==Driving your first session==
  
Let's try this out in driver now.
+
Let's try this out in Driver now.
  
Click on the driver button next to the main menu. Save the session. (If it asks to save the map, you've done something wrong - did you place the trains in the wrong layer?)
+
Click on the Driver button next to the main menu. Save the session. (If it asks to save the map, you've done something wrong - did you place the trains in the wrong layer?)
  
In driver, you should see the 'Custom HUD' panel, and in it, an extra field labelled 'Score'. It should be zero.
+
In Driver, you should see the 'Custom HUD' panel, and in it, an extra field labelled 'Score'. It should be zero.
 
Take the ND5 over to the G70K tanker, and couple up to it. If the rules are set up right, 'Score' should change to '1'.
 
Take the ND5 over to the G70K tanker, and couple up to it. If the rules are set up right, 'Score' should change to '1'.
  
Line 72: Line 71:
 
==Configuring an industry==
 
==Configuring an industry==
  
Configure 'Palmer Chemicals', by clicking on the industry track (between the two arrows) with the question mark icon from the 'scenery' tab. This is a 'multiple industry new' track. As this is a new session, it won't have any configuration yet - so we'll need to add some.
+
Configure 'Palmer Chemicals', by clicking on the industry track (between the two arrows) with the question mark icon from the 'scenery' tab. This is a 'multiple industry new' track. As this is a new session, it won't have any configuration yet - so we'll need to add some. See [[HowTo/Configure an Interactive Industry]] for details.
 
+
On the 'Queues' page, add 'Aviation Fuel' to queue1.
+
 
+
[[Image:multiple-industry-new-1.jpg|420px]]
+
 
+
On the 'Products' page, change Aviation Fuel from 'Tonnes' to 'Litres'.
+
 
+
[[Image:multiple-industry-new-4.jpg|420px]]
+
 
+
Back on the 'Queues' page, set the size of Queue1 to be 100000, and set it's initial amount of Aviation Fuel to be that too.
+
 
+
On the 'Tracks' page, add Aviation Fuel, and set it's mode to 'Load into Vehicle'.
+
 
+
[[Image:multiple-industry-new-2.jpg|420px]]
+
 
+
On the 'Processes' page, add Aviation Fuel ''after'' the arrow, and set it to produce 10000 at a time.
+
 
+
[[Image:multiple-industry-new-3.jpg|420px]]
+
 
+
Now we have an industry that makes Aviation fuel, and will load it into vehicles.
+
  
 
==Checking the user uses the industry==
 
==Checking the user uses the industry==
Line 104: Line 83:
 
Tick the Properties dialog.
 
Tick the Properties dialog.
  
Now add a 'Variable Modify' rule below the 'Resource Check' rule, configure it to add one to the variable 'score', and indent it one step to the right. Your session rules should look like this:
+
Now add a 'Variable Modify' rule below the [[Resource Check Rule]], configure it to add one to the variable 'score', and indent it one step to the right. Your session rules should look like this:
  
 
[[Image:Session-tutorial-6.jpg|640px]]
 
[[Image:Session-tutorial-6.jpg|640px]]
Line 110: Line 89:
 
==Testing the extended session==
 
==Testing the extended session==
  
Now let's try this out in driver. Couple the ND5 to the tanker as before. The score should update to 1 when you do this. Now take the wagon up the hill to Palmer Chemicals.
+
Now let's try this out in Driver. Couple the ND5 to the tanker as before. The score should update to 1 when you do this. Now take the wagon up the hill to Palmer Chemicals.
  
 
Stop the wagon next to the three pink tanks, and wait for it to load. Once it is loaded, the score should update to 2.
 
Stop the wagon next to the three pink tanks, and wait for it to load. Once it is loaded, the score should update to 2.
Line 145: Line 124:
  
 
==Penalising Derailments==
 
==Penalising Derailments==
''TBD''
+
click the add button in session rules and look for the rule "wait for derailment" add this in your session rules. this rule detects when a train derails then add a child rule end session since a derailment will mean the locomotive will no longer work end the session now
  
 
==Adding a 'session complete' achievement==
 
==Adding a 'session complete' achievement==
 
''TBD''
 
''TBD''
 
 
 
 
 
  
 
=Hints and Tips=
 
=Hints and Tips=
Line 165: Line 139:
 
A good tip is to lock the route layer(s). This will help prevent accidental editing of the route layers.
 
A good tip is to lock the route layer(s). This will help prevent accidental editing of the route layers.
  
Pay particular attention to layers if you use the 'quicklaunch' feature to launch driver direct from surveyor and return to surveyor afterwards. The layer you had selected before probably won't still be selected afterwards, so you'll need to check it every time you return from Driver.
+
Pay particular attention to layers if you use the 'quicklaunch' feature to launch Driver direct from Surveyor and return to Surveyor afterwards. The layer you had selected before probably won't still be selected afterwards, so you'll need to check it every time you return from Driver.
 +
 
 +
Detailed information on using layers can be found at [[How_to_Use_Layers]].
  
 
=='Base session' assets==
 
=='Base session' assets==
Line 175: Line 151:
 
==Default rules==
 
==Default rules==
  
In the 'Edit Session' dialog in TS2010, we have six rules by default.
+
In the 'Edit Session' dialog in TS2010, there are six rules by default.
* 'Startup options' allows us to specify the control mode for the session, the weather, the start time, and a few other bits'n'pieces.
+
* '[[Startup Options Rule]]' - Sets the control mode for the session, the weather, the start time, and a few other bits and pieces.
* 'Driver setup' allows us to assign drivers to trains, and optionally give those drivers AI orders.
+
* '[[Driver Setup Rule]]' - Performs the assignment drivers to trains, and optionally gives those drivers AI orders.
* 'Driver Commands' allows us to specify what orders can be assigned to AI drivers in the session.
+
* '[[Driver Commands Rule]]' - Controls what orders can be assigned to AI drivers in the session.
* 'Clean up Derailed Trains' will mop up derailed vehicles.
+
* '[[Clean up Derailed Trains Rule]]' - Will mop up derailed vehicles.
* 'ConsistDataHandler Rule' is used by QuickDrive
+
* '[[ConsistDataHandler Rule]]' - Is used by QuickDrive to manage train placement (largely obsolete as of TS12).
* 'QuickDrive Rule' provides the quick drive interface that allows you to create consists and so on in driver.
+
* '[[QuickDrive Rule]]' - Provides the quick drive interface that allows you to create consists and so on in Driver.
  
TS12 and Trainz Mac does not have 'Startup Options' - 'QuickDrive' now performs that role.
+
TS12 and Trainz Simulator Mac do not have 'Startup Options', 'QuickDrive' now performs that role.
  
As a general rule, for a pre-planned interactive session, you probably don't want to permit the human driver to issue AI orders, or to be able to use the features of QuickDrive.
+
As a general rule, for a pre-planned interactive session you probably don't want to permit the human driver to issue AI orders, or to be able to use the features of QuickDrive.
  
However, you probably want to be able to issue AI orders to background AI traffic while making the session, and you'll certainly need to fix those orders later when it turns out they don't quite do what you wanted them to. If you turn them off now, you'll have to turn them back on again when doing these operations - so my advice would be to only turn them off (by unticking them all) in 'Driver Commands' at the end of the creation process, once the session is finished. It'll get too annoying to keep turning them on and off when you need to fix problems with the background AI otherwise.
+
However, you probably want to be able to issue AI orders to background AI traffic while making the session, and you'll certainly need to fix those orders later if it turns out they don't quite do what you wanted them to. If you turn them off now, you'll have to turn them back on again when doing these operations - so my advice would be to only turn them off (by unticking them all) in 'Driver Commands' at the end of the creation process, once the session is finished. It will get too annoying to keep turning them on and off when you need to fix problems with the background AI otherwise.
  
With TS2010, QuickDrive will unfortunately have to be removed from the rules list. It'd be way too easy for people to cheat using it.
+
With TS2010, QuickDrive will have to be removed from the rules list if you're worried about people using it to "cheat".
  
With TS12 and Trainz Mac, it is possible to disable the advanced features of quickdrive, but still use it's better Cab/DCC mode selection screen - simply tick the 'Gameplay Session' checkbox in the QuickDrive options. This will deny the player access to the parts of QuickDrive which would cause problems in an interactive session.
+
With TS12 and Trainz Mac, it is possible to disable the advanced features of QuickDrive, but still use it's better Cab/DCC mode selection screen - simply tick the 'Gameplay Session' checkbox in the QuickDrive options. This will deny the player access to the parts of QuickDrive which would cause problems in an interactive session.
  
= Return to How To Index =
+
==See Also==
+
* [[Session_Rules_Overview]]
[[HowToGuides]]
+
  
 
[[Category:How-to guides]]
 
[[Category:How-to guides]]

Latest revision as of 07:01, 30 November 2019

The Trainz "Session" concept is very powerful and yet also easy enough that anyone can create their own Sessions. The simplest Session involves adding consists to a route, assigning some AI orders, and setting a few basic startup settings for the session in the default rules.

This document is a quick introduction to sessions aimed at getting people to think beyond that most basic level, and to take advantage of the power and flexibility of the session concept.

It assumes you are familiar with Driver and basic Surveyor usage including placing scenery and trains. If you aren't familiar with these concepts, then you may need a more basic introduction to Trainz Driver and Surveyor and go through the HowTo/Create your first Session tutorial. For a more detailed look at Session Rules and how they operate, check out Session_Rules_Overview.


Contents

[edit] Creating an interactive session

You might be interested in our Twitch TV video tutorial HERE on session creation.

In the routes menu, find the route 'Springfield Industrial District' (you may have to unselect 'show only favorite routes'). This example uses this route because it's small, and it is built-in with Trainz 12. Show the sessions, and then click 'new session'.

Place a CHN ND5-1 on one of the turntable tracks, and a CHN G70K tanker in the yard next to the turntable.

[edit] Setting the initial startup options

Now open the 'Edit Session' dialog on the main menu. Change the session name and type something in for the description.

You should have something that looks roughly like this:

Session-tutorial-1.jpg

If you are using TS2010, remove the 'ConsistDataHandler' and 'QuickDrive' rules. Nice though they are, we don't want the player of this session to be able to arbitrarily create new vehicles. To delete the rule, click on it to select it, and then click the 'Delete' button.

Note: If you are using TS12, Trainz Simulator Mac, or later, then you won't have 'startup options' - 'QuickDrive' has taken over this role. So instead of deleting those two rules, edit the 'QuickDrive' rule (highlight it and click the 'Edit' button), and tick the "Gameplay Session" option in the QuickDrive options. Save the changes.

[edit] Adding a displayed score

Add the Display Custom HUD Rule - click 'add', find 'Display Custom HUD' in the list, select it, and click the tick button.

Add a Variable Modify Rule. Once you've added this, click the 'Edit' button, and you can set the rule properties. Anything you can click on is underlined. Click on 'Add', and set this to 'Change'. Also set the number to '0'. It should look like this:

Session-tutorial-2.jpg

Confirm these changes by clicking the tick button on the 'Properties' dialog.

Add a Variable Show Rule.

[edit] Checking the user makes a train correctly

Add a Consist Check Rule. Select 'Complete whenever a train matching the description exists'. This opens up several more options. Under 'Specific Vehicles', click the plus, and add our ND5. Repeat this and add the G70K as well. Also tick 'Enforce strict exclusive checking'. It should look like this:

Session-tutorial-3.jpg

'Enforce strict exclusive checking' will make the consist check rule check the consist more thoroughly - so if someone picks up too many vehicles in the yard, it won't trigger.

Confirm these changes by clicking the tick button on the 'Properties' dialog.

Finally, Add a 'Variable Modify' rule at the bottom, under 'Consist Check'. We will click the right arrow button once to indent the rule one level to the right.

This means this rule will not take effect immediately, but will be triggered by the 'Consist Check' rule, when the consist exists.

Now tick the 'Edit Session' dialog.

[edit] Driving your first session

Let's try this out in Driver now.

Click on the Driver button next to the main menu. Save the session. (If it asks to save the map, you've done something wrong - did you place the trains in the wrong layer?)

In Driver, you should see the 'Custom HUD' panel, and in it, an extra field labelled 'Score'. It should be zero. Take the ND5 over to the G70K tanker, and couple up to it. If the rules are set up right, 'Score' should change to '1'.

Session-tutorial-4.jpg

[edit] Adding a pickup task at an industry

Okay, let's take this a stage further. Go back to surveyor, and set the current layer to the session layer in the layers tab.

[edit] Configuring an industry

Configure 'Palmer Chemicals', by clicking on the industry track (between the two arrows) with the question mark icon from the 'scenery' tab. This is a 'multiple industry new' track. As this is a new session, it won't have any configuration yet - so we'll need to add some. See HowTo/Configure an Interactive Industry for details.

[edit] Checking the user uses the industry

Go back to the 'Edit Session' dialog. At the bottom, add a 'Resource Check' rule. Edit the resource check rule.

Pick the 'Watch Vehicle Queue' option. Within this, set 'CHN G70K Tanker' as the target object. Set the queue to be 'liquid' (there should be only one option). Set the product to be Aviation Fuel. Set the amount to be '72040' (you can actually type in '99999' and it'll autocorrect to the maximum size of the queue if it's larger than what the queue can hold). Ensure 'Complete when the designated queue equals or exceeds required amount' is set. It should look like this:

Session-tutorial-5.jpg

Tick the Properties dialog.

Now add a 'Variable Modify' rule below the Resource Check Rule, configure it to add one to the variable 'score', and indent it one step to the right. Your session rules should look like this:

Session-tutorial-6.jpg

[edit] Testing the extended session

Now let's try this out in Driver. Couple the ND5 to the tanker as before. The score should update to 1 when you do this. Now take the wagon up the hill to Palmer Chemicals.

Stop the wagon next to the three pink tanks, and wait for it to load. Once it is loaded, the score should update to 2.

Session-tutorial-7.jpg

[edit] Adding a delivery task at an industry

And another stage. Go back to surveyor, and reselect the session layer.

Go to the airport, and in it's properties, set it's Aviation Fuel queue to start at Zero and consume Zero.

Now in 'Edit Session', add another 'Resource Check' rule to the bottom of the list. Configure this one to watch an industry queue on 'Local Airport'. There will be several queues here - you want 'av_in_q', with product 'Aviation Fuel'. We're going to watch for 144000 units, and complete when the queue equals or exceeds the required amount.

It should look like this:

Session-tutorial-8.jpg

Underneath and indented beyond this, we're going to need another Variable Modify rule.

When we test this in Driver, we'll need to fill the tanker twice - and deliver two loads. Only at the second load will the score go to 3.

[edit] Checking vehicles are left in designated places

TBD

[edit] Adding instructions

TBD

[edit] Penalising Speeding

TBD

[edit] Penalising Passing Red Signals

TBD

[edit] Penalising Derailments

click the add button in session rules and look for the rule "wait for derailment" add this in your session rules. this rule detects when a train derails then add a child rule end session since a derailment will mean the locomotive will no longer work end the session now

[edit] Adding a 'session complete' achievement

TBD

[edit] Hints and Tips

Some background information you may find useful.

[edit] Layers

TS2010 introduced the concept of layers to Trainz, and when working on a session, you will need to use them. The key thing is that this allows you to add most types of Trainz assets to the session, which previously could only be used in a route. As well as the usual Traincars, this can be scenery objects, trackside objects, even splines.

A good tip is to lock the route layer(s). This will help prevent accidental editing of the route layers.

Pay particular attention to layers if you use the 'quicklaunch' feature to launch Driver direct from Surveyor and return to Surveyor afterwards. The layer you had selected before probably won't still be selected afterwards, so you'll need to check it every time you return from Driver.

Detailed information on using layers can be found at How_to_Use_Layers.

[edit] 'Base session' assets

Some routes come with a 'base session'. This generally has pre-configured settings for industries and other scripted assets in it. You may find, should your chosen map depend heavily on multiple industry assets or other similar scripted content, that you may need to base your session on a 'base session' asset, rather than creating a new session.

In this case, the default rules list may differ - as it may have been created in a different version of Trainz, or the route creator may have decided to change a few things. Feel free to add any missing rules you want, or remove extras you don't.

[edit] Default rules

In the 'Edit Session' dialog in TS2010, there are six rules by default.

TS12 and Trainz Simulator Mac do not have 'Startup Options', 'QuickDrive' now performs that role.

As a general rule, for a pre-planned interactive session you probably don't want to permit the human driver to issue AI orders, or to be able to use the features of QuickDrive.

However, you probably want to be able to issue AI orders to background AI traffic while making the session, and you'll certainly need to fix those orders later if it turns out they don't quite do what you wanted them to. If you turn them off now, you'll have to turn them back on again when doing these operations - so my advice would be to only turn them off (by unticking them all) in 'Driver Commands' at the end of the creation process, once the session is finished. It will get too annoying to keep turning them on and off when you need to fix problems with the background AI otherwise.

With TS2010, QuickDrive will have to be removed from the rules list if you're worried about people using it to "cheat".

With TS12 and Trainz Mac, it is possible to disable the advanced features of QuickDrive, but still use it's better Cab/DCC mode selection screen - simply tick the 'Gameplay Session' checkbox in the QuickDrive options. This will deny the player access to the parts of QuickDrive which would cause problems in an interactive session.

[edit] See Also

Personal tools