OIL_(cargo_allow_refit) cannot be used in ship

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
impartialjust
Engineer
Engineer
Posts: 2
Joined: 09 Dec 2022 12:56

OIL_(cargo_allow_refit) cannot be used in ship

Post by impartialjust »

The property cargo_allow_refit cannot be set as OIL_, it will output "Unrecognized identifier 'OIL_' encountered" when compiling. When I set the real integer behind OIL_(I think is 3. Sourceshttps://github.com/OpenTTD/OpenTTD/blob ... go_const.h) it just won't let me refit with oil in openttd. Is it a setting that prohibited ship from carrying oil? or how can I make this right?
User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3427
Joined: 24 Apr 2007 09:37
Skype: Discord: Emperor Jake #4106
Location: Not Actually Japan
Contact:

Re: OIL_(cargo_allow_refit) cannot be used in ship

Post by Emperor Jake »

Are you trying to edit the refits of vehicles from within the actual game code? Why not just make a NewGRF, that's what they're here for after all
impartialjust
Engineer
Engineer
Posts: 2
Joined: 09 Dec 2022 12:56

Re: OIL_(cargo_allow_refit) cannot be used in ship

Post by impartialjust »

Yeap, I am trying to make a newgrf. But when compiling the newgrf file, the nmlc compiler throw an error to me(the error is Unrecognized identifier 'OIL_' encountered). That what the problem is.
By the way, I can use cargo_allow_refit_classes to refit the oil.
User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3427
Joined: 24 Apr 2007 09:37
Skype: Discord: Emperor Jake #4106
Location: Not Actually Japan
Contact:

Re: OIL_(cargo_allow_refit) cannot be used in ship

Post by Emperor Jake »

In that case your code is probably missing a cargotable. This is where you need to specify any cargo IDs that you're going to reference.

See https://newgrf-specs.tt-wiki.net/wiki/NML:Cargotable
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 8 guests