Portal

xcandiottix

New member
I had brushed this topic before in a previous post but had no responses so I was wondering if anyone can help me now. I am semi-new to trainz and I enjoy route building but the task of scripting and modding items seems daunting to me. My objective for my route is to create some "Off-Board" industry. I would like to use portals to represent different industries that are out of the region of my layout. For example, I would like my Main Yard to put together consists of coal trains to send to the power company. I do not want to actually have the power company building modeled on the layout so I need a Portal that is not only designated as the "Power Company" but also requests coal much like a multi-industry track. I've tried laying the mult-indusrty track before the portal but only half the train gets "consumed." I hate to have the extra step of telling the driver to unload at a blank indutry track and then order it to proceede to the portal. Can anyone suggest how to script the portal to also act as an industry track? I see that the Portal knows if an inbound train is loaded or empty, is there way it can request a load and calculate how much has been delievered? Any suggestions would be most appreciated.
 
One thing that might help you is the Instant Load and Instant Unload Driver commands, that you can use to force Portals to produce a loaded consist - the driver fully loads the consist with whatever the default product is for each wagon. They're on the DLS, I use Instant Load to produce a loaded coal train for a power station. I'm not sure how you'd implement the off-board industry you want though, sorry.
 
One thing that might help you is the Instant Load and Instant Unload Driver commands, that you can use to force Portals to produce a loaded consist - the driver fully loads the consist with whatever the default product is for each wagon. They're on the DLS, I use Instant Load to produce a loaded coal train for a power station. I'm not sure how you'd implement the off-board industry you want though, sorry.

knight42 is spot on. The 'Instant Load' and 'Instant Unload' rules/commands are your answer. You can download them from DLS and, once installed you simply enable them through your Layout/Session settings.

The cars in the train, no matter the type, will load (if empty) or unload (if carrying any amount of cargo) once they pass into and then out of the portal.

As far as, "is there way it can request a load and calculate how much has been delievered?" I have found nothing that does that calculation for you. There are some rules/scripts on the DLS that bring up a menu of industries on you layout, the commodities they produce/consume, and if I remember right, the amount of those commodities being produced/needed.
 
Last edited:
The only problem that I see with the instant unload/load is that although the train will load or unload, the portal itself (Electric Company Portal) will never produce a waybill requesting another delivery, right?
I was looking at portal commands in the game and the ones that come with TS06 and 09 have a portal which can be set to load and unloaded or unload a loaded train that enters it. The hang up is that if one represents the power company, the loads to the power station will be inconsistent because I'll be sending consists when I think of it, not when it produces a waybill for delivery.
I think then, other then figuring out how to make my own object to do what I want, is to just leave the coal delivery up to the AI to deliver since I can set how often the AI driver comes, goes, and waits.
 
A portal isn't designed to act as an industry so it won't produce a waybill, no. I've been thinking about something similar, and what I came up with was a Rule that could be added which would act as a kind of "virtual industry" which would trigger a train from a specified portal which would have a specific set of commands to deliver a product, or perhaps would simpy trigger a portal which would have a single train to produce. I'm going to tackle this at some point as I want to learn scripting in Trainz, but I don't know when or how long it's likely to take, or even if it's feasible.
 
Yeah, I'm in the same position myself... i think I could just let the AI handle the virtual industries. Atleast for now until I feel like getting deeper into the scripting / modding end of things.
 
A portal isn't designed to act as an industry so it won't produce a waybill, no. I've been thinking about something similar, and what I came up with was a Rule that could be added which would act as a kind of "virtual industry" which would trigger a train from a specified portal which would have a specific set of commands to deliver a product, or perhaps would simpy trigger a portal which would have a single train to produce. I'm going to tackle this at some point as I want to learn scripting in Trainz, but I don't know when or how long it's likely to take, or even if it's feasible.

Knight42,

Checkout the Wiki section at TrainzDev for everything you need about writing code. You will find the best tutorial at http://publish.uwo.ca/~gerard/trainz/tutorials/scripting/#cdp

