[GS] Released Scenario Builder

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

le_harv
Engineer
Engineer
Posts: 65
Joined: 27 Sep 2014 05:16
Location: Calgary, Canada

Re: [GS] Released Scenario Builder

Post by le_harv »

jimbob wrote:
Hey, I'm affraid I can't really remember much about this script, but I believe I ran it through the debug console. Because parts of the script were ran through a company (roads) and rail and canals were planned it was converted to an AI which only run in a game. Having let the script run in the new game, you can rename the extension to open the "game save" as a scenario again.

The UK heightmap I used was a geospatial TIFF which was in OSGB coordinates, I had to sample coordinates at the two ends of the UK to get scaling factor to convert between OSGB and pixels. All my points for towns/rivers/roads were loaded from a number of Ordance Survey layers also in OSGB. QGIS is very good at handling all the coordinates and heightmap information as well as all the different strange coordinates systems maps use. I would do everything in QGIS before converting your layers to any projection which uses Eastings and Northings in meters, then manually do the conversion between meters and pixels.

Of course if your heightmap is not a geospatial image (the good news is you don't have to worry about GIS, but the bad news is you can't just auto generate your towns from map data), I would start off with pixels coordinates, any decent image editor should be able to get your pixel coordinates, and just move your cursor to the point and copy the numbers into that section of the nut file. This would also need ripping out all of the code which converts OSGB to pixels

I don't know anything about patch packs but if the pack can load vanillia scenarios I'd run it all in vanillia before loading it with JGR.
Thanks for getting back to me on this. The plan was always to compile a list of pixel coordinates but then you mentioned ripping out code. This might be above my pay grade! More tinkering required!

User avatar
jimbob
Engineer
Engineer
Posts: 87
Joined: 24 Nov 2014 21:13
Location: At a desk
Contact:

Re: [GS] Released Scenario Builder

Post by jimbob »

le_harv wrote: Thanks for getting back to me on this. The plan was always to compile a list of pixel coordinates but then you mentioned ripping out code. This might be above my pay grade! More tinkering required!
No worries, you should be able to handle it, it currently has a list of coordinates like your plan, only they get passed through a function f(x)=ax+c f(y)=by+d

where a,b,c,d are to convert from British National Grid meters into map pixels

either remove the transform functions or set a,b,c,d = 1

some of the industries and trees are a little fancier as you can set the top left and bottom right bounding box to create many industry/trees within the box. likewise the roads you can set the two positions to build a road between.
Image
Real life transport planner
My projects:Link to my UK Scenario|Scenario Builder GS
Do check out my 3D unity transport game: transporter

speeder
Engineer
Engineer
Posts: 25
Joined: 16 Jul 2014 05:57

Re: [GS] Released Scenario Builder

Post by speeder »

Sorry for the necro, but just to confirm... this script can import real world city data into the scenario?

User avatar
jimbob
Engineer
Engineer
Posts: 87
Joined: 24 Nov 2014 21:13
Location: At a desk
Contact:

Re: [GS] Released Scenario Builder

Post by jimbob »

speeder wrote:
13 May 2020 08:18
Sorry for the necro, but just to confirm... this script can import real world city data into the scenario?
Yes, it was hard coded for some UK data but if you can change the excel file and copy and paste the code into the nut file you can make it work for anywhere you can find data for :D
Image
Real life transport planner
My projects:Link to my UK Scenario|Scenario Builder GS
Do check out my 3D unity transport game: transporter

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests