GS: Industry Constructor

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
sevenfm
Engineer
Engineer
Posts: 73
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: GS: Industry Constructor

Post by sevenfm »

Found this script very interesting.
Is it possible to modify it to only build new industry if town has enough population?

For example:
1000 - max 1 industry
2000 - max 2 industry
4000 - max 3 industry
...

With this change and industry building set to town type only, the player will have to grow towns to get new industries, representing economy deveolpment and the fact that industry needs workers.
For example, if towns are allowed to grow to 1000 by only passenger/mail service, this will give starting set of industries, then if you want to develop country more, deliver food/goods to a group of towns to allow towns grow to 2000, this will allow opening of new industries and so on.
I like trains. They are soothing.

User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 165
Joined: 17 Nov 2007 17:23
Skype: ben313371

Re: GS: Industry Constructor

Post by Ben1338 »

There seems to be a problem with the game script, I look at the debug menu and it repeatedly says that the Town List is empty.

User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 685
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: GS: Industry Constructor

Post by JacobD88 »

A wee bit of a necro
However, i have found a previously unreported crash with the Map Constructor update given on Page 2 of this thread

To replicate, add the Map Constructor GS, create a new game (i used 512x512 with industry generation set to "funded only") the script crashes shortly after launch
MapConstructor_v0-9_Crash1.png
(32.23 KiB) Not downloaded yet

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1264
Joined: 15 Feb 2003 17:32
Location: Villefranche-sur-Saône, France

Re: GS: Industry Constructor

Post by MagicBuzz »

Why do you use version 1 while there is a version 3 both on BaNaNaS and on the first message of the thread?

User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 685
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: GS: Industry Constructor

Post by JacobD88 »

MagicBuzz wrote:
21 Jul 2020 17:21
Why do you use version 1 while there is a version 3 both on BaNaNaS and on the first message of the thread?
Because version 0.9/1.0 of MAP Constructor on Page 2 of this thread (second download at the bottom of page) is newer than version 3 of Industry Constructor with new features like town generation and road linking
As the original dev said, it's far more than an Industry Creation script now, so was rebranded
But sadly not uploaded to BaNaNaS

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1264
Joined: 15 Feb 2003 17:32
Location: Villefranche-sur-Saône, France

Re: GS: Industry Constructor

Post by MagicBuzz »

I see in the code the program throw an error when the industry it tries to build is not build-able.

According to the NewGRF and some other parameters (game date, etc.) industries actually can't be unavailable and I wonder why the author thrown an error in this case.

I "fixed" it by simply aborting industry construction.
But I didn't tested it.
Attachments
MapConstructor.tar
(180.5 KiB) Downloaded 45 times

User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 685
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: GS: Industry Constructor

Post by JacobD88 »

Many thanks, will try out and report back
Have you halted all industry building or just the failed industry?

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1264
Joined: 15 Feb 2003 17:32
Location: Villefranche-sur-Saône, France

Re: GS: Industry Constructor

Post by MagicBuzz »

Just the building attempt when it occurs.
So the next time the script would try to create industries it should try again.

User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 685
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: GS: Industry Constructor

Post by JacobD88 »

Hmmm, odd
Your modified script appears to be missing all of the newer Map Constructor features (like road linking)

Your modified version
MapConstructor_v0-9_Modified_Issue1.png
(82.72 KiB) Not downloaded yet
Unedited version from bottom of Page 2
MapConstructor_v0-9_Settings 1.png
(118.42 KiB) Not downloaded yet
Did you definitely modify the Map Constructor Script?

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1264
Joined: 15 Feb 2003 17:32
Location: Villefranche-sur-Saône, France

Re: GS: Industry Constructor

Post by MagicBuzz »

I see only one MapConstructor download at page 2 and I downloaded it.

Are you sure you use this one ?

User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 685
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: GS: Industry Constructor

Post by JacobD88 »

I did
It's very very odd that your modified one removes those options unintentionally
But the one from page 2 still has them

But there's a 110KB difference between the page 2 tar (290kb) and your one (180KB) also

User avatar
GeekToo
President
President
Posts: 959
Joined: 03 Jun 2007 22:22

Re: GS: Industry Constructor

Post by GeekToo »

MagicBuzz wrote:
23 Jul 2020 18:04
I see only one MapConstructor download at page 2 and I downloaded it.

Are you sure you use this one ?
Actually, there are 2 downloads, also here: viewtopic.php?p=1110996#p1110996

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1264
Joined: 15 Feb 2003 17:32
Location: Villefranche-sur-Saône, France

Re: GS: Industry Constructor

Post by MagicBuzz »

Doh! :shock:

That explains many things!

Here is the modified version of this second download...
Attachments
MapConstructor.tar
(290 KiB) Downloaded 15 times

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 13 guests