Forest Editor Throws Asset Exception Error If Mis Is Not in the /levels root - RESOLVED (THREED-2059)
by Logan Foster · in Torque 3D Professional · 06/24/2011 (1:21 pm) · 3 replies
I ran across an annoying little bug today with the Forest Editor, whenever I tried to apply it to my custom mission file that I am making, it would try to add the forest datablock and then crash saying that I was missing the necessary assets. However if I tried to add the forest data to the Empty Scene mission it worked fine! This obviously told me that there was some sort of bug that the Forest Editor did not like.
When I compared my mission to the stock Empty Scene mission, the only difference is that the Empty Scene mission is located in the /levels root, however my custom mission is located in a folder within /levels (we are doing this to support chunked downloads). Since this is the only difference I tested out my theory by creating the Forest Editor in the Empty Room, saved the file, and then copied the .forest file and the Forest datablock from the Emptry Room to my custom mission... and low and behold it worked!
Reproduction steps:
1. Create a new mission file and save it
2. Move the .mis and .ter file to a folder within the /levels folder
3. Update the .mis file to point to the new .ter location in a text editor
4. Load T3D and go into the mission editor, load your mission
5. Actiave the Forest tool and apply to your scene, it should warn you about how there is no forest datablock and ask you to create one. Click ok.
6. T3D will throw a missing asset exception error at you.
How to get around this for the time being steps:
1. Load the Empty Scene mission file
2. Activate the forest tool and apply to your scene. T3D will warn you about needing to create a forest datablock. Click OK.
3. Apply a tree.
4. Save the scene.
5. Exit T3D
6. Copy the .forest file to the folder in your /levels directory with your mission
7. Open the Empty Scene.mis file in a text editor and grab the Forest datablock data (copy)
8. Open your custom scene misssion file in a text editor and paste the Forest datablock data
9. Update the path of the Forest datablock accordingly
10. Save your custom mission
11. Load T3D, go into the mission editor, apply objects with the Forest tool
Logan
When I compared my mission to the stock Empty Scene mission, the only difference is that the Empty Scene mission is located in the /levels root, however my custom mission is located in a folder within /levels (we are doing this to support chunked downloads). Since this is the only difference I tested out my theory by creating the Forest Editor in the Empty Room, saved the file, and then copied the .forest file and the Forest datablock from the Emptry Room to my custom mission... and low and behold it worked!
Reproduction steps:
1. Create a new mission file and save it
2. Move the .mis and .ter file to a folder within the /levels folder
3. Update the .mis file to point to the new .ter location in a text editor
4. Load T3D and go into the mission editor, load your mission
5. Actiave the Forest tool and apply to your scene, it should warn you about how there is no forest datablock and ask you to create one. Click ok.
6. T3D will throw a missing asset exception error at you.
How to get around this for the time being steps:
1. Load the Empty Scene mission file
2. Activate the forest tool and apply to your scene. T3D will warn you about needing to create a forest datablock. Click OK.
3. Apply a tree.
4. Save the scene.
5. Exit T3D
6. Copy the .forest file to the folder in your /levels directory with your mission
7. Open the Empty Scene.mis file in a text editor and grab the Forest datablock data (copy)
8. Open your custom scene misssion file in a text editor and paste the Forest datablock data
9. Update the path of the Forest datablock accordingly
10. Save your custom mission
11. Load T3D, go into the mission editor, apply objects with the Forest tool
Logan
#2
in Engine/Source/forest/forest.cpp...
Give that a shot for me, if you don't mind : )
06/29/2011 (4:14 pm)
Logan - Looking into the issue, the following fix solved it for me. Give it a try and let me know if it helps you out too.in Engine/Source/forest/forest.cpp...
void Forest::createNewFile()
{
// Release the current file if we have one.
mData = NULL;
// We need to construct a default file name
String missionName( Con::getVariable( "$Client::MissionFile" ) );
missionName.replace( "tools/levels", "levels" );
missionName = Platform::makeRelativePathName(missionName, Platform::getMainDotCsDir()); // <-- Line added.Give that a shot for me, if you don't mind : )
#3
10/08/2011 (12:33 pm)
Fixed in 1.2
Torque 3D Owner Christopher Tauscher
Default Studio