PDA

View Full Version : Programming track triggers in TS12?



conductorboy
November 28th, 2012, 11:30 AM
Hi all,
Is there a way to program a track trigger in trainz 12 to automatically play a sound like different radio communications? I have the MP3 format sound tracks here, but I'm not sure how to program them to a track trigger.

Can anybody tell me how to do this?

Thanks,
Cody

shaneturner12
November 28th, 2012, 11:32 AM
You would need to create assets for the sounds, then use Check Trackside and Play Sound rules.

Shane

conductorboy
November 28th, 2012, 11:35 AM
How would I do that?

Thanks,
Cody

shaneturner12
November 28th, 2012, 11:37 AM
It's a difficult task. Which bit do you need advice on? The hardest part would be creating the required sound assets.

Shane

conductorboy
November 28th, 2012, 11:40 AM
It's a difficult task. Which bit do you need advice on? The hardest part would be creating the required sound assets.

Shane


Well, I've never created an asset before........ I'd probably need advice/help with everything......

You're probably thinking "Oh boy, I got myself into a deep one now....";)

Thanks for the help,
Cody

shaneturner12
November 28th, 2012, 11:42 AM
Probably, as the only assets I've created are either route/session assets, or scripts.

Someone else should be along shortly to advise on the asset creation side, then I can help out with the session rules side.

Shane

conductorboy
November 29th, 2012, 02:35 PM
Probably, as the only assets I've created are either route/session assets, or scripts.

Someone else should be along shortly to advise on the asset creation side, then I can help out with the session rules side.

Shane

I created a sound asset for TS12 by following the instructions here:
http://trainz.christrup.net/TRS/tut1.html

Now, I just need to set that asset to go off at a trigger. Does anybody know how to do that?
Thanks,
Cody

shaneturner12
November 29th, 2012, 03:29 PM
To do that:

You will need a named trigger firstly, then the following:

Add the following rules, with the appropriate settings: (> = indentation)

CHECK TRACKSIDE [entry,trigger name,tick auto-reset)
>PLAY SOUND [sound asset]

Shane

conductorboy
November 29th, 2012, 03:35 PM
To do that:

You will need a named trigger firstly, then the following:

Add the following rules, with the appropriate settings: (> = indentation)

CHECK TRACKSIDE [entry,trigger name,tick auto-reset)
>PLAY SOUND [sound asset]

Shane

How do I add rules and do the settings, etc?

shaneturner12
November 29th, 2012, 03:39 PM
This may take a while...

You add the relevant rules in the Edit Session box in Surveyor.

To add a rule, use the Add button. To edit the settings, you will need to click the appropriate rule followed by the Edit button.

Shane

conductorboy
November 29th, 2012, 03:42 PM
This may take a while...

You add the relevant rules in the Edit Session box in Surveyor.

To add a rule, use the Add button. To edit the settings, you will need to click the appropriate rule followed by the Edit button.

Shane

So, I copy this (> = indentation) and add that as a rule?
Thanks,
Cody

shaneturner12
November 29th, 2012, 03:44 PM
There are buttons at the bottom of the Edit Session box for this purpose - the > button will indent a rule.

Shane

conductorboy
November 29th, 2012, 03:48 PM
There are buttons at the bottom of the Edit Session box for this purpose - the > button will indent a rule.

Shane

Ok, I indented it. Now, what?

Thanks, Cody

conductorboy
November 29th, 2012, 03:53 PM
I added a rule to the indented "trigger check" rule called "check trackside", then added the rule "play sound." NOW I understand. :) Only thing is how do I get the assett HTML?
Thanks

shaneturner12
November 29th, 2012, 03:55 PM
You would need to use your sound asset, or make use of it in an asset type known as html-asset.

Shane

conductorboy
November 29th, 2012, 03:58 PM
You would need to use your sound asset, or make use of it in an asset type known as html-asset.

Shane

How do I do that? I don't like to ask a lot of questions, but I guess it's better than messing up and doing something stupid in trainz.... ;)
Cody

shaneturner12
November 29th, 2012, 03:59 PM
It's not the easiest thing to explain - can you show me the config.txt file of one of your sound assets?

Shane

