CptAsgard / CoD2Unity

Load Call of Duty 2 maps in Unity!
Creative Commons Zero v1.0 Universal
29 stars 7 forks source link

issues getting this to work in unity #5

Closed darranis closed 1 year ago

darranis commented 1 year ago

already have moved around my directories to make the code work but no im being met with ArgumentNullException: Value cannot be null. Parameter name: source UnityEngine.Material..ctor (UnityEngine.Material source) (at <7d87237cea3743d093e22c5b98f74fba>:0) Potion.MaterialCreator.StartReading () (at H:/New folder/CoD2Unity-maste2r/CoD2Unity-master/Assets/Scripts/IWILoader.cs:202) Potion.MaterialCreator.CreateMaterial (System.String materialName) (at H:/New folder/CoD2Unity-maste2r/CoD2Unity-master/Assets/Scripts/IWILoader.cs:185) Potion.D3DBSP.CreateMeshMagic () (at H:/New folder/CoD2Unity-maste2r/CoD2Unity-master/Assets/Scripts/D3DBSP.cs:347) Potion.D3DBSP.FillLumpList () (at H:/New folder/CoD2Unity-maste2r/CoD2Unity-master/Assets/Scripts/D3DBSP.cs:214) Potion.D3DBSP.StartReading () (at H:/New folder/CoD2Unity-maste2r/CoD2Unity-master/Assets/Scripts/D3DBSP.cs:173) Potion.D3DBSP.Load () (at H:/New folder/CoD2Unity-maste2r/CoD2Unity-master/Assets/Scripts/D3DBSP.cs:157) Potion.D3DBSP.Start () (at H:/New folder/CoD2Unity-maste2r/CoD2Unity-master/Assets/Scripts/D3DBSP.cs:104)

im unsure how to load anything in with the script can i please get some help with this issue, thank you

id like to request the prerequisites and possibly a walkthrough on how to use the tool in unity

darranis commented 1 year ago

@CptAsgard you still around friend

CptAsgard commented 1 year ago

From the error you posted it looks like it's expecting a material called "main" in your Resources folder to use.

Material ret = new Material( Resources.Load<Material>("main") );

Unfortunately I won't be making a walkthrough because the project is very incomplete and I just wanted to share the code for others to use. If you want to work with this code you'll need to play around with it and try to figure it out yourself. Thankfully it's not a lot of code.