Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Sep 25, 2017 8:42 pm

All times are UTC




Post new topic  This topic is locked, you cannot edit posts or make further replies.  [ 50 posts ]  Go to page 1 2 3 Next
Author Message
PostPosted: Sun Jul 27, 2008 1:00 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Current version of the Grf:
Attachment:
oilsgoup.grf [196 Bytes]
Downloaded 1829 times

Current version of the Grf's Source:
Attachment:
oilsgoup_v2.nfo [1.08 KiB]
Downloaded 554 times

Changes since the last version:
SirkoZ wrote:
I only changed so it says "Temperate Oil Wells only_decrease neutraliser" instead of just "Only_decrease neutraliser" in the NewGRF selection window


[Old Post]
Greets all!

EDIT: The files (v2) can be found here.

This is my first NFO/newGRF and I have some problems with it:

1st line - Action 8 (which NFO renum comments and replaces with a random action 0 and then complains '8' isn't the first :-X):
Code:
0 * 43 08 06 53 5A 13 44 20 4F 6E 6C 79 5F 64 65 63 72 65 61 73 65 20 6E 65 75 74 72 61 6C 69 73 65 72 20 42 79 20 53 69 72 6B 6F 5A 00


2nd line - Action 0 (which should say that only_decrease flag (80) for (Temperate) Oil Wells is null and void):
Code:
1 * 10 00 0A 01 01 0B 1A 07 00 00 00


3rd line - Action 7 which should disable this newGRF if Temperate terrain isn't used (yet grf coded says Sprite 2's transparency and redundancy is 100% - I suppose this is bad):
Code:
2 * 06 07 83 01 03 00 00


Please help me make this one work for as it would sometimes be fun to have abundant Oil Wells in temperate games.

Thx

SirkoZ

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Last edited by Lakie on Thu Jul 31, 2008 6:17 pm, edited 6 times in total.
Please don't use bright colours that clash with the default tt theme, and added his newest grf version and source as requested.


Top
   
 
PostPosted: Sun Jul 27, 2008 3:10 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
Sprite 0 is not an action. NFORenum can't make sense of that sprite 0, so it comments it out and puts a valid one in. When it can make sense of the sprite 0, it removes it instead.

Generally, you want your action 7s to skip something. What is that one skipping?

As a general rule, the transparency/redundancy message is only interesting for real sprites. Pseudos always compress to exactly 100% of their original size. Also, that's a running total, not a per-sprite total.

_________________
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser


Top
   
 
PostPosted: Sun Jul 27, 2008 6:06 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Action 7 here should skip this whole grf if terrain set to 00 = temperate. Although with even Action 0 not working (neither in oTTD nor in TTDPatch) I want to fix that one first...any help?

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
   
 
PostPosted: Sun Jul 27, 2008 9:20 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
None of you newGRF guru's (Purno et al) wrote any replies here - what gives?

Is this simple idea really so hard to implement - I mean one should be able to disable only_decrease flags with action 0, no?

I'm confused... :?

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
   
 
PostPosted: Sun Jul 27, 2008 10:54 pm 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Wed May 26, 2004 4:37 pm
Posts: 1802
Location: Britain
What DaleStan tried to tell you is that the first sprite "0" must be the number of sprites in the file, the action / realsprites must begin from sprite "1" onwards.
Example for if you don't understand what you've been told:
Code:
0 *  4        03 00 00 00
1 *  6        07 83 01 03 00 00
2 * 43        08 06 53 5A 13 44 20 4F 6E 6C 79 5F 64 65 63 72 65 61 73 65 20 6E 65 75 74 72 61 6C 69 73 65 72 20 42 79 20 53 69 72 6B 6F 5A 00
3 * 10        00 0A 01 01 0B 1A 07 00 00 00
Though I'm not sure if you are meant to skip the action8 to disable the grf these days.

Hope that helps,
~ Lakie

_________________
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."


Top
   
 
PostPosted: Sun Jul 27, 2008 11:06 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Oct 31, 2005 9:00 pm
Posts: 1032
Location: UK
Well, I haven't done any industry coding myself, but I'll try and give you what help I can.

Firstly, people are more likely to respond, if you layout and document your nfo so it can be immediately understood. ;) Something like this:

