Patch for #2155 - Heightmaps for dedicated servers

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Der_Herr
Engineer
Engineer
Posts: 1
Joined: 14 Sep 2012 11:31

Patch for #2155 - Heightmaps for dedicated servers

Post by Der_Herr »

Hi,

i created a patch for loading heightmaps via console. This patch is closely derived from the "newgame" console command with only small deviations.

It accepts bitmaps or pngs in the heightmap folder.

You can use the command like

a) newheightmapgame Test.bmp

this loads the heightmap from $OpenttdFolder/scenario/heightmap/Test.bmp

b) newheightmapgame

It works also on servers: rcon pw "newheightmapgame Test.bmp"

this starts a new game with a new seed with the previous loaded heightmap.

Please feel free to contribute code to improve the patch!

Best wishes,
Der_Herr

I wanted to attach the patch file and an example but there was some error in the server, therefore i provide 2 Dropbox Links:
The patch file
An annular example bitmap

EDIT 1: Added code better sticking to the coding style guidelines.
Attachments
Heightmap_Console_command.patch
(4.07 KiB) Downloaded 186 times
Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Patch for #2155 - Heightmaps for dedicated servers

Post by Gigigonzalez »

Does this patch still work against current revision? And would it be able to work with something like autopilot? Assuming something with Args = ./openttd xxxx in the config file?

Mhh..
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 42 guests