Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Jan 16, 2018 3:48 pm

All times are UTC




Post new topic  Reply to topic  [ 140 posts ]  Go to page Previous 13 4 5 6 7 Next
Author Message
PostPosted: Wed Sep 16, 2015 2:28 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
3iff wrote:
I've no idea what it might actually be trying to do
Eddi wrote:
that's exactly what i meant. you should be trying to figure that out.

I do, but 'bits' are confusing and even other people have trouble understanding...

I have learned a lot recently though.


Top
   
PostPosted: Thu Sep 17, 2015 1:25 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5188
Location: The Moon
TadeuszD wrote:
3iff wrote:
I'm trying to force a particular cargo to be carried by box cars (trains) or a goods truck (road) only

The best combination of cargo classes for such cargo is CC_PIECE_GOODS + CC_COVERED.


Er, actually, if you want a goods-like cargo to be transported in goods-like vehicles, the best cargo class to use would be that used by goods: CC_EXPRESS.

_________________
Pikkarail.com blog Image
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API
32bpp NewGRFs: Pineapple Trains (10cc) - Graphics Development


Top
   
PostPosted: Thu Sep 17, 2015 7:11 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
I thought that too and I think I tried it without success. So, I've tried 2 combinations with the following results.

CC_EXPRESS

PKP2 - Box and flatbed
Iron horse - mail, combine, open, box
OGFX - piece goods, flatcar

CC_EXPRESS, CC_COVERED

PKP2 - covered wagon
Iron horse - mail, combine, open, box
OGFX - piece goods, flatcar

so PKP 2 set seems to handle things fairly well but the other 2 sets I've tried appear to have more flexible conditions.


Top
   
PostPosted: Thu Sep 17, 2015 7:42 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5188
Location: The Moon
3iff wrote:
I thought that too and I think I tried it without success. So, I've tried 2 combinations with the following results.


Well, in that case, I'll repeat what planetmaker said earlier:

planetmaker wrote:
That's not how it works: It's not up to you (as industry set author) to decide how a cargo is transported. The vehicle sets decide it depending on the cargo label, and if no such special treatment present, by the cargo classes in which vehicles a cargo can be transported. Thus your label and the cargo classes convey suggestions which can be followed or not by a vehicle set.

As industry set author you can only set a sensible set of cargo classes and hope that the cargo is transported in an appropriate vehicle.


Most vehicle sets try to provide at least one wagon for every possible combination of cargo classes, so they will often be quite flexible. I imagine adding CC_EXPRESS to box wagons is more common than excluding CC_COVERED from flat wagons is. :)

_________________
Pikkarail.com blog Image
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API
32bpp NewGRFs: Pineapple Trains (10cc) - Graphics Development


Top
   
PostPosted: Thu Sep 17, 2015 8:11 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9025
Location: Sol d
PikkaBird wrote:
Most vehicle sets try to provide at least one wagon for every possible combination of cargo classes, so they will often be quite flexible. I imagine adding CC_EXPRESS to box wagons is more common than excluding CC_COVERED from flat wagons is. :)


Especially as a container would count as 'covered', too. And it's a perfect cargo for flatbed wagons :)

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


Top
   
PostPosted: Thu Sep 17, 2015 12:09 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Mon Nov 07, 2011 7:32 pm
Posts: 316
Location: PL
PikkaBird wrote:
I imagine adding CC_EXPRESS to box wagons is more common than excluding CC_COVERED from flat wagons is. :)

It depend on wagon type. ;)
For example in PKP Set v2 all covered (box), flatbed and container wagons can carry CC_EXPRESS and CC_PIECE_GOODS cargoes (except a few cargoes enumerated one by one). But ordinary flatbed wagon can not carry CC_COVERED cargoes because of its graphical representation. Cargo in ordinary flatbed wagon in PKP Set v2 is 'transported' using crates similar to wooden crates, which are not water- or humidityproof. However, CC_COVERED can be transported in containers on special container wagon, because of containers are waterproof. But container wagon can not carry CC_OVERSIZED cargoes, because the cargo should be put inside the container - its size is limited.
Of course, covered wagons can carry CC_COVERED cargoes, but they can not carry CC_OVERSIZED cargoes because of limited size of doors.
I hope it is easy to imagine. :)