Code:
1 * 10 00 0A // Action 0 - industries
       01 01 // 1 property, 1 industry
       0B    // Id - oil wells
       1A    // Property - special flags
       07 00 00 00 // Value

I can now see you are setting property 1A to a value of 7. This is setting bits 0, 1 and 2, according to the wiki these bits are:

    0 - Industry plants fields
    1 - Industry cuts trees
    2 - Industry is built on water

I don't think that's quite what you intended... ;)

_________________
Image


Top
   
 
PostPosted: Sun Jul 27, 2008 11:33 pm 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Wed May 26, 2004 4:37 pm
Posts: 1802
Location: Britain
Indeed, I don't know anything about industries but based of the Wiki it looks although you mistook the bit for being the value you write into the nfo, you actually write the value of the bit (0x80 for bit 7).
Which would give you the desired effect (bit 7 - The industry cannot increase its production on the temperate climate (oil wells)).

~ Lakie

_________________
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."


Top
   
 
PostPosted: Mon Jul 28, 2008 10:27 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Thanks, Lakie and mart3p - I should have posted the corrected NFO, sorry. :oops:
I mean I understand what DaleStan was saying about the action 8 and that 0 * 4 00 00 00 00 - that's simple. :-)

What baffles me is:
1.)Why action 0 doesn't work - I mean the bit 7 that has value 80 is for only_decrease, but I wanted to disable the only_decrease behaviour, that's why I set all the values for bit 7 to 00.
I just don't know how would I disable it otherwise...

2.) Action 7 - I'll deal with it when I have the 0 sorted. However - I don't know how exactly I'd prevent this grf from loading in other terrains (not temperate). I set the comparison that if it's 00 (temperate terrain that it skips the grf or so I think)... :-)


Attachments:
File comment: my non-working nfo so far...
oilsgoup.nfo [363 Bytes]
Downloaded 193 times

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!
Top
   
 
PostPosted: Mon Jul 28, 2008 10:39 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Mar 30, 2004 12:30 pm
Posts: 16663
Location: Almere, The Netherlands
SirkoZ wrote:
None of you newGRF guru's (Purno et al) wrote any replies here - what gives?


I don't code NFO, and since your question seems to be related to NFO, I cannot post anything useful to help you.

_________________
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."


Top
   
 
PostPosted: Mon Jul 28, 2008 10:40 am 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Wed May 26, 2004 4:37 pm
Posts: 1802
Location: Britain
As I said in my later post the value should be 0x80 not 0x07 (which is the bit number).
Code:
    2 * 10    00 0A 01 01 0B // Oil wells, one property
                1A 80 00 00 00 // Can only decrease in production
As previously said by me, put the action7 above the action8.

~ Lakie

_________________
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."


Top
   
 
PostPosted: Mon Jul 28, 2008 12:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Purno wrote:
SirkoZ wrote:
None of you newGRF guru's (Purno et al) wrote any replies here - what gives?


I don't code NFO, and since your question seems to be related to NFO, I cannot post anything useful to help you.

Oh. :oops:

Thanks anyway. ;-)

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
   
 
PostPosted: Mon Jul 28, 2008 12:13 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Mar 30, 2004 12:30 pm
Posts: 16663
Location: Almere, The Netherlands
You're welcome :)

_________________
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."


Top
   
 
PostPosted: Mon Jul 28, 2008 12:14 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Lakie wrote:
As I said in my later post the value should be 0x80 not 0x07 (which is the bit number).
Code:
    2 * 10    00 0A 01 01 0B // Oil wells, one property
                1A 80 00 00 00 // Can only decrease in production
As previously said by me, put the action7 above the action8.

~ Lakie

Beautiful. Thank you - this newGRF is now disabled in all non-temperate terrains. :D

