Re: [GS] Renewed Village Growth 6.2 (RVG)
Posted: 15 May 2021 16:47
Understood! Thank you for taking the time to explain and of course it’s your work (which I am looking forward to using in the game
The place to talk about Transport Tycoon
https://www.tt-forums.net/
From what I see, yes, it should grow. I remember there was this issue of not enabling town monitoring for some towns in an older version of the GS. Could you please specify which version are you using and provide a save game file?
Code: Select all
dbg: [script] [18] [I] 1.10 API compatibility in effect.
dbg: [net] Map generation percentage complete: 95
dbg: [net] Map generated, starting game
dbg: [net] [udp] received new session key from master server (IPv4)
*** Game paused (number of players)
dbg: [script] SetLastCommand company=18 tile=000000 p1=00000020 p2=00000001 cmd=61
*** Game still paused (game script, number of players)
dbg: [script] CheckLastCommand company=18 tile=000000 p1=00000020 p2=00000001 cmd=317
dbg: [script] SetLastCommand company=18 tile=ffffffff p1=00000000 p2=00000000 cmd=128
dbg: [script] [18] [I] [1950-01-01] Script initialisation...
dbg: [script] [18] [I] Script Communcation Protocol: version: 45 - API: 1.2 - CompanyID: 16 - GS mode - AIAIProtocol: disable Script name: GSTL Script version: 1
dbg: [script] [18] [I] You can get the source code here : http://dev.openttdcoop.org/projects/scriptlib-scp
dbg: [script] [18] [I] Reserved commands : 4
dbg: [script] SetLastCommand company=18 tile=000000 p1=00000080 p2=00000002 cmd=105
dbg: [script] CheckLastCommand company=18 tile=000000 p1=00000080 p2=00000002 cmd=361
dbg: [script] SetLastCommand company=18 tile=ffffffff p1=00000000 p2=00000000 cmd=128
dbg: [script] SetLastCommand company=18 tile=000000 p1=00000072 p2=00000000 cmd=105
dbg: [script] CheckLastCommand company=18 tile=000000 p1=00000072 p2=00000000 cmd=361
dbg: [script] SetLastCommand company=18 tile=ffffffff p1=00000000 p2=00000000 cmd=128
dbg: [script] [18] [I] [1950-01-01] Economy: predefined 25
dbg: [script] [18] [I] [1950-01-01] Creating company list ...
dbg: [script] [18] [I] [1950-01-01] Creating town list ... (can take a while on large maps)
dbg: [script] SetLastCommand company=18 tile=2822a8 p1=0000015d p2=0000ffff cmd=69
dbg: [net] [udp] advertising to master server
Code: Select all
dbg: [script] [18] [I] [1950-01-01] Saving data...
Hey ugmo,
Code: Select all
dbg: [net] Generating map, please wait...
dbg: [net] Map generation percentage complete: 5
dbg: [net] Map generation percentage complete: 10
dbg: [net] Map generation percentage complete: 15
dbg: [net] Map generation percentage complete: 20
dbg: [net] Map generation percentage complete: 26
dbg: [net] Map generation percentage complete: 30
dbg: [net] Map generation percentage complete: 36
dbg: [net] Map generation percentage complete: 60
dbg: [net] Map generation percentage complete: 65
dbg: [net] Map generation percentage complete: 70
dbg: [net] Map generation percentage complete: 75
dbg: [net] Map generation percentage complete: 80
dbg: [net] Map generation percentage complete: 85
dbg: [net] Map generation percentage complete: 90
dbg: [script] [18] [I] 1.10 API compatibility in effect.
dbg: [net] Map generation percentage complete: 95
dbg: [net] Map generated, starting game
dbg: [net] [udp] received new session key from master server (IPv4)
ÔÇÄ*** Game paused (manual)
ÔÇÄ*** Game still paused (manual, game script)
dbg: [script] [18] [I] [1990-01-01] Script initialisation...
dbg: [script] [18] [I] Script Communcation Protocol: version: 45 - API: 1.2 - CompanyID: 16 - GS mode - AIAIProtocol: disable Script name: GSTL Script version: 1
dbg: [script] [18] [I] You can get the source code here : http://dev.openttdcoop.org/projects/scriptlib-scp
dbg: [script] [18] [I] Reserved commands : 4
dbg: [script] [18] [I] [1990-01-01] Cargo 0: PASS
dbg: [script] [18] [I] [1990-01-01] Cargo 1: BEER
dbg: [script] [18] [I] [1990-01-01] Cargo 2: MAIL
dbg: [script] [18] [I] [1990-01-01] Cargo 3: BDMT
dbg: [script] [18] [I] [1990-01-01] Cargo 4: CASS
dbg: [script] [18] [I] [1990-01-01] Cargo 5: GOOD
dbg: [script] [18] [I] [1990-01-01] Cargo 6: RFPR
dbg: [script] [18] [I] [1990-01-01] Cargo 7: CLAY
dbg: [script] [18] [I] [1990-01-01] Cargo 8: JAVA
dbg: [script] [18] [I] [1990-01-01] Cargo 9: COPR
dbg: [script] [18] [I] [1990-01-01] Cargo 10: CORE
dbg: [script] [18] [I] [1990-01-01] Cargo 11: FOOD
dbg: [script] [18] [I] [1990-01-01] Cargo 12: DIAM
dbg: [script] [18] [I] [1990-01-01] Cargo 13: EOIL
dbg: [script] [18] [I] [1990-01-01] Cargo 14: ENSP
dbg: [script] [18] [I] [1990-01-01] Cargo 15: FMSP
dbg: [script] [18] [I] [1990-01-01] Cargo 16: FRUT
dbg: [script] [18] [I] [1990-01-01] Cargo 17: LVST
dbg: [script] [18] [I] [1990-01-01] Cargo 18: WDPR
dbg: [script] [18] [I] [1990-01-01] Cargo 19: MAIZ
dbg: [script] [18] [I] [1990-01-01] Cargo 20: MNO2
dbg: [script] [18] [I] [1990-01-01] Cargo 21: NUTS
dbg: [script] [18] [I] [1990-01-01] Cargo 22: OIL_
dbg: [script] [18] [I] [1990-01-01] Cargo 23: PETR
dbg: [script] [18] [I] [1990-01-01] Cargo 24: PHOS
dbg: [script] [18] [I] [1990-01-01] Cargo 25: RUBR
dbg: [script] [18] [I] [1990-01-01] Cargo 26: SAND
dbg: [script] [18] [I] [1990-01-01] Cargo 27: GRVL
dbg: [script] [18] [I] [1990-01-01] Cargo 28: WOOD
dbg: [script] [18] [I] [1990-01-01] Cargo 29: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 30: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 31: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 32: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 33: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 34: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 35: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 36: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 37: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 38: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 39: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 40: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 41: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 42: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 43: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 44: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 45: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 46: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 47: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 48: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 49: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 50: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 51: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 52: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 53: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 54: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 55: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 56: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 57: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 58: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 59: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 60: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 61: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 62: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Cargo 63: (null : 0x0000000000000000)
dbg: [script] [18] [I] [1990-01-01] Economy: predefined 21
dbg: [script] [18] [I] [1990-01-01] Creating company list ...
dbg: [script] [18] [I] [1990-01-01] Creating town list ... (can take a while on large maps)
dbg: [script] [18] [I] [1990-01-01] Standchurch: 1: PASS,MAIL, 2: FRUT,LVST,MAIZ, 3: WOOD,RUBR,MNO2, 4: RFPR,FMSP,ENSP, 5: BDMT,BEER,GOOD,
dbg: [script] [18] [I] [1990-01-01] Beaby: 1: PASS,MAIL, 2: JAVA,LVST,FRUT, 3: GRVL,OIL_, 4: ENSP,FMSP, 5: GOOD,FOOD,
dbg: [script] [18] [I] [1990-01-01] Sesstable: 1: PASS,MAIL, 2: JAVA,CASS, 3: OIL_,RUBR, 4: FMSP,WDPR,RFPR, 5: GOOD,COPR,
dbg: [script] [18] [I] [1990-01-01] Treborough: 1: PASS,MAIL, 2: MAIZ,JAVA, 3: RUBR,PHOS,SAND, 4: FMSP,ENSP,RFPR, 5: BDMT,BEER,
dbg: [script] [18] [I] [1990-01-01] Tadingbury: 1: PASS,MAIL, 2: MAIZ,FRUT,CASS, 3: PHOS,OIL_, 4: RFPR,WDPR,PETR, 5: GOOD,FOOD,
dbg: [script] [18] [I] [1990-01-01] New Rudtown: 1: PASS,MAIL, 2: FRUT,LVST, 3: CORE,OIL_,PHOS, 4: ENSP,PETR,EOIL, 5: GOOD,BDMT,
dbg: [script] [18] [I] [1990-01-01] Pedingway: 1: PASS,MAIL, 2: JAVA,CASS,NUTS, 3: DIAM,PHOS, 4: EOIL,PETR, 5: GOOD,COPR,BEER,
dbg: [script] [18] [I] [1990-01-01] Godwich: 1: PASS,MAIL, 2: FRUT,MAIZ, 3: GRVL,CLAY,DIAM, 4: EOIL,PETR, 5: BEER,GOOD,
dbg: [script] [18] [I] [1990-01-01] Bonningville: 1: PASS,MAIL, 2: JAVA,MAIZ,NUTS, 3: PHOS,GRVL,CLAY, 4: WDPR,FMSP,PETR, 5: BDMT,COPR,
dbg: [script] [18] [I] [1990-01-01] Marningdon Green: 1: PASS,MAIL, 2: CASS,NUTS,MAIZ, 3: RUBR,DIAM, 4: EOIL,ENSP, 5: COPR,BEER,
dbg: [script] [18] [I] [1990-01-01] Prospecting raw industries ... (can take a while on large maps)
dbg: [script] [18] [I] [1990-01-01] Prospected 8 raw industries up to total number of 8
ÔÇÄ*** Game still paused (manual)
dbg: [script] [18] [I] [1990-01-01] Game setup done.
dbg: [script] [18] [I] [1990-01-01] Happy playing !
Hi, thanks for the response.Firrel wrote: ↑08 Jun 2021 16:22 Could you please try to launch the game script with Debug: Log level parameter to Cargo or Debug? In Cargo mode, it will print the cargo table as well as selected cargo for each town. This way you can see if the initialization just takes too long or it gets stuck. Below you can see a sample output from the Cargo debug level when the script is correctly initialized. Tried it by setting the GS in the game and then starting a dedicated server on my PC.
You can also try increasing a parameter in openttd.cfg under [script] called script_max_opcode_till_suspend = 10000. It will allow the script to take more processing time in each tick if I understand it correctly.
Code: Select all
dbg: [script] [18] [I] [1950-01-01] Cargo 9: FRUT
dbg: [script] [18] [I] [1950-01-01] Cargo 10: IORE
dbg: [script] [18] [I] [1950-01-01] Cargo 11: FOOD
dbg: [script] [18] [I] [1950-01-01] Cargo 12: KAOL
dbg: [script] [18] [I] [1950-01-01] Cargo 13: LVST
dbg: [script] [18] [I] [1950-01-01] Cargo 14: MILK
dbg: [script] [18] [I] [1950-01-01] Cargo 15: SAND
dbg: [script] [18] [I] [1950-01-01] Cargo 16: SCMT
dbg: [script] [18] [I] [1950-01-01] Cargo 17: STEL
dbg: [script] [18] [I] [1950-01-01] Cargo 18: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 19: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 20: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 21: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 22: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 23: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 24: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 25: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 26: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 27: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 28: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 29: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 30: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 31: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 32: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 33: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 34: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 35: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 36: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 37: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 38: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 39: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 40: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 41: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 42: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 43: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 44: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 45: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 46: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 47: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 48: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 49: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 50: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 51: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 52: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 53: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 54: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 55: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 56: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 57: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 58: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 59: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 60: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 61: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 62: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Cargo 63: (null : 0x(nil))
dbg: [script] [18] [I] [1950-01-01] Economy: predefined 25
dbg: [script] [18] [I] [1950-01-01] Creating company list ...
dbg: [script] [18] [I] [1950-01-01] Creating town list ... (can take a while on large maps)
dbg: [script] [18] [I] [1950-01-01] Endmoor: 1: PASS,MAIL, 2: FISH,FRUT,LVST,MILK, 3: COAL,IORE,KAOL,SAND,SCMT, 4: RFPR,ENSP,FMSP,STEL, 5: BEER,GOOD,FOOD,
dbg: [script] SetLastCommand company=18 tile=046340 p1=00000063 p2=0000ffff cmd=69
Code: Select all
dbg: [script] [18] [I] 1.10 API compatibility in effect.
dbg: [script] [18] [I] [1950-01-01] Saving data...
dbg: [script] [18] [S] Your script made an error: the index 'use_town_sign' does not exist
dbg: [script] [18] [S]
dbg: [script] [18] [S] *FUNCTION [Save()] renewed_village_growth-6.2/main.nut line [223]
dbg: [script] [18] [S] *FUNCTION [Start()] renewed_village_growth-6.2/main.nut line [70]
dbg: [script] [18] [S]
dbg: [script] [18] [S] [save_table] TABLE
dbg: [script] [18] [S] [this] INSTANCE
dbg: [script] [18] [S] [sysdate] 23
dbg: [script] [18] [S] [this] INSTANCE
dbg: [script] The script died unexpectedly.
One of the running scripts crashed. Please report this to the script author with a screenshot of the AI/Game Script Debug Window
dbg: [script] [18] [I] Please report the error to the following URL:
dbg: [script] [18] [I] https://www.tt-forums.net/viewtopic.php?f=65&t=87052
Code: Select all
If you delivery more cargo than necessary, the surplus is
stockpiled to be consumed next month (towns can stockpile a quantity
of 10 * cargotype requirement).
Great to hear that you managed to get it working. Are you going to host it as a public server or a private one? Might be interested in joining for a game.ugmo wrote: ↑09 Jun 2021 07:09 Edit: I've managed to get the script working! I generated a fresh openttd.cfg on the server and then compared the two, removing anything different in my server.cfg that I didn't need. Hopefully my debug notes are still helpful to you in some way, although I have no idea what setting was causing the issue.
The two scripts have different types of handling town growth. If I understand the ViV well enough, it sets a population number for each town and providing cargo to that town can increase that number to some extend. So each town has set limit of how much it can grow. But the speed of growth is not changed.
The feature is still there and works correctly (hopefully). With version 6, the town info box was changed so that the contributor and largest population could be displayed. For that I had to reduce other parameters (20 parameters are supported in total), so the stockpiled number is hidden now. You can still see the stockpiled numbers in the GS console when you enable debug logging in the script settings, but that is more for debugging purposes.PointLuck wrote: ↑12 Jun 2021 13:57 I was wondering if I misunderstand part of the readme or if it's maybe outdated:
I read it as: I dont have to deliver very regularly, like every 30 days or so, instead I can bring larger loads in longer intervals because they will be stockpiled. However, I feel like that's not happening. I often see required/delivered as unsatisfied. Is there a way to see what's stockpiled? Or is that mechanics obsolete?Code: Select all
If you delivery more cargo than necessary, the surplus is stockpiled to be consumed next month (towns can stockpile a quantity of 10 * cargotype requirement).
Ah I missed that part. Ok makes all sense to me. Plus many shorter trains look more busy and fun .But take in account that each category has a set decay percentage, so the stockpile is reduced every month based on that decay. It changes based on economy, for example FIRS 4 Temperate basic has 40% decay for the first category. Supplying big chunks can get less attractive because of that. You can see this number in the Story Book.
The small problem with this is that I cannot really control 100% how much I service a town since it takes it industries into account as well. there might be the only processing industry of its kind in that sector of the map around and this town owns it. Now I don't want to increase growth rate of this town but I need to service the industries. If it was just the passengers, that'd be indeed easy to control.Firrel wrote: ↑12 Jun 2021 15:08RVG mainly modifies the speed of growth, so that providing more cargo to the town increases the speed of growth, so it does not consider the size of the town. Both scripts contain a growth limiter based on the percentage of passangers and mails, which will stop the growth of towns. This I consider in the RVG as the stopping feature of the growth. When the town outgrows the provided services, it will stop growing.
There are two features. One is cargo categories, which modify how fast the towns grow. This is the 3-5 categories which each contain a set of cargo types and providing any of them will contribute to that category in order to increase the growth rate. This however never stops the growth, only slows it down to minimum when categories are not fulfilled to some extend.Lt_Joker wrote: ↑12 Jun 2021 17:54The small problem with this is that I cannot really control 100% how much I service a town since it takes it industries into account as well. there might be the only processing industry of its kind in that sector of the map around and this town owns it. Now I don't want to increase growth rate of this town but I need to service the industries. If it was just the passengers, that'd be indeed easy to control.Firrel wrote: ↑12 Jun 2021 15:08RVG mainly modifies the speed of growth, so that providing more cargo to the town increases the speed of growth, so it does not consider the size of the town. Both scripts contain a growth limiter based on the percentage of passangers and mails, which will stop the growth of towns. This I consider in the RVG as the stopping feature of the growth. When the town outgrows the provided services, it will stop growing.
Maybe the percentage of passengers/main transported should always be the maximum percentage instead of just one category like the others which will average out?
Like factor_percentage = Min(Percentage_PAX, Average(Percentage_All_Other_Categories))
something like that? I'm planning a game with a friend where he most likely will do PAX and I'll do cargo. We want a couple metropolises and also have a few small towns that he services with just a one track branch line. However if I keep servicing indutries that I might need for their output product, I might still push that town into too much unwanted growth.
I know the passenger cargo is usually the biggest number so we can keep that percentage low, but if other categories are served at 100% that'll still cause good growth won't it?
The code does "if (sum_transported / ::CargoLimiter.len() < min_transported)" That's basically the average over all cargo. If I set the percentage for growth at 50% and we service a minimal amount of passengers.. will that still prevent the growth going too high if the other categories are at 100%?
Edit: Btw there's a typo in the settings : Limit Growth: Minimun percentage
The limiter is measured against ALL cargos in the ::CargoLimiter array, which is in most economies pax and mail. From what I see it works as intended, stopping the growth of towns when the average of pax and mail transported is less than the threshold. You can check it by yourself, here is the code with some additional notes.
Code: Select all
case(Economies.BASESET__TEMPERATE): // Base temperate
::CargoLimiter <- [0,2]; // used for the limiter for stopping the growth
::CargoCat <- [[0,2], // category 1
[1,3,4,6,7,8], // category 2
[5,9,10]]; // category 3
::CargoCatList <- [CatLabels.PUBLIC_SERVICES,CatLabels.RAW_MATERIALS,CatLabels.PRODUCTS]; // names of categories
::CargoMinPopDemand <- [0,1000,4000]; // population for the category to kick in
::CargoPermille <- [60,45,25]; // base increase of cargo demand per 1000 residents
::CargoDecay <- [0.4,0.2,0.1]; // monthly decay of stockpiled cargo
break;
Code: Select all
function GoalTown::ManageTownLimiting(threshold_setting, min_transported) {
// if the town limiting is turned off or the size of the town is below the threshold, set requirements to zero
local townPopulation = GSTown.GetPopulation(this.id);
// if the limiter is disabled or town is too small, allow growth and return
if (townPopulation <= threshold_setting || min_transported == 0) {
this.limit_transported = 0;
this.allowGrowth = true;
this.limit_delay = 0;
return;
}
// sum up all transported percentages in the ::CargoLimiter array
// if a cargo is below the threshold, add it to this.limit_transported, so that it can be displayed in the town box
local sum_transported = 0;
this.limit_transported = 0;
foreach (index, cargo in ::CargoLimiter) {
local transported = GSTown.GetLastMonthTransportedPercentage(this.id, cargo);
sum_transported += transported;
if (transported < min_transported)
this.limit_transported += 1 << cargo;
}
// compare the average of all limited cargos to the threshold
// disalow growth when the threshold is not met and the limit delay is zeroed
if (sum_transported / ::CargoLimiter.len() < min_transported) {
++this.limit_delay;
if (this.limit_delay > GSController.GetSetting("limiter_delay")) {
this.limit_delay = 0;
this.allowGrowth = false;
}
} else {
this.allowGrowth = true;
this.limit_delay = 0;
}
}
You are correct this town should be growing, the mail and pax numbers in the town box are above the 50% threshold. Could you please send me your save file? Maybe some variable overflow or something like that has occured.
Ah I see, and this was exactly what I did, too. I took the save offline to fix an issue with another newGRF, then loaded it back up on the server. I know for next time, now. Thank you.Firrel wrote: ↑17 Jun 2021 19:11 Pankratz had a different problem that the game was generated on his local machine and he started the save in a dedicated server and the game script was not started. There seem to be some problem when moving the save file with the GS to another PC, but dont know much about it.