Some questions from novice coder

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

User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

uzurpator wrote:If I want an industry that has certain processing capacity (say 1000 units of cargo / month) without any output what do I do?
Oh, I think there is a misunderstanding here. Just because it's called a production callback, it doesn't mean you actually have to produce something with it. The catch is, as soon as you enable the production callback, the industry switches to "delayed process mode" and gets the "cargo waiting to be processed" texts in its window.

For example, to create a power plant that burns no more than 1000 tons of coal per month, you enable the production callback (the version that is called every 256 ticks), and when it's called, you consume up to 167 tons of coal, without producing anything. This way, the monthly burn rate will be 1002 or 1169 tons depending on how many times the production callback was called.

UKRS goes a bit farther than this: when the waiting amount is below some threshold, the plant goes to low production mode and starts burning coal more slowly.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
U-rainian
Engineer
Engineer
Posts: 8
Joined: 30 Aug 2006 09:58
Location: Depot

Post by U-rainian »

Without output there is no inventory and thus no possibility to invoke the callback.
Brrrr...
May be I misunderstand you, but I use this code:

Code: Select all

    2 * 46	 04 00 9F 01 00 D0 98 "Produce electricity. Output "
	 "level: low" 00
    3 * 49	 04 00 9F 01 01 D0 98 "Produce electricity. Output "
	 "level: medium" 00
    4 * 47	 04 00 9F 01 02 D0 98 "Produce electricity. Output "
	 "level: high" 00
    5 * 14	 00 09 04 01 07 08 07 09 07 0A 01 08 0E 04
    6 * 14	 00 09 04 01 08 08 08 09 08 0A 01 08 0E 04
    7 * 14	 00 09 04 01 09 08 09 09 09 0A 01 08 0E 04
    8 * 14	 00 09 04 01 0A 08 0A 09 0A 0A 01 08 0E 04
    9 * 9	 00 0A 02 01 01 08 01 09 01
   10 * 15	 02 0A 14 00 01 00 00 00 00 00 00 00 00 00 00
   11 * 23	 02 0A 15 85 40 00 FF FF 02 00 80 00 00 64 00 01 80 64 00 00 0F 02 80
   12 * 17	 02 0A 16 85 40 00 FF FF 01 01 80 00 00 01 00 00 80
   13 * 14	 02 0A 18 81 0C 00 FF 01 15 00 3A 3A 14 00
   14 * 14	 02 0A 20 81 0C 00 FF 01 16 00 3D 3D 18 00
   15 * 7	 03 0A 01 01 00 18 00
   16 * 9	 00 0A 02 01 01 21 04 22 05
   17 * 17	 02 09 23 86 40 00 FF FF 01 01 80 00 00 01 00 00 80
   18 * 7	 03 09 01 07 00 23 00
   19 * 7	 03 09 01 08 00 23 00
   20 * 7	 03 09 01 09 00 23 00
   21 * 7	 03 09 01 0A 00 23 00
and can control of processing...
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

uzurpator wrote:
Csaboka wrote:You mean you haven't heard about ECS?
I heard. Which vehicle set implemets it?
Also PlaneSet.
And Av8, unless Pikka has done something horribly uncharacteristic.

Basically, any release-ready set that has been updated since October or November of 2005.
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
U-rainian
Engineer
Engineer
Posts: 8
Joined: 30 Aug 2006 09:58
Location: Depot

Post by U-rainian »

Another question
How can I define what wagons should be used for specified cargo? For AI I mean.

First I define new cargo
Then for one wagon define refitting mask.
Run
And.. AI build route but does not buy any trains :(
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
U-rainian
Engineer
Engineer
Posts: 8
Joined: 30 Aug 2006 09:58
Location: Depot

Post by U-rainian »

10xU, Csaboka :)

Oh no...
another callback...
:)
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

You don't have to use a callback, but if you don't, you need a separate wagon for each cargo type, occupying the same vehicle ID as TTD's corresponding wagon.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 16 guests