conductorboy
November 29th, 2012, 04:04 PM
kuid <kuid:448500:100034>username "nberpa"trainz-build 3.4category-class "OA"kind "scenery"description "This is an English radio communication file recorded on the Nittany & Bald Eagle Railroad located in Central Pennsylvania."category-era "2010s"category-region "US"mesh-table{ default { mesh "rednote.im" auto-create 1 }}thumbnails{ 0 { image "smalldog.jpg" width 240 height 180 }}soundscript{ nber02082012 { repeat-delay 10,30 distance 40,100 sound { 0 "nber 02082012 - Copy" } }}

There you go, Have at it!
Cody

shaneturner12
November 29th, 2012, 04:06 PM
Seems OK to me. I'm going to see if I can find a guide for HTML assets.

Shane

conductorboy
November 29th, 2012, 04:07 PM
ok, thanks!
Cody

RacerTodd
November 29th, 2012, 11:51 PM
Short version to making an asset of the type HTML-Asset:

Open Content Manager.

Click File in the menu, then "new asset". That makes a new asset under your KUID and it will be called "new asset".

Click on the newly created asset to highlight it, then right-click and select Edit|Edit in Content Creator Plus

Content Creator Plus opens. Your first choice is to select the type of the asset. Select HTML-Asset.

On the next screen enter in the "username" field the name of the asset. If I'm creating a session called "My cool session", I'll name the HTML asset for the session "My cool session HTML". That way I know this asset is the HTML asset for My Cool Session.

If you'd like to see the use of sound files and triggers, look on the DLS for my session "The Goldsboro Local", which is for the "Wilsons Mills and Mt. Olive" route. I made extensive use of "radio" communications from Dispatch. Sound files are placed in the HTML asset and triggers are used to play them at appropriate times in the session. The sound files need to be in WAV format, in mono and recorded at 22khz bit rate.

Todd

conductorboy
November 30th, 2012, 08:03 AM
Short version to making an asset of the type HTML-Asset:

Open Content Manager.

Click File in the menu, then "new asset". That makes a new asset under your KUID and it will be called "new asset".

Click on the newly created asset to highlight it, then right-click and select Edit|Edit in Content Creator Plus

Content Creator Plus opens. Your first choice is to select the type of the asset. Select HTML-Asset.

On the next screen enter in the "username" field the name of the asset. If I'm creating a session called "My cool session", I'll name the HTML asset for the session "My cool session HTML". That way I know this asset is the HTML asset for My Cool Session.

If you'd like to see the use of sound files and triggers, look on the DLS for my session "The Goldsboro Local", which is for the "Wilsons Mills and Mt. Olive" route. I made extensive use of "radio" communications from Dispatch. Sound files are placed in the HTML asset and triggers are used to play them at appropriate times in the session. The sound files need to be in WAV format, in mono and recorded at 22khz bit rate.

Todd

Ok, I started a new asset as an html-asset, but I can't right-click the html-asset folder in Content Creator plus and select add sound-script? How can I add the sound file to it? Copy and paste it into the New asset folder in explorer?

I thought I would start out as an html-asset, then follow the rest of this tutorial to finish it: http://trainz.christrup.net/TRS/tut1.html
Thanks,
Cody

RacerTodd
November 30th, 2012, 11:02 PM
I didn't use sound-scripts, so I can't help you there. Don't know anything about them.

Getting files into an asset:

1. Find your newly created html-asset.
2. Right-click on it and select Edit|Edit in Explorer. (or use Ctrl-Shift-E)
3. This opens a new Windows Explorer window. The window will show a folder with the same name as your asset (TS12\UserData\editing\name of the asset). You'll see all the files that are contained in the asset in that folder.
4. Copy your WAV file (or other file) to that folder.
5. Close the Windows Explorer window that CMP opened.
6. In CMP, select the asset. Notice the little black pickax-looking icon shows the item is read-only (because it's open for edit).
7. Right-click and select Edit|Commit. (or use Ctrl-M)

CMP now commits the asset and you'll be able to use it in Trainz.

I used this technique to get sound files, html files and config.txt files into the HTML asset for my Goldsboro Local session. I made the HTML files in Notepad, made changes to config.txt, created a screenshot JPG and then copied them into asset using this technique.
Have a working folder where you store, modify and test file to get them ready for the asset. Only copy them into the asset, don't cut and paste.

Todd