Italian Three-phase Electric Railtype

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3051
Joined: 24 Apr 2007 09:37
Location: Straya

Italian Three-phase Electric Railtype

Post by Emperor Jake » 13 Nov 2017 12:05

So I've recently picked up NewGRF authoring again and decided to pick up some of my old projects. Some of you might know of this taster GRF I released years ago, I've added some stuff to it and intend to release it on Bananas when it's a bit more complete.

I've also been working on a few other things so expect some updates soon :)

Image

The Italian three-phase set currently features:
  • Price balanced with the 2cc trainset and follows its cost parameters
  • 1 railtype with characteristic double wire catenary
  • 4 vehicles from 1920 to 1950, with animated siderods and directional switches for the railcar
  • Parameter for 2CC liveries or real colours
Future features:
  • More, earlier vehicles (work in progress)
  • Cost balancing with more different sets
  • NuTracks and other railsets visual compatibility
  • Override the E.550 from the 2cc Trainset to make it run on the railtype
Currently the railtype allows normal rail vehicles to travel on it, but it is completely incompatible with normal electrified track. Do you think this needs a low-speed dual system railtype for use at stations similar to what the xUSSR set uses? It would have the benefit of allowing the ALe 840 to function as a dual-mode vehicle as it did IRL, but that is the only such dual mode vehicle I know of.

Let me know what you think, and I would appreciate any help with translations :wink:
Attachments
trifase.PNG
Trifase set used alongside 2cc and Dutch trainsets
(152.28 KiB) Not downloaded yet
trifase_0.2.0.tar
GRF
(84 KiB) Downloaded 85 times
Trifase_0.2.0-src.tar
Source code
(254.5 KiB) Downloaded 53 times
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--

User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3051
Joined: 24 Apr 2007 09:37
Location: Straya

Re: Italian Three-phase Electric Railtype

Post by Emperor Jake » 14 Nov 2017 10:35

I have a question: is there a better way to implement the graphics switching parameter other than by putting the entirety of the item blocks in an if statement? Last time I tried it wouldn't let me have an if statement inside the graphics block, and I can't put the spritesets in an if statement either because it complains about already defined spritesets. The NML wiki seems a bit sparse when it comes to parameters so it didn't help much.
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 684
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Italian Three-phase Electric Railtype

Post by Gwyd » 14 Nov 2017 17:35

I might be able to help... Could you explain more clearly what you're trying to achieve?

User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3051
Joined: 24 Apr 2007 09:37
Location: Straya

Re: Italian Three-phase Electric Railtype

Post by Emperor Jake » 15 Nov 2017 06:10

Gwyd wrote:I might be able to help... Could you explain more clearly what you're trying to achieve?
There is a parameter which allows you to switch between real liveries or 2cc graphics. Currently this is achieved by duplicating the entirety of the train item blocks inside an if/else statement, with the only difference being which spritesets they use. While this works, I'm sure this isn't the right way to do it because it seems messy and hackish. I assume the proper way is some kind of switch block, but as I said the NML wiki is a bit vague on parameters.

Code: Select all


if(real_colour) {

item(FEAT_TRAINS, example_train) {
	property {
		...
		}
	graphics {
		purchase: spriteset_real_livery_purchase;
		spriteset_real_livery_train;
		}
	}
	
} else	{	

item(FEAT_TRAINS, example_train) {
	property {
		...
		}
	graphics {
		purchase: spriteset_2cc_purchase;
		spriteset_2cc_train;
		}
	}
}

Thanks for the help, hope this is clear enough :)
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 684
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Italian Three-phase Electric Railtype

Post by Gwyd » 15 Nov 2017 06:17

I think I understand. The way I'd go about it is by having a switch that says

Code: Select all

switch(FEAT_TRAINS, SELF, sw_default, param_name){
Then have the the switch for one of the graphics sets as 0, then the other as 1. Do the same again for the purchase sprtie

User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3051
Joined: 24 Apr 2007 09:37
Location: Straya

Re: Italian Three-phase Electric Railtype

Post by Emperor Jake » 16 Nov 2017 12:11

Gwyd wrote:Then have the the switch for one of the graphics sets as 0, then the other as 1. Do the same again for the purchase sprtie
Thanks, that worked for the trains :D

Then I tried to apply it to the railtype in order to switch between NuTracks rails and the default graphics, but there doesn't seem to be a way of using default sprites unless I provide new sprites, because using CB_FAILED gave me garbage sprites instead of rails.

I'll use the if statement for the railtype for now, at least I don't have to duplicate all my train items anymore :)

You'll notice I tweaked the catenary poles slightly as well, the dots were getting on my nerves. Maybe 2x zoom sprites would look good for the wires...
Attachments
errors.PNG
errors.PNG (24.87 KiB) Viewed 1311 times
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--

Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Baidu [Spider], Macchinista and 3 guests