[NoGo] Neighbours are important

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
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: [NoGo] Neighbours are important

Post by Hyronymus »

I really love this script but there is one thing that bugs me: how does one supply Petrol to a town if it hasn't got a petrol station? And if a petrol station is the only way: isn't there a long hiatus in the time that cities reach a size where they need petrol to expand and the availability of petrol for those who start early?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

Hyronymus wrote:I really love this script but there is one thing that bugs me: how does one supply Petrol to a town if it hasn't got a petrol station?
Fund a petrol station
Hyronymus wrote:And if a petrol station is the only way: isn't there a long hiatus in the time that cities reach a size where they need petrol to expand and the availability of petrol for those who start early?
This is an example of another problem that I haven't even been aware of. I only play a few games a year and are inable to know all compatibility issues that can occur when using this script with some combination of (advanced) settings + NewGRFs.

If you want to help, patches are great. Second is to report issues like these ones. Especially if you give me enough facts that I can reproduce the problem so that when/if I find time to make changes to the script code, I can test the changes to verify that I've solved the problem. In your case, it would be great if you can tell me which NewGRF(s) + start year that cause the problem of no petrol being available.

(yes, the solution here is probably not to detect this NewGRF or petrol, but trying to detect the maximum output of all cargos that have each town effect that the town use as town growth condition. However, having a test case is also worth a lot)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: [NoGo] Neighbours are important

Post by Hyronymus »

I'm playing with FIRS 0.8.4 and started my game in 1800. Once I hit home I'll try and find more details. To me it seems fair to use goods or food as a town growing enhancer after passengers and mail no longer suffice. Even then though you are more or less forced to fund industries in towns that don't accept food. With FIRS that are towns without a grocery or hotel, goods are the best bet then and fortunately not too available in an early FIRS economy which keeps it a challenge to grow a town :).
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: [NoGo] Neighbours are important

Post by Hyronymus »

Zuu, in which file are the cargo requirements listed for the temperate climate?
dbkblk
Traffic Manager
Traffic Manager
Posts: 154
Joined: 29 Mar 2008 18:38

Re: [NoGo] Neighbours are important

Post by dbkblk »

Hi ! I have played a game for hours with this script. I realized that the defaut town requirement settings is kinda high for my playstyle. Is there a way to modify the script parameter in the savegame ? I don't want to restart the game.

Anyway, this is a very fun and challenging script !

Thanks,
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

Open the rightmost menu in the main toolbar (unless you play in arabic, in which case it is the leftmost toolbar menu). In this menu, choose the AI/Game Script debug option.

Now you have opened the AI/Game Script debug window. Select the "Game Script" tab and then click on Settings. Here you can change the settings of the current Game Script. In your case, Neighbours are important. All settings that are not greyed out can be changed in a running game.

My policy is usually to allow everything to be changed unless I'm unable to support changing a certain setting in a running game.

Edit: You will need to wait up to about a month for the changes to propagate to all towns.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
dbkblk
Traffic Manager
Traffic Manager
Posts: 154
Joined: 29 Mar 2008 18:38

Re: [NoGo] Neighbours are important

Post by dbkblk »

Thanks you for the tip ! It worked !
dbkblk
Traffic Manager
Traffic Manager
Posts: 154
Joined: 29 Mar 2008 18:38

Re: [NoGo] Neighbours are important

Post by dbkblk »

Zuu, Is there a way to disable the gamescript from a savegame ? I can't manage to find any info. I can only reduce the effects but cannot disable it.

Thanks,
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

dbkblk wrote:Zuu, Is there a way to disable the gamescript from a savegame ? I can't manage to find any info. I can only reduce the effects but cannot disable it.

Thanks,
Any particular reason why you want to disable it?

This was asked some time ago. See this post and the responses that follow it:
http://www.tt-forums.net/viewtopic.php? ... 4#p1058744
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
dbkblk
Traffic Manager
Traffic Manager
Posts: 154
Joined: 29 Mar 2008 18:38

Re: [NoGo] Neighbours are important

Post by dbkblk »

Thanks you.