_________________
Image


Top
   
PostPosted: Fri Sep 18, 2015 6:01 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4535
Location: home
Quote:
Of course, covered wagons can carry CC_COVERED cargoes, but they can not carry CC_OVERSIZED cargoes because of limited size of doors.
Sure they can, just put the doors at one end, and drive the cargo out, knight-rider or james-bond style :D

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
PostPosted: Fri Sep 18, 2015 9:18 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 975
What about hypothetical cargo with both covered and oversized flag turned on?
Maybe sliding sides wagon should be considered?
http://kolej.krb.com.pl/oznaczenia/sis_bok.gif

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension.


Top
   
PostPosted: Fri Sep 18, 2015 9:52 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Mon Nov 07, 2011 7:32 pm
Posts: 316
Location: PL
Alberth wrote:
Sure they can, just put the doors at one end...

You right. Similar wagons exist. Please look up in the Google at German 'Bromberg' wagon for example:
https://c2.staticflickr.com/6/5131/5526 ... 8d16_b.jpg
But there is no such wagons in PKp Set v2.

Quote:
What about hypothetical cargo with both covered and oversized flag turned on?

Could you show examples from real world?

_________________
Image


Top
   
PostPosted: Fri Sep 18, 2015 6:26 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 31, 2007 2:23 pm
Posts: 4488
Location: Standing by the jams
3iff wrote:
I'm trying to force a particular cargo to be carried by box cars (trains) or a goods truck (road) only

I know planetmaker already said this, and I know it's not the answer you want, but...don't try to do that. It's not how it works :)

I have spent time chasing my tail, changing cargo classes in FIRS and testing with different sets to try and impose 'my' choice of vehicles. Nah, don't repeat my mistake. Choice of vehicle is with the vehicle newgrf, not the industry set :)

Join #openttd irc btw if you want more help. ;)

_________________
FIRS Industry Replacement Set (Released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (Finished)
Squid Ate FISH (ships) (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, released)


Top
   
PostPosted: Mon Sep 21, 2015 8:42 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
andythenorth wrote:
I know planetmaker already said this, and I know it's not the answer you want, but...don't try to do that. It's not how it works

I now know. I have that comment in my changelist..."it don't work like that", but in uppercase.
I did think I might be able to control it but no I can't, so I'm not worried.

A lot of this is because I have an idea of something I might be able to do. If I can't get it to work then maybe it's because I'm doing it wrong (mainly due to not knowing everything about ottd code) or it's simply not how the game works.


Top
   
PostPosted: Tue Oct 13, 2015 5:25 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Sat Mar 07, 2009 12:48 pm
Posts: 641
Location: Szeged, Hungary
At work I have a lot of thime to think, and I'd like to ask, is placing sub-categories in refitting possible, is it worth overthinking or it is already a dead idea? I would like to complicate my set give the player some choice of what he/she want to see on the road, and this would be the best way to do it I think... (unless, there would be a very long purchase list if I have to separate everything but the cargo and it's graphic appearance)


Attachments:
File comment: I made some "art"work, not balanced, not actual font type, I just reinvented some letters...
subsubsub.PNG
subsubsub.PNG [ 6.61 KiB | Viewed 2455 times ]

_________________
Image
Top
   
PostPosted: Tue Oct 13, 2015 6:56 pm 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2609
No, you cannot, you can have different subtypes for different cargoes and use that to create liveries for different cargoes, but in the way you pictured it it is not possible.

I would advise to use different vehicles as they really seem to be different.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Wed Mar 30, 2016 8:33 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
Back on page 2 of this thread I was trying to display a custom message. I'm now trying to do the same thing but with a variable number included.

