Irrlicht - .bsp Map öffnen

  • Ich hab erst neulich das TuT entdeckt ( https://autoit.de/index.php?page…p;pageNo=1& ) und wollte mich mal ran testen.

    Aber schon recht am Anfang hab ich schon schwierigkeiten undzwar beim versuch einer Map zu öffnen.

    Zum Testen nahm ich eine .bsp Datei aus meinem CounterStrike Ordner. Beim starten seh ich nur einen Weissen Bildschirm und nach beenden steht in der Console:

    Could not load .bsp file, unknown header.: C:/Users/.../mapname.bsp
    Could not load mesh, file format seems to be unsupported: mapname.bsp

    Hab auch versucht eine neue Map zu erstellen mit dem HammerEditor, der selbe Fehler.

    Beispiel aus einem Example (1:1)

    Spoiler anzeigen
    [autoit]


    ; ----------------------------------------------------------------------------
    ; Irrlicht Wrapper for Imperative Languages - Freebasic Examples
    ; Frank Dodd (2006)
    ; Converted/modified for the au3Irr2 project by linus
    ; ----------------------------------------------------------------------------
    ; Example 05: BSP Map
    ; This example loads a BSP map from a pk3 archive and creates a first person
    ; perspective camera so you can move around and view the map with the mouse and
    ; the arrow keys
    ; ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; ////////////////////////////////////////////////////////////////////////////
    ; Includes for extension libraries
    #include <au3Irrlicht2.au3>

    [/autoit] [autoit][/autoit] [autoit]

    opt("MustDeclareVars", True)
    HotKeySet("{ESC}", "_exit")

    [/autoit] [autoit][/autoit] [autoit]

    Func _exit()
    _IrrStop()
    Exit
    EndFunc ; _exit

    [/autoit] [autoit][/autoit] [autoit]

    ; ////////////////////////////////////////////////////////////////////////////
    ; global variables

    [/autoit] [autoit][/autoit] [autoit]

    ; irrlicht objects
    DIM $BSPMesh ; irr_mesh
    DIM $BSPNode ; irr_node
    DIM $Camera ; irr_camera
    DIM $CameraNode ; irr_node

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; ////////////////////////////////////////////////////////////////////////////

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; -----------------------------------------------------------------------------
    ; start the irrlicht interface
    _IrrStart( $IRR_EDT_OPENGL, 800, 600, $IRR_BITS_PER_PIXEL_32, _
    $IRR_WINDOWED, $IRR_NO_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_ON )

    [/autoit] [autoit][/autoit] [autoit]

    ; send the window caption
    _IrrSetWindowCaption( "Example 05: BSP Map" )

    [/autoit] [autoit][/autoit] [autoit]

    ; first we add the pk3 archive to our filing system. once we have done this
    ; we can open any of the files in the archive ; if they were in the current
    ; working directory
    _IrrAddZipFile( "map-20kdm2.pk3", $IRR_IGNORE_CASE, $IRR_IGNORE_PATHS )

    [/autoit] [autoit][/autoit] [autoit]

    ; load the BSP map from the archive ; a mesh object. any polygons in the mesh
    ; that do not have textures will be removed from the scene!
    $BSPMesh = _IrrGetMesh( "20kdm2.bsp" )

    [/autoit] [autoit][/autoit] [autoit]

    ; add the map to the scene ; a node. when adding the mesh this call uses a
    ; mechanism called an octtree that if very efficient at rendering large amounts
    ; of complext geometry most of which cant be seen, using this call for maps
    ; will greatly improve your framerates
    $BSPNode = _IrrAddMeshToSceneAsOcttree( $BSPMesh )

    [/autoit] [autoit][/autoit] [autoit]

    ; add a first person perspective camera into the scene that is controlled with
    ; the mouse and the cursor keys. if however you capture events when starting
    ; irrlicht this will become a normal camera that can only be moved by code
    $Camera = _IrrAddFPSCamera()

    [/autoit] [autoit][/autoit] [autoit]

    ; when we add a camera we are returned a camera object however we can perform
    ; node operations on many different object types that are entities within the
    ; scene however first we need to convert the camera type into a node type
    $CameraNode = $Camera

    [/autoit] [autoit][/autoit] [autoit]

    ; reposition and rotate the camera to look at a nice part of the map
    _IrrSetNodePosition( $CameraNode, 1750, 149, 1369 )
    _IrrSetNodeRotation( $CameraNode, 4, -461.63, 0 )

    [/autoit] [autoit][/autoit] [autoit]

    ; hide the mouse pointer
    _IrrHideMouse()

    [/autoit] [autoit][/autoit] [autoit]

    ; -----------------------------------------------------------------------------
    ; while the irrlicht environment is still running
    WHILE _IrrRunning()
    ; begin the scene, erasing the canvas with sky-blue before rendering
    _IrrBeginScene( 240, 255, 255 )

    [/autoit] [autoit][/autoit] [autoit]

    ; draw the scene
    _IrrDrawScene()

    [/autoit] [autoit][/autoit] [autoit]

    ; end drawing the scene and display it
    _IrrEndScene()
    WEND

    [/autoit] [autoit][/autoit] [autoit]

    ; -----------------------------------------------------------------------------
    ; Stop the irrlicht engine and release resources
    _IrrStop()

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Für meinen Teil änderte ich nur dies:

    ;_IrrAddZipFile( "map-20kdm2.pk3", $IRR_IGNORE_CASE, $IRR_IGNORE_PATHS ) //brauch ich nicht, da die Map nicht gepackt ist

    $BSPMesh = _IrrGetMesh( "mapname.bsp" )

    Rest gleich.

    Beim öffnen der .pk3 Datei mit WinRar sah ich, dass dort mehr als nur die .bsp Datei vorhanden ist. Warscheinlich liegt der Fehler daran.

    Nur bekomm ich mit dem HammerEditor nicht diese Dateien, bzw. weiß ich nicht wie.

    Vielleicht könnt ihr mir ja hierzu helfen.

    MfG

  • Die bsp Datein, die du mit deinem Hammer editor erstellt sind speziel für counter-strike, die kann die irrlicht engine nicht öffnen, wenn überhaupt nur ganz alte versionen. Der Fehler mit dem Mesh resultiert daraus, da er die map nicht laden kann, kann er auch kein mesh daraus erstellen.

  • Hmm...

    In dem TuT schrieb er ja, dass er zum erstellen der Maps "Hammer" empfielt..


    letsgo
    Ich schau mir mal "Blender" an und versuch es demnächst mal.

  • Ich denke nicht, dass dies ohne weiteres mit Blender geht...vieleicht solltest du dich bei Source mal erkundigen, ob es da nicht ein Konverter gibt...ich nehme an dass Source nicht will, das man CS-Maps in Irrlicht oder sonstwo darstellen kann...bei gelegenheit solltest du dich übrigends soweiso mal über das Copyright informieren ;)

    Bild1: Ich beim debuggen

  • Also .. damals war ich noch ein Fan vom Hammer,
    Doch wenn du ein Programm suchst mit dem du das alles machen kannst, dann empfiele ich BLENDER

    MFG Schnacko