nesrak1 / HKWorldEdit2

WIP Hollow Knight Level Editor
MIT License
73 stars 25 forks source link

Stops working when clicking "Open a new scene" #5

Closed vodkaa-gal closed 4 years ago

vodkaa-gal commented 4 years ago

It stops at saving. Here is the error below: UnauthorizedAccessException: Access to the path "C:\Users\fang2\OneDrive\Documents\Unity\HKWorldEdit2-master\HKWorldEdit2-master\Assets\ExportedScenes\level6.unity.meta" is denied. System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:320) System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamWriter.cs:124) System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool,System.Text.Encoding) System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:626) System.IO.File.WriteAllText (System.String path, System.String contents) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:621) Assets.Bundler.Loader.CreateMetaFile (System.String guid, System.String path) (at Assets/Editor/Bundler/Loader.cs:164) Assets.Bundler.Loader.GenerateLevelFiles (AssetsTools.NET.Extra.AssetsManager am, AssetsTools.NET.Extra.AssetsFileInstance inst) (at Assets/Editor/Bundler/Loader.cs:105) Assets.Bundler.Loader.GenerateLevelFiles (System.String levelPath) (at Assets/Editor/Bundler/Loader.cs:26) SceneLoad.OpenScene (System.String path) (at Assets/Editor/SceneLoad.cs:40) SceneLoad.CreateScene () (at Assets/Editor/SceneLoad.cs:16) Splash.OnGUI () (at Assets/Editor/Splash.cs:42) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295) UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288) UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:107) UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:182)

nesrak1 commented 4 years ago

The first thing I would suggest is to put the project folder somewhere outside OneDrive to see if that's causing issues. Also make sure you've created the ExportedScenes and ExportedScenesData folders that git didn't include (going to fix this later)

vodkaa-gal commented 4 years ago

I tried putting it in the Downloads folder, and Program Files\Unity. None of those worked. HKWorldEdit 1 works though. I also created those folders.

nesrak1 commented 4 years ago

Does the file level6.unity.meta exist?

vodkaa-gal commented 4 years ago

Yes. When I load the scene again, it tells me that I can continue editing it, as it was opened. But when trying to load it, it is just pink with a lot of megaphone icons.

nesrak1 commented 4 years ago

So just to make sure, this is only after you saved once, the first time it loaded fine?

vodkaa-gal commented 4 years ago

No. It stopped working at saving (3/3), then gave the error in the bottom box, and nothing worked after that. Same error in Downloads. In program files\unity it said the project can't be there. When I closed Unity and opened the project again and opened the level I was editing (level6, kings pass.) It told me that I could resume the project and the pink thing appeared when I tried. (I am now running the project from downloads.)

nesrak1 commented 4 years ago

Try opening a new scene, not level6, from downloads. It may have corrupted the scene somehow and it's probably continuing to do that. Or just open level6 and choose "start again" or whatever it's called instead of "open existing"

vodkaa-gal commented 4 years ago

It worked when trying another level. I guess level6 doesn't play nicely. I think I found out why it turns pink though. It says all the textures aren't loading, which I forgot to look at. Thank you so much!