NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.3

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

User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by NekoMaster »

Morloth wrote:
NekoMaster wrote:Why doesnt NoCAB seam to work with Nightlies but it works with Stables? It really sucks when a good ai cant be played in Cargo Dist
Could you be more specific? Because I have no trouble running the latest version of NoCAB on the latest nightly (19611).
Does it crash or simply not build anything?
Thanks!
Bram
In CargoDist r19563 (My Most recent build) it always crashes after some loading like in the screen shots I've showed before :\
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Zuu »

Just took a look at 2.0.4 info.nut and GetAPIversion() has not been added back again (returning "0.7"). That's the reason for your problems NekoMaster. Without that it will try to use the trunk/1.1 edition of the API which is why it fails. Why it only happens in Cargodist, but not in trunk I don't know. Adding the following code to info.nut should probably solve the issue.

Code: Select all

function GetAPIVersion() { return "0.7"; }
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

I'm going to download CargoDist and see what's going on. Hopefully Zuu's solution should do the trick.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Yexo »

Zuu wrote:Just took a look at 2.0.4 info.nut and GetAPIversion() has not been added back again (returning "0.7"). That's the reason for your problems NekoMaster. Without that it will try to use the trunk/1.1 edition of the API which is why it fails. Why it only happens in Cargodist, but not in trunk I don't know. Adding the following code to info.nut should probably solve the issue.

Code: Select all

function GetAPIVersion() { return "0.7"; }
No, without a GetAPIVersion it'll use the 0.7 version of the API.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Zuu »

Hmm, maybe that's a problem in Cargodist that it doesn't either use 0.7 by default or it/NekoMaster has old compatibility layer scripts.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

Zuu wrote:Hmm, maybe that's a problem in Cargodist that it doesn't either use 0.7 by default or it/NekoMaster has old compatibility layer scripts.
If that's the case I can't do anything at the moment and you'll have to wait until I can get around adapting NoCAB to the 1.0 API... But lets have a look first :)
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by NekoMaster »

Morloth wrote:
Zuu wrote:Hmm, maybe that's a problem in Cargodist that it doesn't either use 0.7 by default or it/NekoMaster has old compatibility layer scripts.
If that's the case I can't do anything at the moment and you'll have to wait until I can get around adapting NoCAB to the 1.0 API... But lets have a look first :)
Its not cargo dist, I also tried with a regular nightly and the same thing happens :\ NoCAB just doesnt like nightlies, and also, cargodist only modifies where cargo goes, it has nothing to do with AI's
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

NekoMaster wrote:
Morloth wrote:
Zuu wrote:Hmm, maybe that's a problem in Cargodist that it doesn't either use 0.7 by default or it/NekoMaster has old compatibility layer scripts.
If that's the case I can't do anything at the moment and you'll have to wait until I can get around adapting NoCAB to the 1.0 API... But lets have a look first :)
Its not cargo dist, I also tried with a regular nightly and the same thing happens :\ NoCAB just doesnt like nightlies, and also, cargodist only modifies where cargo goes, it has nothing to do with AI's
Well.. I just ran the latest nightly and the latest CargoDist from GIT and both work perfectly fine with no problems. I think the issue is with one of the NewGRFs you installed. I'll test those from your list to see which one causes the trouble and see if I can deal with it :).

Thanks for your patience,
Bram
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by NekoMaster »

It can't be the newgrfs, because NoCAB works in OpenTTD v1.0.0 with the stuff I have loaded
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

NekoMaster wrote:It can't be the newgrfs, because NoCAB works in OpenTTD v1.0.0 with the stuff I have loaded
I think it must be, because vanilla cargodist works with no problem on my computer. Otherwise I have no clue what it could be. But I'll have a look and see what's going on.
NoCAB &amp; CargoDist
NoCAB & CargoDist
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

I think the problem must be that the compatibility layer is not working on your computer. Because I can run CargoDist without any problems whatsoever. Could you verify that the file $/bin/ai/compat_0.7.nut is in place? I have no other solution to this problem as I can't reproduce the problem you have.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by NekoMaster »

Morloth wrote:I think the problem must be that the compatibility layer is not working on your computer. Because I can run CargoDist without any problems whatsoever. Could you verify that the file $/bin/ai/compat_0.7.nut is in place? I have no other solution to this problem as I can't reproduce the problem you have.
I stated a while ago i have both .7 and 1.0

