wfowler1 / Unity3D-BSP-Importer

A lightweight plugin for importing BSP maps into Unity3D as meshes.
Other
112 stars 17 forks source link

NullReferenceException #19

Open HappyFaceSpider opened 2 years ago

HappyFaceSpider commented 2 years ago

So, I keep getting error:

NullReferenceException: Object reference not set to an instance of an object BSPImporter.BSPLoader.LoadBSP (LibBSP.BSP bsp) (at Library/PackageCache/com.wfowler1.unity3d-bsp-importer@b09e2603bf/Runtime/Util/BSPLoader.cs:190) BSPImporter.BSPLoader.LoadBSP () (at Library/PackageCache/com.wfowler1.unity3d-bsp-importer@b09e2603bf/Runtime/Util/BSPLoader.cs:166) UnityEngine.Debug:LogException(Exception) BSPImporter.BSPLoader:LoadBSP() (at Library/PackageCache/com.wfowler1.unity3d-bsp-importer@b09e2603bf/Runtime/Util/BSPLoader.cs:172) BSPImporterWindow:DrawImportButton() (at Library/PackageCache/com.wfowler1.unity3d-bsp-importer@b09e2603bf/Editor/BSPImporterWindow.cs:114) BSPImporterWindow:OnGUI() (at Library/PackageCache/com.wfowler1.unity3d-bsp-importer@b09e2603bf/Editor/BSPImporterWindow.cs:40) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /home/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189) I do not know C++, so I've tried to use the window from the menu-bar. I've tried looking into the code, but I struggle to understand what is null and why is it null, when I filled all the settings in the Import BSP window.

wfowler1 commented 2 years ago

It looks like on line 190 of BSPLoader, it's trying to access the Entities data but it's not finding it. This can happen if the BSP version is not supported. What game is this BSP from?

HappyFaceSpider commented 2 years ago

Ghost Master

Here, have one of the BSPs I've been trying. Ghost_boo_BSP.zip

Edit: Here's a screenshot of how this entity should look-like. Not sure if it's useful in any way to you. boo_bsp

wfowler1 commented 2 years ago

Hmm, I'm not sure what kind of engine this game was built on but it doesn't seem to be anything Quake based. That file doesn't look like anything I've worked with before. I don't know if this is the same kind of file at all.

HappyFaceSpider commented 2 years ago

Well, I guess you won't be able to help me then, which is a shame, but understandable if the simply file doesn't match your plugin. I thought BSP file is a BSP file, but I don't know a lot so clearly I was wrong. So thanks for spending your time to look into it!

Unfortunately I don't know any more details about the game engine, its bsp files and all, because I'm just a noob with too much curiosity. But in case you ever grew curious about it, folks from this post should be able to help. They developed the BSP-viewer program (I attached it here, if you want to have a look) I used to view the BSP files, and I swear I saw them post some images of exporting whole maps to Blender (somehow) a few years back. They also had some sort of Data Converter for other game files, so I guess they should know quite a bit about game engine. The post I linked has a link to their semi-active discord.

BSPView_v2_0.zip

Also check out Ghost Master game, it's really fun and probably my favourite game of my childhood. :D

Thanks for all your work!