chriscalef Posted March 2, 2015 Share Posted March 2, 2015 Just started messing around with a forest in my current T3D build (haven't updated in a couple of weeks, sorry if it's been fixed) and I noticed I could place a forest and add a few trees, but on save and reload my forest would be gone.On further investigation it turned out to be what looks like a bug, easily solved. When you initially create the forest, it gets saved, empty, to a new .forest file. However, when you save the mission, in tools/forestEditor/main.cs it calls "theForest.saveDataFile()" with no argument.Unfortunately, in forest.cpp, the saveDataFile console method expects a path, and if it finds none it apparently sends an empty string rather than a null on to the saveDataFile engine function, which then resets its mDataFileName to "" instead of the useful path it had before.I fixed this locally by the following change to the console method. Instead of this: DefineConsoleMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) { object->saveDataFile( path ); } I made it this: DefineConsoleMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) { if (strlen(path)>0) object->saveDataFile( path ); else object->saveDataFile(); } Which seems to work fine. Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted March 25, 2015 Share Posted March 25, 2015 I wonder why no one has responded. This perhaps should be included in a bugfix for a future version. I know I had tons of trouble with forest editor in 3.5. Quote Link to comment Share on other sites More sharing options...
Johxz Posted March 25, 2015 Share Posted March 25, 2015 @chriscalefHow can we replicate the bug? Quote Link to comment Share on other sites More sharing options...
Duion Posted March 26, 2015 Share Posted March 26, 2015 The forest editor is known for various issues, it probably needs a complete redesign. Quote Link to comment Share on other sites More sharing options...
chriscalef Posted March 26, 2015 Author Share Posted March 26, 2015 I can't say for sure it isn't a local issue, but to replicate the bug, if you have it, simply create a new mission, add a forest, create some trees, save it, and see if the trees are still there when you reload it next time. Quote Link to comment Share on other sites More sharing options...
Johxz Posted March 26, 2015 Share Posted March 26, 2015 I was toying with the forest editor and don't have "bugs". I tested in a clean 3.6.3 and development version. I add a forest and mixes trees from the library/meshes, save and the forest still there.What version do you have, development or 3.6.3? Are you using default models or custom one?can you create a new project with the same template you used? and check if you still have the bug. Quote Link to comment Share on other sites More sharing options...
TorqueFan Posted April 30, 2015 Share Posted April 30, 2015 Bumped into the same issue and applied the fix by ChrisCalef. Recompiled, worked like a charm. Thanks a lot Chris! Quote Link to comment Share on other sites More sharing options...
buckmaster Posted April 30, 2015 Share Posted April 30, 2015 I wonder if this is the same issue solved in this PR. 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.