The grfs Ive been using work with NoCAB In OpenTTD 1.0.0 but NoCAB Crashes in nightlies and cargodist for me. I doubt its a problem with playing on Ubuntu
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

NekoMaster wrote:
Morloth wrote:I think the problem must be that the compatibility layer is not working on your computer. Because I can run CargoDist without any problems whatsoever. Could you verify that the file $/bin/ai/compat_0.7.nut is in place? I have no other solution to this problem as I can't reproduce the problem you have.
I stated a while ago i have both .7 and 1.0

The grfs Ive been using work with NoCAB In OpenTTD 1.0.0 but NoCAB Crashes in nightlies and cargodist for me. I doubt its a problem with playing on Ubuntu
What happens if you take a clean nightly from GIT and reinstall NoCAB from scratch? That's what I did, it's just hard to debug this one as I have no idea what is going wrong... :(
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by NekoMaster »

CLean nightly, no Grfs, Made sure i had latest noCab and both 0.7 and 1.0 compat nuts

Still crashes :(
Attachments
NoCabCrash.png
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

NekoMaster wrote:CLean nightly, no Grfs, Made sure i had latest noCab and both 0.7 and 1.0 compat nuts

Still crashes :(
I'm not sure if it's related. But could you try moving all the AIs and library from the folder you've shown to the ~/.openttd/content_download/ai directory? Because I only have the compat.* scripts in that directory. Would be weird if that would solve it, but it's worth a try :).
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by NekoMaster »

Nope, still crashy

Why not just update the code to what Admiral Ai has? Admiral Ai Works but I prefer NoCAB
Attachments
StillCrashy.png
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

NekoMaster wrote:Nope, still crashy

Why not just update the code to what Admiral Ai has? Admiral Ai Works but I prefer NoCAB
:(. I'm afraid this is mostly a time issue. But I'll get around doing it eventually but not at the very moment I'm afraid :/. Can someone else reproduce this bug? Because I'm having trouble doing that.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by NekoMaster »

I was wondering if you could make a option for NoCab to scale down the number of road vehicles it uses because its starting to get annoying when theres a line of 100 buses waiting in line for a Single Bus Depot that serves a small town. Also could you possibly add code to make nocab build cleaner rail and road if possible?
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

NekoMaster wrote:I was wondering if you could make a option for NoCab to scale down the number of road vehicles it uses because its starting to get annoying when theres a line of 100 buses waiting in line for a Single Bus Depot that serves a small town. Also could you possibly add code to make nocab build cleaner rail and road if possible?
I have an idea to take better care of these, so yes they will be included in future releases :).

Bug release!
* Take the aircraft speed modifier into account when planning.
* It's easier to build ship connections from town to town.
* Fixed the orders given to ships serving on a bidirectional connection.
* Fixed a situation where the AI would end up in a deadlock when upgrading rails...

The last one happened when NoCAB builds a train connection, but then fails to complete it and removes all rail tracks. However, if the build rail used a part of the existing rail network a train might decide to use the newly build rail part as a short cut. When, we then remove the rail tracks without taking into account if the pieces are actually removed we end up with a situation like this:
Trapped train
Trapped train
Chendinghead Transport, 28th Jan 1966.png (24.61 KiB) Viewed 2225 times
When NoCAB later decides it's time to upgrade the rail it has to wait for all trains to reach their depot before upgrading. But with the situation above this is never going to happen... Luckily this bug is now fixed :).

Also, because we now take the airplane speed modifier into account NoCAB won't be building as many aircraft as it did before, allowing for a wider variety of transportation methods being deployed (that is assuming the speed factor is not set to 1/1) and better performance on NoCAB's part :).

Enjoy the new release!
Bram
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.4

Post by Morloth »

NekoMaster wrote:Nope, still crashy

Why not just update the code to what Admiral Ai has? Admiral Ai Works but I prefer NoCAB
I've just been looking at your crash report and noticed something doesn't make sense. I've updated NoCAB to API version 1.0, but there is no changes on the lists and the method "HasNext" should still be available... So I still have no clue why you still get this error message. Can you actually run AdmiralAI, because it too makes use of the HasNext function.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 13 guests