PDA

View Full Version : How do I set a trigger?


red-dragon
April 16th, 2009, 10:51 AM
:confused: I'm new to programming in surveyor. I kn ow it's a form of C.
I want to set a trigger that when a certain consist arrives at its ujnload point and has unloaded the consist is chaged from, say log cars to lumber carriers (that is uncouple the log cars then move the loco to another consist of lumber carriers, couple to it and take lumber from the sawmill to wherever its needed; smilarly for crude/diesel/fuel etc.
any help appreciated.
email :'( :'( george_wood1@btinternet.com.

fran1
April 16th, 2009, 11:13 AM
you've lost me a bit with your question. But here's the basics. Place a trigger, name it lumber, so when train 1 hits the trigger train 2(waiting for trigger lumber to be triggered) will carry out its orders. Have as many triggers as you want but you may have to specify which loco is to be the trigger loco otherwise train 2 will set of before you want it to. place 1 trigger to get you into the idea and then work from there.

john259
April 16th, 2009, 11:49 AM
In TRS2004 you can write scenarios in GameScript which is indeed a C-like language. This enables fully interactive activities to be created. This facility was withdrawn in later versions of Trainz. If you have TRS2004 then the API is in C:\Program Files\Auran\TRS2004\Scripts\docs\index.chm

In TRS2004, TRS2006, TC and TS2009 you can create driver sessions using what amounts to an IDE in Surveyor. The TRS2006 Rules And Sessions Guide (http://files.auran.com/TRS2006/manuals/TRS2006_Sessions_&_Rules_Guide%2831-Oct-2005%29.pdf) explains the process in detail. IMHO this is vastly more difficult than writing scenarios in GameScript but others will disagree with that point of view I'm sure. It is possible to make a driver session look very similar to a TRS2004 scenario but it is far from simple to do so.

Internally, driver sessions are also driven by GameScript, but confusingly so are other active game elements such as industries, load-carrying wagons and animated scenery objects. Therefore people creating these items need to know GameScript, but people using them in the Surveyor IDE don't. The GameScript API for TRS2006 can be downloaded here (http://files.auran.com/TRS2006/manuals/TRS2006-API.zip).

HTH, John

EDIT: I forgot to mention Trainz Pro Routes' excellent SCS (Scenario Creation System) available free of charge from their web site.

Skrogsgorks
April 21st, 2009, 10:58 AM
I want to set a trigger that when a certain consist arrives at its ujnload point and has unloaded the consist is chaged from, say log cars to lumber carriers (that is uncouple the log cars then move the loco to another consist of lumber carriers, couple to it and take lumber from the sawmill to wherever its needed; smilarly for crude/diesel/fuel etc.

No need for triggers... When the loco arrives with the logs, have it uncouple from the log consist then, couple to the consist of lumber and continue it's journey.

Now, having said that. If you have TWO locos (one with a log consist and another with a lumber consist) you could place a trigger beyond the log drop off (use the log train as a measurement for the trigger placement). When the log train has delivered and reaches the trigger, then the lumber train will proceed to pickup it's load.

Additionally, there are commands available that will check the status of industries, then once they need servicing you can have a train deliver to them or pick up from them.

prdarby
September 28th, 2009, 04:50 PM
Now, having said that. If you have TWO locos (one with a log consist and another with a lumber consist) you could place a trigger beyond the log drop off (use the log train as a measurement for the trigger placement). When the log train has delivered and reaches the trigger, then the lumber train will proceed to pickup it's load.




Now, I've been trawling through this forum trying to find out how to do pretty much what is described here. I want to run a train into a station, uncouple the last two or three carriages, and leave, which would trigger a second loco to run down, couple to the carriages left behind and take them onto a branch. In TRS2006 there is a Wait for Trigger command, but I'm now working in TC and that command isn't in there. I have absolutely no idea about writing my own scripts, nor really the inclination. Any help, anyone?

rweber95
September 28th, 2009, 09:59 PM
You might check out atilabarut's message rules. Download these and read:
PostMessage,<kuid:131986:210002>
WaitForMessage,<kuid:131986:1029>
WaitForMessage,<kuid:131986:210005>
You can put these rules in the driver schedule without the need for programming expertise.

Bob