Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Nov 19, 2017 4:38 am

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Nov 13, 2017 12:05 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Apr 24, 2007 9:37 am
Posts: 2887
Location: Straya
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:
File comment: Trifase set used alongside 2cc and Dutch trainsets
trifase.PNG [152.28 KiB]
Not downloaded yet
File comment: GRF
trifase_0.2.0.tar [84 KiB]
Downloaded 10 times
File comment: Source code
Trifase_0.2.0-src.tar [254.5 KiB]
Downloaded 6 times

_________________
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--
Top
   
PostPosted: Tue Nov 14, 2017 10:35 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Apr 24, 2007 9:37 am
Posts: 2887
Location: Straya
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--


Top
   
PostPosted: Tue Nov 14, 2017 5:35 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon Apr 17, 2017 4:52 pm
Posts: 314
Location: S.W. London
I might be able to help... Could you explain more clearly what you're trying to achieve?

_________________
Image

Maker of many GRFs, most of which are pretty poor.


Top
   
PostPosted: Wed Nov 15, 2017 6:10 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Apr 24, 2007 9:37 am
Posts: 2887
Location: Straya
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:

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--


Top
   
PostPosted: Wed Nov 15, 2017 6:17 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon Apr 17, 2017 4:52 pm
Posts: 314
Location: S.W. London
I think I understand. The way I'd go about it is by having a switch that says
Code:
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

_________________
Image

Maker of many GRFs, most of which are pretty poor.


Top
   
PostPosted: Thu Nov 16, 2017 12:11 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Apr 24, 2007 9:37 am
Posts: 2887
Location: Straya
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 99 times ]

_________________
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot], Yahoo [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.