switch(...
// (there's a variable number here I wish to print in the STR_INDUSTRY_TEXT text)
// I've tried (STORE_TEMP(LOAD_TEMP(7),257)),
// I've also tried (STORE_TEMP(LOAD_TEMP(7),258)),
...
return [STORE_TEMP(string(STR_INDUSTRY_TEXT), 0x100), CB_RESULT_IND_PROD_NO_CHANGE | 1 << 8];

and in the lang file...

STR_INDUSTRY_TEXT :Text {COMMA} text

So, I'm getting the text displaying fine but the number (as in {COMMA}) is completely wrong, usually zero or around 85 instead of 12 or so. It seems I'm trying to pass the value wrongly, or {COMMA} is the wrong way to read it, or it can't be done. It does show a number, just not the one I want so I guess it can be done, if only I can pass the number correctly.

Any ideas?

---

Actually, looking through the NML wiki, it might be that I can't pass a value to the message.
Is there any way I can create a news message with an associated value?


Top
   
PostPosted: Wed Mar 30, 2016 5:49 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Dec 20, 2006 1:31 pm
Posts: 975
Location: Aschaffenburg
The production change and closing news messages do not support any custom parameters.
The strings can only contain exactly one {STRING}, which will print the name of industry itself.

_________________
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁


Top
   
PostPosted: Thu Mar 31, 2016 7:24 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
Thanks. I guessed this was the case after wading through the nmlwiki. It would have been nice to do but it's absolutely not a problem.


Top
   
PostPosted: Wed May 04, 2016 12:12 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
I'm currently messing about with an aircraft grf. I've scoured the nmlwiki without success.

I want a plane to be a freight plane, carrying (for now) goods, supplies, food or fruit. I've managed to limit the refit process to these cargos but I have two annoying problems.

1. I want the default cargo to be goods but I can't find a method for setting this. For road vehicles I can use 'default_cargo_type: (cargo id);' but this isn't permitted for aircraft. Currently I have a default of fruit.

2. The specified cargo size is halved for goods (40 cargo = 20 goods) but quartered for other cargos. It's implied that this can be overridden but I can't see anything obvious.

Any pointers would be gratefully received. Thanks.


Top
   
PostPosted: Wed May 04, 2016 5:31 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Dec 20, 2006 1:31 pm
Posts: 975
Location: Aschaffenburg
Aircraft will always default to the first refittable cargo. "first" as in first in your "cargotable".
You can reorder your cargotable, but it will affect all aircraft.

_________________
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁


Top
   
PostPosted: Thu May 05, 2016 7:35 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
Thanks. I'll try that. It shouldn't cause me any issues. FRUT is earlier in the cargo table than GOOD.

My planes (basically a modified default set) carry pass/mail except for some I've designated as cargo planes. Switching cargo order should be fairly transparent.

Is there any way around the goods = 2 cargo, other = 4 cargo ??

------------

Yep, that fixes the default cargo problem. Goods are now the cargo of choice when buying the planes. I wish I had known it was that easy.


Top
   
PostPosted: Thu May 05, 2016 12:12 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 21, 2005 9:26 am
Posts: 962
Location: Birmingham, England
Well, I've managed to fix the goods/other cargo issue. I think I did exactly the same as I had tried yesterday...then it didn't work, today it does. If anyone is remotely interested, I'll post the 'fix' here. Basically I had a look at (and copied) some of the WAS (world airline set) code and it worked.

However, I now have a problem with helicopters. If I do the same fix as above they lose their ability to carry pass and mail at the same time. So, I was considering splitting the job into two. The base helicopter (Tricaro) would be normal and there would be a duplicate (Tricaro Cargo) to handle the cargo duties.

The default helicopter uses:

item(FEAT_AIRCRAFT, Tricaro_Helicopter, 38) {
etc...

as its normal ID is 38, and that enables it to pick up the default sprites. But the duplicate helicopter can't do the same. It needs a new vehicle ID which is easy BUT I don't know how to make it pick up the same sprite graphics as I can't work out what NML code to use. I can find out which is the first sprite (I have the sprite image to hand) but can I just specify the first sprite number, or all 8.

I'm looking at the base_graphics command but I can't figure out how to code it up, assing that's the right one.

I tend to stay away from graphics if I can. I suppose I could extract the relevant sprites but then I have to specify the co-ordinates and XY offsets (and they were a nightmare for the few road vehicles I did).


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 140 posts ]  Go to page Previous 13 4 5 6 7 Next

All times are UTC


Who is online

Users browsing this forum: Google Feedfetcher and 2 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-2018 phpBB Limited

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