I am in the process of learning and if you have never programmed before, the learning curve is quite steep. I'm exploring a system to replace the current WayBill system. My proposal is posted on TrainzDev Wiki, Content, Operations, Car Movement and Traffic Management. The guys on the TrainzDev Forum are very helpful.

One of the items I am considering is an Interchange Portal. It will emit and consume a string of cars without an engine and can be controlled when to emit with a plus/minus factor.

Best of Luck with your endeavor.
 
Knight42,

Checkout the Wiki section at TrainzDev for everything you need about writing code. You will find the best tutorial at http://publish.uwo.ca/~gerard/trainz/tutorials/scripting/#cdp

I am in the process of learning and if you have never programmed before, the learning curve is quite steep. I'm exploring a system to replace the current WayBill system. My proposal is posted on TrainzDev Wiki, Content, Operations, Car Movement and Traffic Management. The guys on the TrainzDev Forum are very helpful.

One of the items I am considering is an Interchange Portal. It will emit and consume a string of cars without an engine and can be controlled when to emit with a plus/minus factor.

Best of Luck with your endeavor.

Thanks, those tutorials are useful. I'm a programmer in Real Life anyway, so I should pick it up okay, if I can find enough hours in the day to look at it...

There's a thread in the TS2009 forum that relates to this - someone is trying to set up an industry fed by trains from a portal. It can be done using the Resource Check Rule, the CPC Emit Trains Rule, and an UnPortal Rule - I had a power station being fed by coal trains from an UnPortal rule.
 
Thanks, those tutorials are useful. I'm a programmer in Real Life anyway, so I should pick it up okay, if I can find enough hours in the day to look at it...

There's a thread in the TS2009 forum that relates to this - someone is trying to set up an industry fed by trains from a portal. It can be done using the Resource Check Rule, the CPC Emit Trains Rule, and an UnPortal Rule - I had a power station being fed by coal trains from an UnPortal rule.

Jamie,

I have tried to use the Un-Portal rule in trs2009 and have had no luck. The rule claims to be for maps without a portal, but the installation window wants me to select a portal - of which there are none. However, the Re-rail Portal Basic asset does emit cars without engines. But to get it to consume cars without an engine, you have to kick the cars into the portal at about 15 mph, something the Trainmaster on most railroads frowns upon.

Since you are a programmer and I am just learning, I'd appreciate your feedback on my propsal posted on Trainz-Dev as noted above.

Thanks,

David
 
Jamie,

I have tried to use the Un-Portal rule in trs2009 and have had no luck. The rule claims to be for maps without a portal, but the installation window wants me to select a portal - of which there are none. However, the Re-rail Portal Basic asset does emit cars without engines. But to get it to consume cars without an engine, you have to kick the cars into the portal at about 15 mph, something the Trainmaster on most railroads frowns upon.

Since you are a programmer and I am just learning, I'd appreciate your feedback on my propsal posted on Trainz-Dev as noted above.

Thanks,

David

To be honest I don't know enough about Trainz scripting to say one way or the other. I could do that in Java, but I honestly don't know i it's feasible in Trainz. I would say yes, but it would be a considerable amount of work.
 
Portal II

I have a great idea that may work but I have no idea how to script this so maybe someone can help me. TS2009 comes boxed with HPTrains Portal. Which is a portal that has no tunnel, just a track that the incoming trains disappear from after a certain distance down the track. I noticed that I can put track side objects along this track.

Here's what I'd like to try:

Can I script a trackside object that will act like an industry track? For example, can I take the Multiple Industry Track script and some how conform it to fit a new trackside object? The new object could be invisible for all I care, I just want it to create a waybill and 'unload' cargo as a car passes thru it to satisfy the waybill. I can then put the trackside object a few meters before the 'disappearing' point of the HP portal track.

Now, the portal / trakside object combo will make a waybill request, I can send a consist to satisfy it, and the portal will consume the train.

Any thoughts?
 
Back
Top