Disabling basetexture generation

There are no stupid questions, just stupid answers.
5 posts Page 1 of 1
Duion
Posts: 1647
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Oct 11, 2015 9:46 pm
I need to disable the automatic basetexture regeneration when something is changed on the map, but only in certain cases.
My workflow involves editing the automaticly generated terrain level_basetex.dds file to make the terrain more individual and detailed and as a workaround I just set the file to write protected, the problem is if you distribute the game to other platforms the permissions are not kept, so I need a new method now, any ideas?
Gav
Posts: 13
Joined: Sun Feb 08, 2015 10:26 pm
by Gav » Sun Oct 11, 2015 10:40 pm
I think the proper way is to add a new field to the terrain object (a boolean flag). Then you can modify this function to check the flag and enable or disable the basetexture generation.
Duion
Posts: 1647
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Oct 11, 2015 11:02 pm
Sounds good, but I have no idea how to do that. I know that you can set dynamic fields for objects in the editor, but I don't know how to do it on the C++ side.
Gav
Posts: 13
Joined: Sun Feb 08, 2015 10:26 pm
by Gav » Mon Oct 12, 2015 12:02 am
You just need to copy an existing variable like this. You can create a new protected boolean variable mUpdateTexture to the class, initialize it with true here and add the field here. Then change this line to:

Code: Select all

if ( Platform::compareModifiedTimes( baseCachePath, mTerrFileName ) < 0 && mUpdateTexture )
.

EDIT: You also need to read/write the mUpdateTexture variable to the network stream (TerrainBlock::packUpdate() & TerrainBlock::unpackUpdate())
Duion
Posts: 1647
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Mon Oct 12, 2015 1:50 am
Wow thanks, seems to work. Only drawback is when you paint the terrain it changes, but at least it does not get saved later into that file, which is enough for me for now.
5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 13 guests