Page 11 of 12

Re: CityBuilder Release Topic

Posted: 14 Jan 2016 09:18
by Zuu
From the looks of it, you probably got SuperLib 39 installed as dependency. (otherwise it should have had an error about that)

The line that triggers the error looks like this:

Code: Select all

    constructor() {	
        GSLog.Info("Loading Economy ", Log.LVL_WARNING)     // <------------ Line 36 in econ/econ.nut
    }
One problem I see here is that it mix GSLog with Log which is not going to go well. However the error is about LVL_WARNING not existing which is also true.

SuperLib.Log has these levels defined:

Code: Select all

	/* Log levels: */
	static LVL_INFO = 1;           // main info. eg what it is doing
	static LVL_SUB_DECISIONS = 2;  // sub decisions - eg. reasons for not doing certain things etc.
	static LVL_DEBUG = 3;          // debug prints - debug prints during carrying out actions

Users of SuperLib can call SetIsLevelAcceptedFunction to inject a different function to decide if a log message should be outputed or not if they like to introduce more levels. Or create your own constants with value 1, 2 and 3, as I would very unlikely change these values as too much code depend upon the log system.

stinkyfax:As you probably understood, this is an error in the script code. So you'll have to wait for the author to upload a fixed version.

Re: CityBuilder Release Topic

Posted: 14 Jan 2016 11:56
by Aphid
I believe the correct thing to do would be to replace said line of code with just:

Code: Select all

GSLog.Info("Loading Economy");

Re: CityBuilder Release Topic

Posted: 15 Jan 2016 17:47
by stinkyfax
Still waiting for the update of a script, thank you.

Re: CityBuilder Release Topic

Posted: 18 Feb 2016 16:49
by ST2
noticed that when town still have 0 demands, the Next demand line wasn't shown correctly so, in Towngrowth.nut, line 495
(only change is from "GSTown.SetText(id, GSText(GSText.STR_CITYBUILDER_CONCAT01," to "GSTown.SetText(id, GSText(GSText.STR_CITYBUILDER_CONCAT02,")

Code: Select all

			    if(next != -1) {
					    GSTown.SetText(id, GSText(GSText.STR_CITYBUILDER_CONCAT01, 
						    GSText(GSText.STR_CITYBUILDER_TW_HAMLET), 
						    GSText(GSText.STR_CITYBUILDER_TW_NEXT, 1 << econ.enable_order[next], econ.enable_populations[next])));
				    } else {
must be

Code: Select all

			    if(next != -1) {
					    GSTown.SetText(id, GSText(GSText.STR_CITYBUILDER_CONCAT02, 
						    GSText(GSText.STR_CITYBUILDER_TW_HAMLET), 
						    GSText(GSText.STR_CITYBUILDER_TW_NEXT, 1 << econ.enable_order[next], econ.enable_populations[next])));
				    } else {
Well, at least this way started showing correct values (cargo and population). No idea if there's other cases (only found this ^^), this Concat strings are heavy stuff :D

Re: CityBuilder Release Topic

Posted: 19 Feb 2016 23:27
by Aphid
That's a nice observation; I'll push it to the repository. The whole CONCAT_xyz thing is a bit of an ugly workaround to be able to 'build' a custom string in the town window while still having access to nice features such as translation and coloured text, yet one needs to know the exact amount of parameters in each string used in the concatenation to be able to concatenate them this way, it's a bit cumbersome to use.

The script currently also dumps the same information to the story book by the way; that can support larger amounts of information more readily since a page can contain multiple strings. Each town gets its own page, and it just updates monthly like the town windows do.

Re: CityBuilder Release Topic

Posted: 06 Jul 2016 20:31
by marhex
i have a bug when i load a saved game with version 117:

Re: CityBuilder Release Topic

Posted: 07 Jul 2016 03:39
by clausqr
fix:

in Towngrowth.nut line 694 there is a missing + between Assim and GSTown.xxxxx:

Code: Select all

--- Towngrowth.nut	2016-07-07 00:36:56.000000000 -0300
+++ Towngrowth.nut	2016-07-06 19:40:17.000000000 -0300
@@ -691,7 +691,7 @@
 				    if(f2 < 0){f2 = 0;}
 				    local c = f1 + f2; // + sqrt(f1) * sqrt(f2) * 2 << Removed for optimization...
 				    if(GSController.GetSetting("debug_level") > 6) {
-				        GSLog.Info("Assim: " GSTown.GetName(tid) + " and "+ GSTown.GetName(this.id) + "req " + c);
+				        GSLog.Info("Assim: " + GSTown.GetName(tid) + " and "+ GSTown.GetName(this.id) + "req " + c);
 				    }
 	// optimization: reuse f1
 				    f1 = GSTown.GetDistanceSquareToTile(tid,loc);

Re: CityBuilder Release Topic

Posted: 05 Aug 2016 04:38
by Nezerin
I'm likely doing something very wrong as I'm trying to setup a single player game using CityBuilder for fun and practice. In doing so no matter what settings I select I'm ending up with the following error:
Error message received a couple months into every game.
Error message received a couple months into every game.
CityBuilderError.png (24.89 KiB) Viewed 10007 times
Can anyone help me with what I'm doing wrong? It looks like it's running into trouble while trying to calculate a score of some sort for the individual towns.

Re: CityBuilder Release Topic

Posted: 16 Feb 2019 21:28
by planetmaker
So... is this still actively maintained? It crashed on me, shortly after start

Re: CityBuilder Release Topic

Posted: 28 Apr 2019 11:12
by kryters
marhex wrote:i have a bug when i load a saved game with version 117:
I appreciate that it's been almost 3 years since this comment, but I also have this issue with CityBuilder v117 installed through the Online Content interface. Currently running OpenTTD 1.9.1.

Game runs perfectly until I save then load a CityBuilder game. The following error message appears:

Code: Select all

Your script made an error: the index 'num_cargos' does not exist
*FUNCTION [constructor()] citybuilder-117\Towngrowth.nut line [134]
*FUNCTION [Second_Load()] citybuilder-117\main.nut line [218]
*FUNCTION {Start()] citybuilder-117\main.nut line [473]
Image

Re: CityBuilder Release Topic

Posted: 15 Jan 2020 20:20
by aidamina
Hey guys,

I was unable to find a way to send updates/pull requests to the repository of Aphid's City Builder, so i attached an updated version of their trunk.

Fixes:

* Loading of save games (num_cargos does not exist)
* wrong number of parameters (which was fixed by Aphid already in the latest commit)
* some of the other fixes suggested in the last few replies in this topic

Just unzip the archive and move the CityBuilder folder into the %OpenTTD%\game folder and select the game script in the main menu.

Have fun!

Regards,

TJ

Re: CityBuilder Release Topic

Posted: 09 Dec 2020 20:06
by quadat
I had a problem when loading my game this morning. See picture attached.

Re: CityBuilder Release Topic

Posted: 10 Dec 2020 08:05
by jfs
quadat wrote: 09 Dec 2020 20:06 I had a problem when loading my game this morning. See picture attached.
I think you accidentally included windows with sensitive information on your screenshot.

You should probably delete that attachment and make a new one cropped to only show OpenTTD and nothing else.

Re: CityBuilder Release Topic

Posted: 11 Dec 2020 07:47
by Chrill
I cropped the photo for you, quadat. PM me if you have any questions.

Re: CityBuilder Release Topic

Posted: 14 Mar 2021 02:19
by quadat
Thank you !

Re: CityBuilder Release Topic

Posted: 14 May 2021 22:25
by MightyGooga
Hello,

Do you guys have problems loading a singleplayer game with this script? My game loads, and its locked on pause for over 40 minutes.

Is there a solution to this?

Re: CityBuilder Release Topic

Posted: 15 May 2021 06:40
by jfs
MightyGooga wrote: 14 May 2021 22:25 Hello,

Do you guys have problems loading a singleplayer game with this script? My game loads, and its locked on pause for over 40 minutes.

Is there a solution to this?
Are you using a gigantic map, or a normal sized one?
Try with a 512x512 size map or smaller, if you're using a large one.

Re: CityBuilder Release Topic

Posted: 15 May 2021 19:40
by MightyGooga
jfs wrote: 15 May 2021 06:40
MightyGooga wrote: 14 May 2021 22:25 Hello,

Do you guys have problems loading a singleplayer game with this script? My game loads, and its locked on pause for over 40 minutes.

Is there a solution to this?
Are you using a gigantic map, or a normal sized one?
Try with a 512x512 size map or smaller, if you're using a large one.
Hello! Im using a 4k x 2k map.

It should work right? I even get the blue popo up screen, but the games keep locking on pause.

Re: CityBuilder Release Topic

Posted: 15 May 2021 19:59
by jfs
MightyGooga wrote: 15 May 2021 19:40 Hello! Im using a 4k x 2k map.

It should work right? I even get the blue popo up screen, but the games keep locking on pause.
A gigantic map size like that will have a huge number of towns, potentially several thousand, and a huge number of towns will take a very long time for the GS to process at start. While the GS is doing that the game will appear frozen.

Re: CityBuilder Release Topic

Posted: 17 May 2021 11:18
by Argus
I'm trying this script with XIS.
1. The cargo requirement is acid.
Apparently a bug, CityBuilder is not compatible with XIS?