possible bug re: saving forest objects

Friendly conversations, and everything that doesn't fit into the other forums.
8 posts Page 1 of 1
chriscalef
Posts: 381
Joined: Mon Feb 09, 2015 7:48 pm
by chriscalef » Mon Mar 02, 2015 6:16 am
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:

Code: Select all

DefineConsoleMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) { object->saveDataFile( path ); }
I made it this:

Code: Select all

DefineConsoleMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) { if (strlen(path)>0) object->saveDataFile( path ); else object->saveDataFile(); }
Which seems to work fine.
Jason Campbell
Posts: 335
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Wed Mar 25, 2015 5:34 pm
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.
Johxz
Posts: 447
Joined: Sat Feb 07, 2015 11:37 pm
by Johxz » Thu Mar 26, 2015 12:12 am
@
User avatar
chriscalef


How can we replicate the bug?
Online Duion
Posts: 1431
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Mar 26, 2015 1:19 am
The forest editor is known for various issues, it probably needs a complete redesign.
chriscalef
Posts: 381
Joined: Mon Feb 09, 2015 7:48 pm
by chriscalef » Thu Mar 26, 2015 5:13 am
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.
Johxz
Posts: 447
Joined: Sat Feb 07, 2015 11:37 pm
by Johxz » Thu Mar 26, 2015 5:58 am
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.
TorqueFan
Posts: 118
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Thu Apr 30, 2015 5:40 am
Bumped into the same issue and applied the fix by ChrisCalef. Recompiled, worked like a charm. Thanks a lot Chris!
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Thu Apr 30, 2015 6:03 am
I wonder if this is the same issue solved in this PR.
8 posts Page 1 of 1

Who is online

Users browsing this forum: Bishop, Bloodknight and 2 guests