CityBuilder Release Topic

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

Aphid
Traffic Manager
Traffic Manager
Posts: 168
Joined: 16 Dec 2011 17:08

Re: CityBuilder Release Topic

Post by Aphid »

Indeed, gamescripts just pass on the data they want saved as an object similar to a python dictionary to OpenTTD (with key-value pairs), which will add it to the save file. And then they parse the result in the predescribed format when loading a save game.

Do you have a backup of the save game, and have you tried using that (on the off chance that file really got corrupted)?

Try using the 'stable' version of openTTD with your save game, located at https://www.openttd.org/en/download-stable, instead of using an update program. Just follow the instructions in the installer for your platform. On linux, you can also use your distribution's packages, although they may be out of date for more conservative distro's like Mint. This version should be save-game compatible with any other stable version, as well as most of the trunk versions from long enough ago.

As noted above, if you modified your openTTD with patches, there's a good chance these broke save-game compatibility. (Even if a patch follows best-practice, which is supporting save-game transitions from all openttd versions from before the patch, thing is that trunk will add new things to saveload.cpp, breaking compatibility with a patched earlier version at some point in the future, e.g. you can't 'upgrade' your openttd and expect savegames to work using patches.)
marhex
Engineer
Engineer
Posts: 8
Joined: 09 Jul 2015 10:44

Re: CityBuilder Release Topic

Post by marhex »

i have a bug please help me
Image
Attachments
error.jpg
error
(539.76 KiB) Downloaded 9 times
mesh1
Engineer
Engineer
Posts: 1
Joined: 11 Jul 2015 15:31

Re: CityBuilder Release Topic

Post by mesh1 »

file comp.nut (company object), - wrong MoveHQ signature call in line 139.

if(hq != GSMap.TILE_INVALID)
{
[139] //MoveHQ(hq, towns); wrong signature ( real signature is MoveHQ(tile) )
// set the town's text
GSTown.SetText(my_town,GSText(GSText.STR_CITYBUILDER_TOWNOWNER, this.id));
if(GSController.GetSetting("Town_Labels"))
{
local tile = GSTown.GetLocation(my_town);
MoveHQ(tile); call here with tile
local X = GSMap.GetTileX(tile);
local Y = GSMap.GetTileY(tile);
if(label_sign_id == -1)
{
label_sign_id = GSSign.BuildSign(GSMap.GetTileIndex(X,Y), GSText(GSText.STR_CITYBUILDER_TOWNOWNER_SIGN, this.id));
}
else
{
if(GSSign.IsValidSign(label_sign_id))
{
GSSign.SetName(label_sign_id, GSText(GSText.STR_CITYBUILDER_TOWNOWNER_SIGN, this.id));
}
else
{
label_sign_id = GSSign.BuildSign(GSMap.GetTileIndex(X,Y), GSText(GSText.STR_CITYBUILDER_TOWNOWNER_SIGN, this.id));
}
}
}
}
}
Attachments
CityBuilder-113.tar
script with that fix
(266 KiB) Downloaded 219 times
marhex
Engineer
Engineer
Posts: 8
Joined: 09 Jul 2015 10:44

Re: CityBuilder Release Topic

Post by marhex »

i have a bug
Image
Attachments
error.png
(547 KiB) Downloaded 7 times
Aphid
Traffic Manager
Traffic Manager
Posts: 168
Joined: 16 Dec 2011 17:08

Re: CityBuilder Release Topic

Post by Aphid »

marhex, your error is likely only visual, I'll check the code for your particular settings for the town window. The 'goals' is the correct one, you're only transporting 37% of the generated passengers. Did you set a passenger requirement for your own town at above this 37%? I believe the default is 60 or 70%, so that's likely the culprit.

