Page 1 of 6

[GS] Simple City Builder game script

Posted: 20 Oct 2013 16:26
by Honza_
Novapolis team presenting:

Simple City Builder script

1. Claim a town by placing company headquaters
2. Deliver cargos and grow the town to the biggest population ever seen

Features
- When configured towns will require more cargos to grow
- Displays requirements in Town window and Goal window
- simulates the original OpenTTD growth mechanism

Settings
- spawning of some industries
- storage of delivered cargos
- Requirements, population at which cargo is required and storage decay of each cargo (up to 32 if defined, ECS and FIRS supported of course)
- pausing game on start in multiplayer
- place signs to mark cities
- place signs to mark claimed towns
- dynamic change of town growth
- limiting cities size

Future plans
- add more growth mechanics


== OVERVIEW ==
Settings
Settings
simplecb_settings.png (42.98 KiB) Viewed 11351 times
simplecb_gui.png
Various gui details
(540.4 KiB) Downloaded 1 time
simplecb_town.png
Various gui details
(365.92 KiB) Downloaded 1 time

Available via game content or here for manual install http://bananas.openttd.org/en/gs/

Enjoy


Source code repositories

GITHUB : https://github.com/TheDude-gh/simplecb (active)

OpenTTDcoop devzone : https://dev.openttdcoop.org/projects/citybuilder-gs (deprecated)



== TRANSLATIONS ==
Global access for translations is enabled in openttdcoop Web translator. If anyone wishes kindly to contribute translation in any language, you can do so at:

https://translator.openttdcoop.org/proj ... builder-gs

If it does not let you, you will probably need to sign up as traslator here

https://translator.openttdcoop.org/



== UPDATES ==

On 25.08.2021
Version 13
=FIXES=
- Prevent duplicate companies in scores. Could happen playing scenarios.

=CHANGES=
Town skrinking - new optional setting
- When town is not supplied properly, it has a chance of demolishing house and decreasing population
- town will shrink on condition any cargo is supplied less then 25% of requirement and population is less than 500

City Population Limit setting
- now cities can be limited by population percentage of biggest town instead of its multiplication. Range is 0 to 1000% instead of previous multiplier 1 to 10.

Changing settings in running game
- now you can change any setting in running game so no need to start from beggining when you are not happy with some setting.
- You can do this by changing setting in game (SHIFT+F12 or whatever hotkey you set), saving the game and on load the new settings will update.

================
On 17.04.2021
Version 12
=CHANGES=
Languages updated
- industry cargo sets presets
- support new 64 cargo limit
- one change in language file, and project url
- warning messages with WARN flag
- visual code reformatting
- change of default values of some settings
- demolition function preparation


================
On 11.11.2017
Version 11
=CHANGES=
Languages updated


On 04.10.2015 - new version
Language updates.

On 12.01.2015 - new version
Setting for limiting City population to maximum twice the biggest town
Maximum Goal Progress lines limited to 24
New languages
Added YETI cargos description to settings menu
Dynamic growth interval is changeable now and disabling it works
Fixes plural forms in english and czech language

On 11.05.2014 - new version
Fixed missing declaration
Fixed some bad calculations
Fixed some bad conditions
Fixed misspells in czech.lng

On 07.05.2014 - new version
Town::Service function is no more in bad scope, causing troubles.

On 27.04.2014 - new version
On bananas - changelog included
- Fixed save load crash bug

On 26.04.2014 - new version
On bananas - changelog included
- New growth style, funding buildings, storybook and more

On 08.11.2013 - new version
On bananas - changelog included

On 10.11.2013 - new version
Fixes some silly things of previous version

Re: [GS] Simple City Builder game script

Posted: 04 Nov 2013 15:35
by Phreeze
does it work on single player too ?

(can't test atm, so i'm asking ;) )

Re: [GS] Simple City Builder game script

Posted: 04 Nov 2013 21:11
by fabca2
Hello,
I translated this nice script into french.
I could not perform any test, once I place french.txt on lang folder I have a message telling me that STR_GLOBAL_GOAL_CB does not exist, which is wrong of course.

This is well known when translated file is not in UTF8 format (see for example http://www.tt-forums.net/viewtopic.php? ... e#p1069046)

But this is not the case, file is UTF8 encoded.
And even worth, if I just copy english.txt into whatever.txt without even opening the file, I got exactly the same message!

It looks strange to me, I suppose it's not a bug (I'm using stable 1.3.2) it's probably something I didn't understood...
That's a little bit frustrating, it's my first translation attempt, if someone can help me.
Thank you.

whatever, I attached the file, it may works for you ?

Re: [GS] Simple City Builder game script

Posted: 04 Nov 2013 23:19
by Honza_
hi,
most likely you have some mistake in the file. When you remove the french.txt from lang folder, the script works. Unforunately AI console is not very helpful when looking for language file problem as far as I know.

You can locate the problem by removing some lines randomly and see if the error still appears.

Re: [GS] Simple City Builder game script

Posted: 04 Nov 2013 23:24
by fabca2
hi,
Honza_ wrote:hi,
most likely you have some mistake in the file. When you remove the french.txt from lang folder, the script works....
it could be, but I think you didn't paid attention to this :
fabca2 wrote:And even worth, if I just copy english.txt into whatever.txt without even opening the file, I got exactly the same message!
Which means, the file itself is probably not the only one culpit.
The test I made (after ruining 2 hours) : I totally remove my file, I just copy your english.txt into another file name (give the name you want, italian.txt french.txt dutch.txt or whatever.txt) run the game, create a new game.. crash.

Can you check on our PC if it behave the same ?
Thanks.

Re: [GS] Simple City Builder game script

Posted: 05 Nov 2013 07:52
by Honza_
the script as it is on bananas works well. When I add your french.txt it crashes. => fix your french.txt

If you rename english.txt so there is no english.txt, I guess it wont work since english.txt is likely required always

Re: [GS] Simple City Builder game script

Posted: 05 Nov 2013 08:31
by fabca2
Honza_ wrote:If you rename english.txt so there is no english.txt, I guess it wont work since english.txt is likely required always
But did you try to COPY your english.txt into another language (without even opening it) ?

Re: [GS] Simple City Builder game script

Posted: 05 Nov 2013 10:59
by Honza_
Problem is in your translation with STRINGx formats.
Study those

http://wiki.openttd.org/OpenTTDDevBlack ... al_strings

http://wiki.openttd.org/Format_of_langfiles

Re: [GS] Simple City Builder game script

Posted: 12 Nov 2013 19:36
by Honza_
New version.
See first post.

Re: [GS] Simple City Builder game script

Posted: 18 Nov 2013 15:32
by juhawp
HI!

Sorry I'm new to this so these questions might sound stupid.

How can I deliver for example coal to the city (it doesn't accept it).

And what does "ECS and FIRS" mean?

Re: [GS] Simple City Builder game script

Posted: 18 Nov 2013 15:40
by planetmaker
juhawp wrote:HI!

Sorry I'm new to this so these questions might sound stupid.

How can I deliver for example coal to the city (it doesn't accept it).

And what does "ECS and FIRS" mean?
You deliver coal to a city by delivering it to a power plant (or other industry) in the city's influence area which accepts it
ECS and FIRS are both NewGRFs which change industries (quite a lot).

Re: [GS] Simple City Builder game script

Posted: 26 Apr 2014 14:38
by Honza_
New version with new 1.4 features.
See first post.

Re: [GS] Simple City Builder game script

Posted: 05 May 2014 11:33
by dirace
hi,
I load the GS in a multiplayer server, and I feed the town all the requirments, but the town did not grow at all, do I miss some configuration?
and at the same time, the storage page shows different info for different player, only the 1st player show complete info for town growing.
problem.png
problem.png (236.02 KiB) Viewed 11359 times
problem2.png
problem2.png (50.95 KiB) Viewed 11359 times

Re: [GS] Simple City Builder game script

Posted: 05 May 2014 15:09
by acabin
dirace wrote:hi,
I load the GS in a multiplayer server, and I feed the town all the requirments, but the town did not grow at all, do I miss some configuration?
and at the same time, the storage page shows different info for different player, only the 1st player show complete info for town growing.
problem.png
problem2.png
It seems there is something wrong with town.nut:

function Town::Service() is included by function Town::Grow(growmech)

move Service() out from Grow() will fix the problem.

Re: [GS] Simple City Builder game script

Posted: 05 May 2014 21:20
by Honza_
Hi,
thanks for info. The Town::Service definition should indeed be outside the other function.

Even so, there is one known OpenTTD problem, when Normal grow mechanism is selected, in cases when town does not grow because of missing transport service, the script will make false statement that town grows even when town is not, because there is no API in game script to recongnize this.

But I guess this was not your problem.

Re: [GS] Simple City Builder game script

Posted: 08 May 2014 05:59
by acabin
There is another bug:

When a player got the goal, the script will hang up at goalprogress.nut:29:

Code: Select all

			if(checkgamelength >= this.game_length) txt = GSText.STR_WINNER_TIME;
And it should be:

Code: Select all

			local txt;
			if(checkgamelength >= this.game_length) txt = GSText.STR_WINNER_TIME;

Re: [GS] Simple City Builder game script

Posted: 11 May 2014 15:43
by Honza_
Thanks. It should be ok. Looking forward for next bug report :-)

Re: [GS] Simple City Builder game script

Posted: 15 May 2014 14:12
by Ozgarb
World creator has a problem. Towns are very close together and less populated town is city.

Re: [GS] Simple City Builder game script

Posted: 15 May 2014 14:25
by planetmaker
Ozgarb wrote:World creator has a problem. Towns are very close together and less populated town is city.
Honestly, I see no issue here, just randomness at work:

Both, placement and size is randomly distributed. Distance to other towns has a minimum value as does the town or city size in terms of houses which are *tried* to be generated. Cities are not necessarily the biggest towns around at the start of map creation, they can have a *tendency* to be bigger, but again, that multiplicator is applied to the random size, thus the end result may still be small. However, cities will grow faster later on, if they receive an equal level of service compared to a 'normal' town.

Also, your issue most likely is unrelated to the game script here most likely.

Re: [GS] Simple City Builder game script

Posted: 16 May 2014 16:34
by Honza_
Indeed, nothing GS can do abou that.

Ozgarb, if you want map generator with more possibilities, suggest new feature on flyspray ;-)