Yes, there is a reason. I play a multiplayer game with a friend (using the hardpack with cargodist and infrastructure sharing). He take care of industries and i take care of passengers and mail.
The problem is that my company cannot grow if he doesn't bring food because the town are capped with food requirements. We first decreased the requirements but it still stop the developpement of many small towns.
Thor87
Engineer
Engineer
Posts: 3
Joined: 01 Mar 2013 22:03

Re: [NoGo] Neighbours are important

Post by Thor87 »

Hi! I realy love this script! but i don't have any petrol or tourist requirments, only passangers, mail and goods. How can i enable them?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

Thor87 wrote:Hi! I realy love this script! but i don't have any petrol or tourist requirments, only passangers, mail and goods. How can i enable them?
What I currently await is a test case for the problems with oscillation that some people have reported. For that I have a fix which will affect all old savegames so it would be useful to have a test case to test this fix before rolling it out. (players of old saves will be offered an option to select the old behaviour however, I don't want to end up in a situation with more legacy options than necessary due to a fix with problems that were easily detected if there was a test case)

You can read more here:
http://www.tt-forums.net/viewtopic.php? ... 4#p1059604
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
SonicTTD
Engineer
Engineer
Posts: 19
Joined: 03 Feb 2010 21:12

German Translation!? :)

Post by SonicTTD »

Im playing OpenTTD very enthusiastically since a few days ... I like it so much that I just want to contribute to it. I also found your GameScript here, and I thought "Why not?" So my first contribution to it is here: Translation to german.

Needed? Wanted? Was it already there? Or did I do fine? :)

I dont know how to fully include the language file in the script so here it is :)
Attachments
german.txt
(1.46 KiB) Downloaded 199 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

Thank you. I'll include them with the next version, which I think will get released soon. If it doesn't fix the oscillation problems, then those users have had a lot of time to contribute a test case by now.

Your german.txt file load fine in my game here.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

Update - version 6

Changes / news:
  • The neighbour factor is changed to now use the relative rather than absolute town difference as input for calculating the neighbour factor. The old method is still available via a legacy setting. When you upgrade from an old save you will get prompted about this so that you can take action to return to the old behaviour. (I can only have the same default value for new and old games for a given setting.)
  • Now it is possible to disable town growth for selected towns by placing a sign on them. This is off by default to not be abused in multiplayer. See readme for more details.
  • In this version there is a master switch that can be used to return town growth control back to OpenTTD.
  • German translation
New strings
For translators, here is a list of new strings in version 6: (no strings were changed or removed)

Code: Select all

# Empty string for clearing the town GUI when the script is disabled
STR_EMPTY_TOWN_GUI                       :

STR_TOWN_GROWTH_MANUALLY_DISABLED        :Town growth is {RED}disabled{BLACK} via sign control

STR_NOTICE_DISABLING_TAKES_TIME          :{YELLOW}Script disabled{BLACK}{}{}Please note that it takes some time for all towns to restore to default growth.{}{}First all cargo requirements are removed and town growth rate is set to zero. Second thing to happen is that control is passed back to OpenTTD which will manage the towns from time to time. Thus it will take some time before OpenTTD have managed all towns and set their growth rate back to normal.
STR_NOTICE_NEW_TOWN_COMPARE_METHOD       :{YELLOW}Compatibility notice{BLACK}{}{}Your save game was created with an older version of the "Neighbours are important" Game Script (version 5 or older). In version 6, the way to compare town sizes have changed to avoid problems with oscillation. This new method have automatically been selected for your game (although it will take up to a month for all towns to have their goals updated), but for some existing games the old method might be preferred. Some differences are to expect between the two methods.{}{}{YELLOW}Follow these instructions to revert to the old method:{BLACK}{}{}1. Go into the help menu (rightmost button in the main toolbar){}2. Select "AI/Game script debug"{}3. Click on the "Game Script" tab/button if it is not already selected{}4. Click on the "settings" button{}5. Change "Legacy: Neighbour compare method" to "absolute difference"{}6. Wait up to a month for the change to be applied to all towns.{}{}
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
SonicTTD
Engineer
Engineer
Posts: 19
Joined: 03 Feb 2010 21:12

Re: [NoGo] Neighbours are important

Post by SonicTTD »

Cool :)

Here are the new strings also:

Code: Select all

# Empty string for clearing the town GUI when the script is disabled
STR_EMPTY_TOWN_GUI                       :

STR_TOWN_GROWTH_MANUALLY_DISABLED        : Das Wachstum der Stadt wurde durch ein platziertes Schild {RED}deaktiviert{BLACK}

STR_NOTICE_DISABLING_TAKES_TIME          :{YELLOW}Skript deaktiviert{BLACK}{}{}Hinweis: Es benötigt einige Zeit bis die Städte ihr Standart-Wachstum wiederherstellen.{}{}Zunächst werden alle Lieferbedingungen entfernt und die Wachstumsrate auf Null gesetzt. Danach wird die Kontrolle wieder OpenTTD übergeben, welches die Städte von Zeit zu Zeit verwalten wird. Dadurch wird es etwas dauern, bis OpenTTD alle Städte verwaltet- und dessen Wachstumsrate zurück auf normal gestellt hat.
STR_NOTICE_NEW_TOWN_COMPARE_METHOD       :{YELLOW}Kompatibilitätshinweis{BLACK}{}{}Dein gespeichertes Spiel wurde mit einer älteren Version vom "Neighbours are important" Game Skript (Version 5 oder älter) erstellt. In Version 6 wurde die Art, die Größen der Städte zu vergleichen verändert um Schwankungen zu verhindern. Diese neue Methode wurde automatisch für dein Spiel ausgewählt (obwohl es bis zu einem Monat dauern wird, bis die Ziele aller Städte aktualisiert worden sind), aber für einige existierende Spiele könnte die alte Methode bevorzugt werden. Einige Unterschiede können von den beiden Methoden erwartet werden.{}{}{YELLOW}Folge diesen Anweisungen um wieder die alte Methode zu verwenden:{BLACK}{}{}1. Gehe in das Hilfe-Menü (der Button ganz rechts in der Werkzeugleiste){}2. Wähle "KI/Skript debug"{}3. Klicke auf den "Skript" Tab/Button, falls dieser nicht bereits ausgewählt wurde{}4. Klicke auf den Button "Einstellungen"{}5. Ändere "Legacy: Neighbour compare method" zu "absolute difference"{}6. Warte bis zu einem Monat, damit die Änderung bei allen Städten übernommen wird.{}{}

Note: I guess the settings which are mentioned in Step 5 of the revertion to the old method instructions won't be translated?

When can I download the translated version from the content client?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

SonicTTD wrote:Note: I guess the settings which are mentioned in Step 5 of the revertion to the old method instructions won't be translated?
You are correct. Settings for the script are not translatable, so leaving them untranslated in the notice string is the best solution.

SonicTTD wrote:When can I download the translated version from the content client?
You can get version 6 already. It was published just before my forum announcement. It contains your german.txt file. The additional strings will get included in version 7 which I think will get published shortly. (I was for a short moment thinking about delaying 6 and ask for strings, but decided to release it with incomplete translations and rather make a new version again shortly after version 6)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
SonicTTD
Engineer
Engineer
Posts: 19
Joined: 03 Feb 2010 21:12

Re: [NoGo] Neighbours are important

Post by SonicTTD »

Cool.

You said that the new version contains my german.txt file. But something's weird. I see the file when I open up the *.tar and look into the language folder, but In the game the strings are still in english.

How's that?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

SonicTTD wrote:Cool.

You said that the new version contains my german.txt file. But something's weird. I see the file when I open up the *.tar and look into the language folder, but In the game the strings are still in english.

How's that?
It appears to be a bug in OpenTTD. Its a bit nasty as it only shows if you only have the GS in tared form. As soon as you have it in untared form OpenTTD finds the language files fine. When developing GSes I never put them into tars other than for distribution. Thus its not an error that shows on my radar even if I test the translations in the game.

This bug have been documented here: https://secure.openttd.org/bugs/task/5509

Thanks for reporting.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] Neighbours are important

Post by Zuu »

Update - Version 7

News:
  • Add: French translation (krinn)
  • Update: German translation (SonicTTD)
  • Update: Swedish translation

Due to the bug mentioned above, you will need to untar the Game Script in order to use the translations until there is a fix. Preferable put the extracted folder in <OpenTTD dir>/game instead of <OpenTTD dir>/content_download/game. The content_download directory is intended only for files managed by OpenTTD.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google Adsense [Bot] and 6 guests