The script can limit town growth based on these sources:
- Any specific cargo ID delivered 'to' your town
- Passengers/mail delivered 'from' your town (generated by the town's buildings). << this is turned on.
marhex
Engineer
Engineer
Posts: 8
Joined: 09 Jul 2015 10:44

Re: CityBuilder Release Topic

Post by marhex »

Aphid wrote:marhex, your error is likely only visual, I'll check the code for your particular settings for the town window. The 'goals' is the correct one, you're only transporting 37% of the generated passengers. Did you set a passenger requirement for your own town at above this 37%? I believe the default is 60 or 70%, so that's likely the culprit.

The script can limit town growth based on these sources:
- Any specific cargo ID delivered 'to' your town
- Passengers/mail delivered 'from' your town (generated by the town's buildings). << this is turned on.
ther is a bug in the town window and in goals window it say the tawn is not growing but in the town window it grow evry 23 days
marhex
Engineer
Engineer
Posts: 8
Joined: 09 Jul 2015 10:44

Re: CityBuilder Release Topic

Post by marhex »

i made a french traduction
Attachments
french.txt
(18.95 KiB) Downloaded 226 times
Aridorn
Engineer
Engineer
Posts: 4
Joined: 17 Jul 2015 21:57

Re: CityBuilder Release Topic

Post by Aridorn »

I am getting this error, and have no idea how to solve the problem, please advise
Attachments
Unavngivet.png
Unavngivet.png (10.55 KiB) Viewed 8290 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CityBuilder Release Topic

Post by Zuu »

Did you download city builder, using in game content download or manually in your browser?

If the later, mind that you by hand also need to download and install the libraries used by city builder.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Aridorn
Engineer
Engineer
Posts: 4
Joined: 17 Jul 2015 21:57

Re: CityBuilder Release Topic

Post by Aridorn »

Zuu wrote:Did you download city builder, using in game content download or manually in your browser?

If the later, mind that you by hand also need to download and install the libraries used by city builder.
could you guide me on how to do it with a content download?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CityBuilder Release Topic

Post by Zuu »

Download city builder using online content, and the system will install also all dependencies of city builder and dependencies to the dependencies.

This wiki page give you some help
https://wiki.openttd.org/Online_content

You may have to remove city builder if you added it manually to the file system in order for OpenTTD to download it again, now with all dependencies.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
aeqh
Engineer
Engineer
Posts: 1
Joined: 23 Jul 2015 17:02

Re: CityBuilder Release Topic

Post by aeqh »

Any solution? I get this everytime i start a game both new and saved.
Attachments
err.png
err.png (58.71 KiB) Viewed 8147 times
marhex
Engineer
Engineer
Posts: 8
Joined: 09 Jul 2015 10:44

Re: CityBuilder Release Topic

Post by marhex »

aeqh open citybuilder-113\comp.nut
in the line 139 change MoveHQ(hq, towns); to MoveHQ(hq);
or download my fix
Attachments
comp.nut
my fix
(15.98 KiB) Downloaded 289 times
Aridorn
Engineer
Engineer
Posts: 4
Joined: 17 Jul 2015 21:57

Re: CityBuilder Release Topic

Post by Aridorn »

i have a new question... how do i make my trains deliver fx. steel and coal to a city if it doesnt accept it, but says it needs it?
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: CityBuilder Release Topic

Post by Sylf »

Aridorn wrote:i have a new question... how do i make my trains deliver fx. steel and coal to a city if it doesnt accept it, but says it needs it?
Deliver those cargo to the steel mill/power plant etc that share the town's name. If Town of Tena require coal, deliver coal to Tena Power Station. If there's no power station associated with Tena, you might have to either wait until one is built, or fund your own.
Aridorn
Engineer
Engineer
Posts: 4
Joined: 17 Jul 2015 21:57

Re: CityBuilder Release Topic

Post by Aridorn »

Sylf wrote:
Aridorn wrote:i have a new question... how do i make my trains deliver fx. steel and coal to a city if it doesnt accept it, but says it needs it?
Deliver those cargo to the steel mill/power plant etc that share the town's name. If Town of Tena require coal, deliver coal to Tena Power Station. If there's no power station associated with Tena, you might have to either wait until one is built, or fund your own.
thx, i figured it out before you posted this, still thanks for the reply, i have now played through an entire game without any problems, so thats awesome.


Thanks to all the people who replied to my questions and helped me, you are the unsung heroes of everyday problems, i salute you all.
ricoow
Engineer
Engineer
Posts: 1
Joined: 09 Sep 2015 14:54

Re: CityBuilder Release Topic

Post by ricoow »

Now I have a serious question. I am trying to get CityBuilder working on my client, so I can host a non-dedicated server for me and my friends to have a little fun on. Now I have played through one attempt myself, but there seems to be a problem. I started in a 700 population town and after 10 years of constantly fullfilling the requirement I set (75per1k passengers) the town 'grew' to 400 population. Is there a setting I missed or f*cked up?\
Also normal cities do not grow at all, anybody an explanation or setting to get that working as well?
Thanks in advance!
User avatar
Lukenwolf
Engineer
Engineer
Posts: 81
Joined: 14 Jun 2012 12:09
Location: Nordschleifistan, Germanyland

Re: CityBuilder Release Topic

Post by Lukenwolf »

Is that one remaining game-breaking bug by any chance that a town demands coal, but no station accepts it, no matter where in town it is? And yes, I mean freight stations ;)
Beer is not the answer. It's the question, and the answer is YES.
Aphid
Traffic Manager
Traffic Manager
Posts: 168
Joined: 16 Dec 2011 17:08

Re: CityBuilder Release Topic

Post by Aphid »

The remaining thing I want to solve is that the 'towns' don't remove houses when you don't provide enough stuff, which allows for 'stockpiling' exploits to be rather effective.

E.g. let's say your network provides 2000 goods/month (cargoID 5), and you have a '100' goods requirement (promilles). No other requirements are set in this example. Your town will grow until it has 20,000 population, and then stop growing. It'll still build out some more houses, so say it's population climbs to ~22,500.

At this point, the town wants 2,250 goods. Since your network only supplies 2000, you stop all road vehicles in the town, letting goods pile up in the station for say 3 months. At this point, 6,000 goods have piled up in the station. Then you re-start your road vehicles, suddenly delivering an influx of goods as fast as they can. Suppose your road vehicles could transport 3,000 units/month (the bottleneck in the network occurs earlier, e.g. at the supply side of things). Suddenly you can grow your town up to 30,000 by repeatedly doing this trick.

Edit: New version is out.

This new version uses 'economy' files and detects your industry newGRF for you -- no more having to manually look up cargo IDs and what not. By default the script will task you for ~400 units of cargo per month per 1000 people. Distribution of the various cargoes is done in accordance to what an average map spawns. There's now just two parameters to tune, One for how quick goals appear, and a multiplier for the total amount.
stinkyfax
Engineer
Engineer
Posts: 28
Joined: 28 Mar 2013 20:12

Re: CityBuilder Release Topic

Post by stinkyfax »

I can't get CityBuilder to work:

Fresh install (tried both Stable and Nightly). Deleted all the settings (Documents/OpenTTD folder).
No additional packages except CityBuilder and automatically downloaded dependencies for it.

Image

Let me know how I could help you find the issue.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests