Dual-power locomotive?
Moderator: Graphics Moderators
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Dual-power locomotive?
So what's the most efficient strategy for making a dual-power locomotive?
E.g. 5,000hp if railtype supplies electricity, 1,250hp otherwise.
Yair, I haven't read the spec, and haven't touched railtype stuff before. I just got up, what can I say?
I thought it might be useful to others in future anyway.
By 'strategy' I also mean how to present the info in the buy menu - whether to show the higher power or lower power by default etc.
I'll be using nml, but my brain still thinks about cb 36 etc.
E.g. 5,000hp if railtype supplies electricity, 1,250hp otherwise.
Yair, I haven't read the spec, and haven't touched railtype stuff before. I just got up, what can I say?
I thought it might be useful to others in future anyway.
By 'strategy' I also mean how to present the info in the buy menu - whether to show the higher power or lower power by default etc.
I'll be using nml, but my brain still thinks about cb 36 etc.
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Re: Dual-power locomotive?
Maybe take a look at the high speed trains in the Dutch train set? They run on non-25 kV tracks, but with significantly lower specs than when on the 25 kV track.
Re: Dual-power locomotive?
The problem is that there is no vehicle variable that will tell you whether the railtype supplies electricity (= has catenary enabled). You can only query the railtype itself. This means that, for a dual-power locomotive, your railtype translation table has to know about all railtype labels for electrified track that are used by any track set you want to be compatible with.andythenorth wrote:So what's the most efficient strategy for making a dual-power locomotive?
E.g. 5,000hp if railtype supplies electricity, 1,250hp otherwise.
The other potential problem is that not all vehicle properties are constantly updated. (If I remember correctly, power is always updated, but for example the maximum speed is not.)
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Dual-power locomotive?
That may sound like a big problem. But I don't think it needs to be a real big problem. FooBar did a good treatise on railtype labels and also supplies a very decent RTT (alternatively this modified one from OpenGFX+Trains)dandan wrote:The problem is that there is no vehicle variable that will tell you whether the railtype supplies electricity (= has catenary enabled). You can only query the railtype itself. This means that, for a dual-power locomotive, your railtype translation table has to know about all railtype labels for electrified track that are used by any track set you want to be compatible with.andythenorth wrote:So what's the most efficient strategy for making a dual-power locomotive?
E.g. 5,000hp if railtype supplies electricity, 1,250hp otherwise.
The other potential problem is that not all vehicle properties are constantly updated. (If I remember correctly, power is always updated, but for example the maximum speed is not.)
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Dual-power locomotive?
i was considering writing "comparison" functions for the newgrf specs, i.e. something like "give two railtype labels, return true if vehicles defined for the first are powered on the second" or "return true if the two railtype labels are mapped to the same railtype". the question is how to specify that and pass the parameters. maybe comparable to the grf activation checks or something. also a question to be answered is if this should be accessible through action6/7/9/D or varaction2
Re: Dual-power locomotive?
Good to know, thanks for the link.planetmaker wrote:FooBar did a good treatise on railtype labels and also supplies a very decent RTT (alternatively this modified one from OpenGFX+Trains)
That would be useful and more future-proof than an extensive railtype table. On the other hand, it may be too much trouble for too little benefit. Do you have any uses in mind other than dual-power locomotives?Eddi wrote:i was considering writing "comparison" functions for the newgrf specs, i.e. something like "give two railtype labels, return true if vehicles defined for the first are powered on the second"
Re: Dual-power locomotive?
my use case would be to detect whether a set provides different axle weights (because in my set a lot of vehicles don't make sense without that)
since more and more sets use the standardized railtype scheme, simple existence of a railtype is not enough to detect this.
since more and more sets use the standardized railtype scheme, simple existence of a railtype is not enough to detect this.
Re: Dual-power locomotive?
a possible way how this could look:
Action 7 condition type:
0F/10: railtype <variable> [index into RTT] is [not] equvalent to railtype label <value>
11/12: railtype <variable> is [not] compatible on railtype label <value>
13/14: railtype <variable> is [not] powered on railtype label <value>
with each condition being false if <value> is not defined (there is already a condition to check that)
Action 7 condition type:
0F/10: railtype <variable> [index into RTT] is [not] equvalent to railtype label <value>
11/12: railtype <variable> is [not] compatible on railtype label <value>
13/14: railtype <variable> is [not] powered on railtype label <value>
with each condition being false if <value> is not defined (there is already a condition to check that)
Re: Dual-power locomotive?
I'd put the higher power in the buy menu if that's the "normal" operating condition, and then a note to the effect that it can run off-grid at lower power.andythenorth wrote:By 'strategy' I also mean how to present the info in the buy menu - whether to show the higher power or lower power by default etc.
For the Class 73 in UKRS2, I just did a simple split based on the railtype, then had two seperate chains for power, sound, effects etc, one diesel and one electric.I'll be using nml, but my brain still thinks about cb 36 etc.
I'm pleased to tell you that top speed is updated when changing railtype - the A-Train in UKRS2, for example, does 155mph under wires but 100mph on 3rd rail.dandan wrote:The other potential problem is that not all vehicle properties are constantly updated. (If I remember correctly, power is always updated, but for example the maximum speed is not.)
-
- Tycoon
- Posts: 2781
- Joined: 22 Feb 2011 18:34
Re: Dual-power locomotive?
For what TS wants, defining his train as RAIL would allow it to run on both RAIL and ELRL by default, and then using a switch block like is used in the Dutch Train Set he can set the power of the vehicle depending on the railtype. But as soon as tracksets are loaded, everything can be possible, as it can change the compatible and powered railtype lists, but I'm not aware of any set that restricts the default lists.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Re: Dual-power locomotive?
I agree. That also reflects best how such engines are normally used in real life.PikkaBird wrote: I'd put the higher power in the buy menu if that's the "normal" operating condition, and then a note to the effect that it can run off-grid at lower power.
Ah, very good. I was not sure and the wiki is vague on this point. So, looking at the list of vehicle properties, everything that could sensibly depend on the railtype is updated?I'm pleased to tell you that top speed is updated when changing railtype - the A-Train in UKRS2, for example, does 155mph under wires but 100mph on 3rd rail.
@Eddi: This would probably be the best way to solve your problem. Of course, at the moment the number of tracks sets that implement axle weights is quite short (possibly empty?) but, again, to be future-proof...
Who is online
Users browsing this forum: No registered users and 21 guests