Now - the action 0 - how would I neutralise that only_decrease flag that is present in the game alone for temperate oil wells? I want them to increase production too - that's the thing that I don't know. :(


Attachments:
File comment: Action 7 working well, action 0 even with 1A 00 00 00 00 still not...
oilsgoup.nfo [419 Bytes]
Downloaded 160 times

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Last edited by SirkoZ on Mon Jul 28, 2008 1:12 pm, edited 1 time in total.
Top
   
 
PostPosted: Mon Jul 28, 2008 12:27 pm 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Wed May 26, 2004 4:37 pm
Posts: 1802
Location: Britain
I'd imagine just making the value for Action0 Property 1A 0x00000000 would work in that case?

~ Lakie

_________________
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."


Top
   
 
PostPosted: Mon Jul 28, 2008 12:34 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Oh - thx - I'll try it out. :-)

EDIT: No...doesn't work. Oil wells still only_decrease (both OTTD and TTDP)...->nfo in the upper post - I edited it.

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
   
 
PostPosted: Mon Jul 28, 2008 2:45 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Oct 31, 2005 9:00 pm
Posts: 1032
Location: UK
I think you need a little more than setting property 1A. If I start a game in OpenTTD with your grf and debug grf enabled, I get the following message.

Code:
dbg: [grf] [Test\oilsgoup.grf:2] IndustriesChangeInfo: newid 11
dbg: [grf] [Test\oilsgoup.grf:2] IndustriesChangeInfo: Attempt to modify undefined industry 11. Ignoring.

It seems a property 08 must be set to define the industry, or all other property settings for that ID are ignored. The trouble then, is that property 08 creates a new additional industry type, based on the old one. I think you also need to use property 09 to override the original oil wells.

Code:
2 * 14    00 0A // Action 0 - industries
       03 01 // 3 properties, 1 industry
       0B    // Id - oil wells
       08 0B // Property - substitute industry type
       09 0B // Property - industry type override
       1A    // Property - special flags
       00 00 00 00 // Value - clear all bits

I can't promise that this is entirely correct, as I say, I have never done any industry coding, but it seems to work. :)


Attachments:
oil production.png
oil production.png [ 56.27 KiB | Viewed 14795 times ]

_________________
Image
Top
   
 
PostPosted: Mon Jul 28, 2008 3:50 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Wow - that's great, mart3p - I also asked belugas and he said that by nullifying the 1A prop in OTTD we also loose the behaviours:
INDUSTRYBEH_DONT_INCR_PROD and
INDUSTRYBEH_BEFORE_1950
although with Oil Wells recreated as a new type it shouldn't be a problem. I don't know.

Those 08 and 09 props' usages sure look easy now. :-)

Thank you. ;-)

P.S.: I PMed belugas with this development - we'll see - I have the feeling it will be fine.
Thanks again, mart3p I really appreciate it.
I'll make the newGRF right away and post it here and also in my signature (link to it).

Works in OpenTTD (default and smooth_economy) and in TTDPatch (default_economy).

EDIT: The files (v2) can be found here.

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Last edited by SirkoZ on Mon Jul 28, 2008 5:51 pm, edited 2 times in total.

Top
   
 
PostPosted: Mon Jul 28, 2008 5:36 pm 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Wed May 26, 2004 4:37 pm
Posts: 1802
Location: Britain
Then add 0x100 to the value of bit 8 to 1A (remember that its little endian so the actual value would be "1A 00 01 00 00" in nfo).

~ Lakie

_________________
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."


Top
   
 
PostPosted: Mon Jul 28, 2008 5:39 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1493
Location: The sunny side of Alps
Oh of course - it's that simple. I'm not used to all these bits so I was confused.

Thank you very much. ;-)

Version 2 - with disabled only_decrease and Oil Wells still being constructed before 1950:
Note: this newGRF is only intended to be used with the default TTD(Patch)/OpenTTD industries and not with any custom made (newGRF) industry sets.


Attachments:
File comment: source - nfo v2
oilsgoup_v2.nfo [1.02 KiB]
Downloaded 316 times
File comment: newGRF (v2)
oilsgoup.grf [176 Bytes]
Downloaded 676 times

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Last edited by SirkoZ on Mon Jul 28, 2008 11:58 pm, edited 1 time in total.
Top
   
 
PostPosted: Mon Jul 28, 2008 6:17 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5097
Sorry to spoil the party, but I don´t see much sense in littering the world with lots and lots of tiny .grfs which make behaviour of "large" sets unpredictable. People will for sure collect every .grf encountered on the net and then complain about problems.

Be assured that this is a real problem. I.e., after succeeding in coding your first .grf why don´t you leave it for personal usage?

regards
Michael

_________________
Image


Top
   
 
Display posts from previous:  Sort by  
Post new topic  This topic is locked, you cannot edit posts or make further replies.  [ 50 posts ]  Go to page 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 8 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.