HowTo/Create a Behavior Template

From TrainzOnline
< HowTo(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
Session [[KIND_Behavior-Template|Rule Templates]] allow Session creators to quickly and easily save and reuse common rule configurations. This page is a short guide to creating, editing and using Session Rule Templates.
+
Session [[KIND_Behavior-Template|Rule Templates]] (AKA Behavior templates) allow Session creators to quickly and easily save and reuse common rule configurations. This page is a short guide to creating, editing and using Session Rule Templates.
  
 
==Creation Methods==
 
==Creation Methods==
Line 6: Line 6:
  
 
There are 3 ways that a new template can be created:
 
There are 3 ways that a new template can be created:
1. By creating a new blank template
+
# By creating a new blank template
2. By editing an existing template
+
# By editing an existing template
3. From an existing set of rules
+
# From an existing set of rules
  
 
Option 1 will give you a completely blank slate to start with, and is only recommended for players familiar with templates and the editing interface. Option 2 is a useful starting point if you have an existing template that you want to modify. Option 3 is the most common (and easiest) method of creation, and is what we will focus on for the majority of this guide.
 
Option 1 will give you a completely blank slate to start with, and is only recommended for players familiar with templates and the editing interface. Option 2 is a useful starting point if you have an existing template that you want to modify. Option 3 is the most common (and easiest) method of creation, and is what we will focus on for the majority of this guide.
  
It's important to note that no matter which creation method is chosen, the edit interface will be identical, as will the final asset.
+
It's important to note that no matter which creation method is chosen, the edit interface final asset(s) will be identical.
 +
 
 +
====New Blank Template====
 +
 
 +
To create a new blank template, click the "Add" button on the bottom of the Edit Session dialog, and select the "New Blank Template" option from the list.
 +
 
 +
This will open a completely blank version of the edit interface. From here you will need to give your template a name, description, and then add and configure all of the desired rules. When you close the dialog a new template asset will be created, and a new instance of it will be added to the rules list. If you make a mistake or need to tweak the asset, you can edit it later using method 2, described below.
 +
 
 +
====Editing an Existing Template====
 +
 
 +
To edit an existing rule template asset, locate it in the rules list, right-click on it, and select the "Edit template" option from the displayed context menu. If the selected template asset was not created by you, or is builtin to Trainz or on the Download Station, then you may instead see the "Clone template" or "Create new template version" option. These all have similar behavior, but save the modified asset in slightly different ways.
 +
 
 +
If you don't have a Session which uses the template asset, you can create one, add an instance of the desired template, edit it, save the asset changes, and then discard/delete the Session. Any changes made on the edit interface will be saved into the template asset itself, and affect all future uses of that asset.
 +
 
 +
When you click "Edit template" (or one of the similar options) the template edit dialog will open pre-populated with the selected template data, including name, description and the current rule configuration. From here, you can make whatever changes are desired, and save them over the old asset or into a new one.
 +
 
 +
====Rules to Template Conversion====
 +
 
 +
Most new template assets will be created from a pre-existing set of rules, usually because of a desire to copy existing functionality from one Session to another. For example, most structured Sessions make use of the "Wait for Derailment" Rule, which will then show a dialog (Message Popup Rule), and end the session (Ranked Session End, or End Session Rule). Rather than adding this sequence of rules over and over again in all of your sessions, you can create a rule template asset which lets you add it in one click.
 +
 
 +
To create a template in this way, you simply right-click on the parent asset in the rule list (e.g. the Wait for Derailment rule) and select "Create template" from the displayed context menu. This will open the rule template edit dialog, where you must give your new asset a name and description before it can be saved. Once you save the template, the rule(s) you created it from will be replaced with an instance of the template.
 +
 
 +
If this still sounds a little complicated, see Example 1 below, which will run through this same example step-by-step.
  
 
==Example 1 - Derailment Response==
 
==Example 1 - Derailment Response==

Revision as of 10:51, 14 October 2019

Session Rule Templates (AKA Behavior templates) allow Session creators to quickly and easily save and reuse common rule configurations. This page is a short guide to creating, editing and using Session Rule Templates.

Contents

Creation Methods

Rule Template assets are one of the few asset kinds that is created an edited entirely "in game". More specifically, they are created and edited via the rules list on the "Edit Session" dialog, which is opened from the Surveyor menubar.

There are 3 ways that a new template can be created:

  1. By creating a new blank template
  2. By editing an existing template
  3. From an existing set of rules

Option 1 will give you a completely blank slate to start with, and is only recommended for players familiar with templates and the editing interface. Option 2 is a useful starting point if you have an existing template that you want to modify. Option 3 is the most common (and easiest) method of creation, and is what we will focus on for the majority of this guide.

It's important to note that no matter which creation method is chosen, the edit interface final asset(s) will be identical.

New Blank Template

To create a new blank template, click the "Add" button on the bottom of the Edit Session dialog, and select the "New Blank Template" option from the list.

This will open a completely blank version of the edit interface. From here you will need to give your template a name, description, and then add and configure all of the desired rules. When you close the dialog a new template asset will be created, and a new instance of it will be added to the rules list. If you make a mistake or need to tweak the asset, you can edit it later using method 2, described below.

Editing an Existing Template

To edit an existing rule template asset, locate it in the rules list, right-click on it, and select the "Edit template" option from the displayed context menu. If the selected template asset was not created by you, or is builtin to Trainz or on the Download Station, then you may instead see the "Clone template" or "Create new template version" option. These all have similar behavior, but save the modified asset in slightly different ways.

If you don't have a Session which uses the template asset, you can create one, add an instance of the desired template, edit it, save the asset changes, and then discard/delete the Session. Any changes made on the edit interface will be saved into the template asset itself, and affect all future uses of that asset.

When you click "Edit template" (or one of the similar options) the template edit dialog will open pre-populated with the selected template data, including name, description and the current rule configuration. From here, you can make whatever changes are desired, and save them over the old asset or into a new one.

Rules to Template Conversion

Most new template assets will be created from a pre-existing set of rules, usually because of a desire to copy existing functionality from one Session to another. For example, most structured Sessions make use of the "Wait for Derailment" Rule, which will then show a dialog (Message Popup Rule), and end the session (Ranked Session End, or End Session Rule). Rather than adding this sequence of rules over and over again in all of your sessions, you can create a rule template asset which lets you add it in one click.

To create a template in this way, you simply right-click on the parent asset in the rule list (e.g. the Wait for Derailment rule) and select "Create template" from the displayed context menu. This will open the rule template edit dialog, where you must give your new asset a name and description before it can be saved. Once you save the template, the rule(s) you created it from will be replaced with an instance of the template.

If this still sounds a little complicated, see Example 1 below, which will run through this same example step-by-step.

Example 1 - Derailment Response

TDB

Example 2 - TDB

TDB

Categories

Personal tools