8 terrain textures instead of 6
by Mindwedge · 04/14/2005 (11:29 pm) · 46 comments
Hi all
---------------
TGE 1.3 files
---------------
Step 1: replace your common/editor/EditorGui.gui file with this
file.
Step 2: replace your common/editor/EditorGui.cs file with this
file.
--------------------
UPDATE FOR 1.4
--------------------
1.4 is using a changed directory structure. BEWARE! If you have been using 1.3 and you update to 1.4 some of your scripts may not work as they used to.
Here are the updated files for 1.4 (tested with the 1.4 demo for validity). Place them in your creator/editor folder:
EditorGui.cs
EditorGui.gui
If the server is down for these files try again later. The server is rarely down for more than an hour.
Have fun!
Note: You'll want to verify the bitmap paths for the default textures in EditorGui.gui to match your own development paths, else it will cause an error message in your console log.
---------------
TGE 1.3 files
---------------
Step 1: replace your common/editor/EditorGui.gui file with this
file.
Step 2: replace your common/editor/EditorGui.cs file with this
file.
--------------------
UPDATE FOR 1.4
--------------------
1.4 is using a changed directory structure. BEWARE! If you have been using 1.3 and you update to 1.4 some of your scripts may not work as they used to.
Here are the updated files for 1.4 (tested with the 1.4 demo for validity). Place them in your creator/editor folder:
EditorGui.cs
EditorGui.gui
If the server is down for these files try again later. The server is rarely down for more than an hour.
Have fun!
Note: You'll want to verify the bitmap paths for the default textures in EditorGui.gui to match your own development paths, else it will cause an error message in your console log.
#2
and all I can find is a change in these 2 functions in the cs file:
[code]
function EPainterChangeMat(%file)
{
// make sure the material isn
04/15/2005 (4:46 am)
For anyone who is interested it looks like what Digital Dave did was add the };
new GuiBitmapCtrl(ETerrainMaterialBitmap6) {
...
};
new GuiTextCtrl(ETerrainMaterialText6) {
...
};
new GuiButtonCtrl(ETerrainMaterialChange6) {
...
};
new GuiBorderButtonCtrl(ETerrainMaterialPaint6) {
...
};
new GuiBitmapCtrl(ETerrainMaterialBitmap7) {
...
};
new GuiTextCtrl(ETerrainMaterialText7) {
...
};
new GuiButtonCtrl(ETerrainMaterialChange7) {
...
};
new GuiBorderButtonCtrl(ETerrainMaterialPaint7) {
...
};and all I can find is a change in these 2 functions in the cs file:
[code]
function EPainterChangeMat(%file)
{
// make sure the material isn
#3
04/15/2005 (6:45 am)
is that really it? all you need to do to add more than 6 textures is add 4 more gui controls to editor.gui and change the number of iterations for 2 loops in editor.cs? can anyone confirm this?
#4
04/15/2005 (7:14 am)
Thats what it looks like.... I will try it tonight to find out, but that is the only references I could find in the files to change it... I dont see someone posting this unless it worked......
#5
04/15/2005 (7:20 am)
cool. thanx dave. this resource is a definite 5.
#6
04/15/2005 (12:22 pm)
Good job Dave!
#7
04/15/2005 (2:10 pm)
I think you would need to change torque to eccept (except, accept I have trouble remembering which is which) it.
#8
04/15/2005 (7:12 pm)
By default Torque has support for 8 terrain textures, it's the editor that had it limited to 6. But indeed you do have to change the source code in order to use more than 8 textures.
#9
Of course you can have more. This resource is intended as an easy 'patch' for non-programmers. Going beyond 8 textures is going to cover quite a bit of screen space, which will limit your work area.
Even at 800x600 this 'patch' will make all textures available - which is desirable.
I don't have use for more than eight terrain textures at the moment, but if you do you might create another box horizontally across the top, and left justified.
So if you do want more than 8, pay attention to Martin's advise.
Bottom line - it's safe to use in any TGE build.
04/19/2005 (1:12 pm)
Quote:Can this be used to further extend the number of terrain textures you can use?
Of course you can have more. This resource is intended as an easy 'patch' for non-programmers. Going beyond 8 textures is going to cover quite a bit of screen space, which will limit your work area.
Even at 800x600 this 'patch' will make all textures available - which is desirable.
I don't have use for more than eight terrain textures at the moment, but if you do you might create another box horizontally across the top, and left justified.
Quote:By default Torque has support for 8 terrain textures, it's the editor that had it limited to 6. But indeed you do have to change the source code in order to use more than 8 textures.
So if you do want more than 8, pay attention to Martin's advise.
Bottom line - it's safe to use in any TGE build.
#10
04/21/2005 (9:39 am)
great resource
#11
06/11/2005 (1:58 pm)
This is a great resource. Sometimes six just aint enough =)
#12
08/02/2005 (9:03 am)
hmm.. great resource, i believe this will benefit the entire community if these were integrated into the next builds of the TGE rather than doing this procedure everytime a new TGE version is available
#13
I don't know what I'm doing wrong.
08/18/2005 (5:57 pm)
I've tried going beyond 8 textures by altering the source. Nothing that I've tried seems to work. I can click CHANGE on the 9th texture selector and select a texture, but it won't show up in the selector window and I can't paint the terrain with it either.I don't know what I'm doing wrong.
#14
Check out the screenshots:
www.omnivirtual.com/screenshot1.jpg
www.omnivirtual.com/screenshot2.jpg
12/14/2005 (1:37 pm)
Within the file terrData.h, change the MaterialGroups to the number of textures you are wanting to use. I currently have 15 textures working flawlessly. Something to note about this. If you load a saved level, it will most likely dork the textures. Don't worry, just select all of the textures you are going to use and then regenerate the textures through the fractal terrain texture generator in the edtior.enum {
BlockSize = 256,
BlockShift = 8,
LightmapSize = 512,
LightmapShift = 9,
ChunkSquareWidth = 64,
ChunkSize = 4,
ChunkDownShift = 2,
ChunkShift = BlockShift - ChunkDownShift,
BlockSquareWidth = 256,
SquareMaxPoints = 1024,
BlockMask = 255,
GridMapSize = 0x15555,
FlagMapWidth = 128, ///< Flags that map is for 2x2 squares.
FlagMapMask = 127,
MaxMipLevel = 6,
NumBaseTextures = 16,
[b]MaterialGroups = 15,[/b]
MaxEmptyRunPairs = 100
};Check out the screenshots:
www.omnivirtual.com/screenshot1.jpg
www.omnivirtual.com/screenshot2.jpg
#15
12/14/2005 (1:48 pm)
Do you mean that if you load an existing mission that does NOT use 15 terrain textures that it will likely mess up the terrain until you fix it by hand?
#16
12/14/2005 (2:02 pm)
No, I mean you will have to go into the 'Terrain Texture Editor' via the F8 key and add all of the textures and their placement operations and 'Apply' the setting. This will remap the textures to the terrain and get rid of any artifacts or strange textures. This only needs to be done if your textures look corrupted or are otherwise not displaying properly.
#17
You said:
What kind of level are you loading that makes this "dork" occur? My guess was that if you load an old terrain that wasn't created by a 15-texture-terrain enabled EXE, that you'll need to fix up the terrain by hand (using the Terrain Texture Editor) the first time you load it...
12/14/2005 (2:06 pm)
I don't mean to be dense, but I'm still not following you... and I don't think you are understanding my question... ;-)You said:
Quote:If you load a saved level, it will most likely dork the textures.
What kind of level are you loading that makes this "dork" occur? My guess was that if you load an old terrain that wasn't created by a 15-texture-terrain enabled EXE, that you'll need to fix up the terrain by hand (using the Terrain Texture Editor) the first time you load it...
#18
www.omnivirtual.com/screenshot3.jpg
So I have to go in to the Terrain Texture Editor and regenerate the terrain and then the terrain displays properly. I'll eventually take the time to track down the problem, but for now it seems to work pretty well.
12/14/2005 (2:14 pm)
For Example, the when I load the Stronghold demo level, here is what I see:www.omnivirtual.com/screenshot3.jpg
So I have to go in to the Terrain Texture Editor and regenerate the terrain and then the terrain displays properly. I'll eventually take the time to track down the problem, but for now it seems to work pretty well.
#19
When you are defining your ETerrainMaterialBitmap within the EditorGui.gui file, you need to make sure that the texture file exists that you are specifying within the bitmap parameter, otherwise you will get the strange textures being displayed..
12/14/2005 (2:21 pm)
I figured out the problem with the strange textures.When you are defining your ETerrainMaterialBitmap within the EditorGui.gui file, you need to make sure that the texture file exists that you are specifying within the bitmap parameter, otherwise you will get the strange textures being displayed..
new GuiBitmapCtrl(ETerrainMaterialBitmap0) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "122 311";
extent = "96 96";
minExtent = "8 8";
visible = "1";
helpTag = "0";
// This needs to point to an existing texture
bitmap = "starter.fps/data/terrains/grassland/grass";
wrap = "1";
};
#20
After a mission load, doesn't it change all the texture bitmaps in the GUI anyway...? Maybe the "bitmap = ..." fix just ensures the paths are valid when the GUI is initially created, and if the mission only has 3 terrain textures, it doesn't touch the other slots (leaving them with whatever texture was used when the GUI items were initially created in the .gui file)...
12/14/2005 (2:36 pm)
Does that fix the random garbage in the text above each empty texture in the Terrain Texture Editor as well? I'm guessing it does...After a mission load, doesn't it change all the texture bitmaps in the GUI anyway...? Maybe the "bitmap = ..." fix just ensures the paths are valid when the GUI is initially created, and if the mission only has 3 terrain textures, it doesn't touch the other slots (leaving them with whatever texture was used when the GUI items were initially created in the .gui file)...

Torque Owner Chris Labombard
Premium Preferred