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.
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.
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
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.
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
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.
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
I made some "art"work, not balanced, not actual font type, I just reinvented some letters...
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.
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?
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.
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.
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.
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.
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.
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).