How To Use Giants GRLE Converter

Game Version: FS11 and later
GE Version: ? and later


Modding Index | Modding Tools Tutorials


How to use the GRLE Converter to calculate the area of a Field.

Software required: [list] [li]Giants GRLE Converter[/li] [li]Winzip, Jzip, 7zip or WinRar[/li] [li]Notepad++[/li] [li]Image Editing Software of you choice[/li] [/list]

Knowledge required: [list] [li]able to unzip zip files to a specific place[/li] [li]able to open and edit files in Notepad++[/li] [li]able to use Windows Explorer (File Manager)[/li] [li]able to use image editing software (basic knwoledge)[/li] [/list]

Advanced Knowledge required:

Associated Documents:

This Tutorial will work for both FS11 and FS13.

This Tutorial will show you basically step by step, how to use the GRLE converter by Giants

[hr]

[hr]

First you will need to download Giants GRLE Converter.

To do this you need to go to the Giants Developer Network

http://gdn.giants-software.com/

GDN Giants Developer Network[/url] and register. Once registered, login, navigate to the Download Section, and download the GRLE Converter - grleConverter_4.1.8_win32.zip.

As always there are many ways to do the same thing on a computer. This is my way of using the GRLE Converter, there will be other ways and they may be easier.

For those of us that have been around since the days of Windows 3.1 or (earlier…) working with batch files will be remembered with fondness…

[hr]

You will need to work in a temporary folder, so I made the classic Temp folder on C:\ drive

You can make a Temporary folder anywhere you like.

Unzip or extract the contents of the grleConverter_4.1.8_win32.zip to your Temp folder.

It should look like this.

[center]img-eu1.fs-uk.com_84448_26_02_13_4_39_31_3.jpeg[/center]

Basically it converts a GRLE file into a PNG file that you can open in an Image Editing Program, that you can then in our case work out how big a field is. Astute readers may suddenly hear a pin drop…

and realise it is possible to reverse engineer the textures of a map…

Be aware that the sound of that pin dropping may turn into the sound of an avalanche as it is easy to put more than the allowed 4 textures into a square and so have a rather Bad Allocation…

The next step is to copy the convertSample batch file. So highlight, select or left mouse click on the convertSample file and press CTRL C then press CTRL V – this should make a copy of the file.

http://img-eu1.fs-uk.com/84448_26_02_13_4_39_31_2.jpeg

We will (in this case) be converting the cultivator_density.grle file

[center]img-eu1.fs-uk.com_84448_26_02_13_4_39_31_1.jpeg[/center]

Select the copy of the file and press F2 this will allow you to edit the filename. Rename it convert_cultivator_density.

[center]img-eu1.fs-uk.com_84448_26_02_13_4_39_31_0.jpeg[/center]

Then right mouse click select on the file and open it in Notepad++

[center]img-eu1.fs-uk.com_84448_26_02_13_4_38_41_4.jpeg[/center]

You should see one line of code - which is the original batch file.

[center]img-eu1.fs-uk.com_84448_26_02_13_4_38_41_3.jpeg[/center]

You need to edit this line to read as in the image below.

At this point you should see the relationship, the exe file converts a given GRLE file into a PNG file of the name given.

I have made the filenames exactly the same to keep things obvious. If you convert other GRLE files, they will be converted in the same folder so it pays to remain consistent to avoid confusion…

[center]img-eu1.fs-uk.com_84448_26_02_13_4_38_41_2.jpeg[/center]

Now you need to copy the cultivator_density.grle file from your map into your temporary folder.

This will be found in the map01 folder of your map folder. As in Image 3 above. Copy it to your temp folder so it shows as below.

[center]img-eu1.fs-uk.com_84448_26_02_13_4_38_41_0.jpeg[/center]

Then drag your cultivator_density.grle file and drop it onto the convert_cultivator_density.bat file.

[center]img-eu1.fs-uk.com_84448_26_02_13_4_37_18_4.jpeg[/url][/center]

A popup DOS window will appear briefly as the grleConverter.exe file does it thing.

When the popup closes, you will be left with a cultivator_density.png.

[center]img-eu1.fs-uk.com_84448_26_02_13_4_37_18_3.jpeg[/center]

[center][img width=750]http://img-eu1.fs-uk.com/84448_26_02_13_4_37_18_2.jpeg[/img][/center]

Above is the default cultivator_density.png from Hagenstadt.

2 corrections from Bassaddict:

Open it in paint.net.

Select the magic wand,

Set the tolerance to 0 (zero)

Click in a field and note the number of pixels at the bottom.

And then divide that number by 40,000 to get the hectares.

all the above circled in red on the pic below

[center][img width=750]http://img-eu1.fs-uk.com/84448_31_03_14_8_30_06.jpeg[/img][/center]

You can make a global convert batch file, that will convert all grle files in a folder, just by dragging and dropping one grle file onto it.

Copy the code from the box below into Notepad++ (or similar) and save it as globalConvert.bat

for %%f in (*.grle) do (
	CALL grleConverter.exe %%~nf.grle -out %%~nf.png
)

thanks to Bassaddict for both the above improvements


Original Author: sandgroper | Date: February 26, 2013

Modding Index | Modding Tools Tutorials