Frictional Games Forum (read-only)

Full Version: Imported Assets Deleting Themselves on Opening .map file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So this has been an issue for about a month with one of my levels; I'd imported some stuff from A Machine For Pigs into what was a custom story at the time. Eventually I decided that I wanted to make my project a full conversion, made a copy of everything in a different file location, and started manually reassigning file paths for everything I had imported.

However, on removing the assets from the original custom stories folder, my map would crash on being opened with the level editor. Replacing the assets at the original location, I found out that the file paths for each would just revert to the custom stories location.

I eventually managed to get to a point where I can bring in and save maps with these assets, but if I reopen the map in the level editor they're deleted. This makes it difficult to tweak stuff I had, since I need to re-add everything I imported every time I open the map.

I've certainly learned my lesson: make it an FC from the beginning. But is there a way to un-screw my current map?

Summarized timeline:
-Made custom story
-Imported AMFP and custom assets
-Duplicated files for FC
-Attempt to reassign file paths for imported assets, file paths keep going back to first location
-Delete original files
-Assets delete themselves on opening map
-Notice some assets show up in FC, but only if added before quitting level editor

Other notes:
-Planes with imported textures and static objects generally showed up, but entities didn't
-If I switch to another map and back in the level editor without closing, entities are read just fine
-Same with exporting/re-importing selections: it only works if I don't close the editor
Where are your assets located? I would tell you not to duplicate them, but rather keep them in the original entities folder until you are ready to export your mod. The game will find the files as long as they are within the scope of the resources.cfg file of your mod, but the editors rely on the root resources.cfg file to find the files.

By keeping them in the original entities folder, you are able to use and edit them as you'd like. When exporting your mod, simply move those files into your own mod's entities folder and double check that it works.
Sometimes my files moves to %appdata%/??something??/virtualstore/programfiles
Not just amnesia. When I'm missing something, I look from there first.
I think it's some sort of cache thing.
Good luck with it! Smile
(05-13-2015, 07:18 AM)Mudbill Wrote: [ -> ]The game will find the files as long as they are within the scope of the resources.cfg file of your mod, but the editors rely on the root resources.cfg file to find the files.

Ah, is that why? That makes sense.

The idea was that I would create a copy of everything I needed in my mod's folder, reassign the file paths in the level editor to point there, then delete the first copy in custom_stories. As is, only one copy exists.

That sounds fairly inconvenient, though, to have to move them back and forth every time you want to edit the map/check the mod.
If you keep them in your main entities folder, you can still test them just fine as long as you didn't exclude that folder from your mod's resources (which would be unlikely as you would be unable to use any of the default assets).

Basically, keep them in your entities folder when you edit and test the mod. When you're done with the entire mod and want to send it to someone else or upload it, you package those entities into your mod's entities folder. The game will look for the file name, rather than the path, so it will most likely find it just fine.

The only issue can be that if your entity is named the same as a default one, it might confuse them, so be sure to list your directories before the main ones in your resources file.