Duion Posted October 11, 2015 Share Posted October 11, 2015 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? Quote Link to comment Share on other sites More sharing options...
Gav Posted October 11, 2015 Share Posted October 11, 2015 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. Quote Link to comment Share on other sites More sharing options...
Duion Posted October 11, 2015 Author Share Posted October 11, 2015 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. Quote Link to comment Share on other sites More sharing options...
Gav Posted October 11, 2015 Share Posted October 11, 2015 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: 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()) Quote Link to comment Share on other sites More sharing options...
Duion Posted October 11, 2015 Author Share Posted October 11, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.