Author Topic: Heightmaps  (Read 6709 times)

Where do I put the image to load in the Mission Editor?


There are pretty much no existing examples of this being used in this general version of Torque.

They still work, I've used them recently. The entire folder for them is missing though. You have to create a new tree of folders just for heightmaps, it's like base/editor/heightmaps or something, I don't remember. I'll look it up this weekend and let you know.

Sorry for the late update.

Space Guy modified the editor to look elsewhere for heightmaps. Line 1985 of EditorGui.cs says

Code: [Select]
$TerraformerHeightfieldDir = "editor/heightScripts"; //badspot: removed common/
This worked a couple updates ago, but as I recall the mission editor has been removed from the Blockland website and neither editor nor common are default directories anymore so we can't use them.

If you open it up and change that line to

Code: [Select]
$TerraformerHeightfieldDir = "add-ons/heightscripts";
then create a folder in your add-ons folder called heightscripts it will work. I don't really like throwing random folders in add-ons like that but I think putting it in base or something is an even worse idea. If you really want to keep your add-ons folder neat then you may be able to set it to ./ and just add all your heightmaps to the zip file. If you're making maps though your add-ons folder is probably already a giant mess with lots of unfinished maps so a stray heightmaps folder shouldn't be too big of a deal.

And here's just an optional but cool thing you can do: open up editorRender.cs and look at line 28:
Code: [Select]
%editor.consoleFillColor = "0 0 0 0";
change it to

Code: [Select]
%editor.consoleFillColor = "255 128 0 64";
It will make your spawn spheres fill in a transparent orange color so you can see the intersection with interiors and terrain better.
« Last Edit: October 31, 2011, 10:56:02 AM by Wedge »

but as I recall the mission editor has been removed from the Blockland website
But not the forums

But not the forums
Yes, I know that. The point is that the old way of using heightmaps (download editor.zip, run the executable using -mod editor, and then creating a common/editor/heightscripts/ directory) doesn't work anymore.

What size should the images be?

256x256 grayscale png

Yes, I know that. The point is that the old way of using heightmaps (download editor.zip, run the executable using -mod editor, and then creating a common/editor/heightscripts/ directory) doesn't work anymore.

If you download the editor.zip, extract it to editor/ (resulting in same file structure, just not in a zip), and create a main.cs file inside config/, you can work with it the way you used to, minus the launch parameters, since it loads automatically. So now that you have an editor folder, you can create a heightscripts folder within that and place your images there which will be recognized by the gui.

Code: [Select]
setModPaths(getModPaths() @ ";editor");
exec("editor/main.cs");

Sorry for the late update.

Space Guy modified the editor to look elsewhere for heightmaps. Line 1985 of EditorGui.cs says

Code: [Select]
$TerraformerHeightfieldDir = "editor/heightScripts"; //badspot: removed common/
This worked a couple updates ago, but as I recall the mission editor has been removed from the Blockland website and neither editor nor common are default directories anymore so we can't use them.

If you open it up and change that line to

Code: [Select]
$TerraformerHeightfieldDir = "add-ons/heightscripts";
then create a folder in your add-ons folder called heightscripts it will work. I don't really like throwing random folders in add-ons like that but I think putting it in base or something is an even worse idea. If you really want to keep your add-ons folder neat then you may be able to set it to ./ and just add all your heightmaps to the zip file. If you're making maps though your add-ons folder is probably already a giant mess with lots of unfinished maps so a stray heightmaps folder shouldn't be too big of a deal.

And here's just an optional but cool thing you can do: open up editorRender.cs and look at line 28:
Code: [Select]
%editor.consoleFillColor = "0 0 0 0";
change it to

Code: [Select]
%editor.consoleFillColor = "255 128 0 64";
It will make your spawn spheres fill in a transparent orange color so you can see the intersection with interiors and terrain better.

Great thanks, it works. Full quote for archival purposes.

Edit: Did some testing and it appears that the heigtmaps need to be inside the editor folder.
« Last Edit: November 13, 2011, 09:42:47 AM by Demian »

Truce's method should work too, assuming main.cs doesn't get replaced by the launcher all the time.

Can you generate a heightmap from an already-existing terrain file?

Can you generate a heightmap from an already-existing terrain file?
I think you should be able to as you can see a green heightmap in a little box in the terrain creator mode.

If you open up the terrain editor then go to file there should be an option that says "Export Terraform Bitmap." It will export it as a 256x256 png file to your heightscripts folder.