Results 1 to 5 of 5

Thread: Mohaa's .bsp within Unity 3D

  1. #1

    Default Mohaa's .bsp within Unity 3D

    Mohaa's .bsp within Unity 3D

    Based on the prototype uQuake3 I'm trying to get the moh-bsp to work within Unity3D.
    Source: https://github.com/mikezila/uQuake3

    This is the error I get

    NullReferenceException: Object reference not set to an instance of an object
    SharpBSP.BSPHeader.ReadMagic () (at Assets/Scripts/uQuake/Types/BSPHeader.cs:91)
    SharpBSP.BSPHeader..ctor (System.IO.BinaryReader BSP) (at Assets/Scripts/uQuake/Types/BSPHeader.cs:31)
    SharpBSP.BSPMap.ReadHeader () (at Assets/Scripts/uQuake/Types/BSPMap.cs:82)

    So what I get from this is that it goes wrong from the part where it tries to read the 4 first binaries. In Quake 3 the first 4 are 49 42 53 50 (IBSP) while in mohaa it is 32 30 31 35 (2015). What I don't understand is where I change this. I tryed to trace back to the beginning and vice versa but I don't see it anywhere.

    Code:
    private void ReadMagic()
            {
                BSP.BaseStream.Seek(0, SeekOrigin.Begin);
                Magic = new string(BSP.ReadChars(4));
            }
    
    
    
            private void ReadVersion()
            {
                BSP.BaseStream.Seek(4, SeekOrigin.Begin);
                Version = BSP.ReadUInt32();
            }
    I've marked the 91 line which is where unity3D breaks. Any advice/clues on how I could get passed this phase?
    Last edited by Thorongil; February 20th, 2015 at 02:10 PM.

  2. #2
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,604

    Default

    oh , u gotta check out openMOHAA Source

    http://sourceforge.net/projects/openmohaa/

    code/bsbc/

  3. #3

    Default

    Hey thanks for the suggestion. I did have a look through it before. It has a total different structure so I can hardly compare the two projects to find the solution for my prob.

    I took from here( http://www.mralligator.com/q3/ ) the following data:

    header

    string[4] magic Magic number. Always "IBSP".
    int version Version number. 0x2e for the BSP files distributed with Quake 3.
    direntry[17] direntries Lump directory, seventeen entries.
    So as it says always IBSP for quake3 but where do I change that to 2015 (just to be sure 2015 is the developer name).
    https://github.com/mikezila/SharpBSP...s/BSPHeader.cs
    Last edited by Thorongil; February 20th, 2015 at 02:35 PM.

  4. #4
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    BSP object is probably NULL, or BaseStream (which I doubt)

  5. #5
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,604

    Default

    oh btw don't hesitate in post ur project here when ur done , these things really help the community

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •