Cole Chapman Posted August 2, 2011 Share Posted August 2, 2011 I was wondering if there is a package system for BMAX that allows it to read .pak files like on Josh's blog and in examples people have given. If there is one for BMAX, can someone please post an example? Thank you Quote Link to comment Share on other sites More sharing options...
Cole Chapman Posted August 3, 2011 Author Share Posted August 3, 2011 Nvm, I got it Framework leadwerks.ENGINE Import "Framework.BMX" RegisterAbstractPath( "C:/Leadwerks Engine SDK" ) 'RegisterAbstractPath("zip::Package.pak") SetZipStreamPassword("PackagePass.pak", "12345") GCSetMode(2) AppTitle:String = "Game Client" Global FW:TFramework Local Mesh:TMesh Local Light:TLight Local Ground:TMesh Local Material:TMaterial Graphics(800,600) FW:TFramework = CreateFramework() If Not FW RuntimeError "Failed to create world." Global Terrain:TTerrain Local TerrainText:TTexture Global Move:Float Global Strafe:Float Global CamRotation:TVec3 = Vec3(0) Global mx:Float Global my:Float Global MouseXInt:Int Global MouseYInt:Int Terrain = CreateTerrain(2048) LoadTerrainHeightmap(Terrain, "zip::PackagePass.pak//Terrain.raw") TerrainText = LoadTexture("zip::PackagePass.pak//TerrainGrass.dds") SetTerrainTexture(Terrain, TerrainText, 0, 0) PositionEntity(FW.Main.Camera, Vec3(0.0, 280.0, 0.0)) Light:TLight = CreateDirectionalLight() PositionEntity(Light, Vec3(0.0, 350.0, 0.0)) RotateEntity(Light, Vec3(45,45,0)) CameraRange(FW.Main.Camera, 0.1, 750.0) 'DOF SetSkyBox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")) SetBackGroundColor(Vec4(1,1,1,1)) SetStats(1) Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit CameraUpdate() FW.Update() FW.Render() Flip(0) Forever GCCollect() End Function CameraUpdate() If KeyDown(KEY_SPACE) mx = MouseX() - GraphicsWidth()/2 my = MouseY() - GraphicsHeight()/2 MoveMouse(GraphicsWidth()/2, GraphicsHeight()/2) CamRotation.X = CamRotation.X + my CamRotation.Y = CamRotation.Y - mx RotateEntity(FW.Main.Camera, CamRotation) move = (KeyDown(KEY_W) - KeyDown(KEY_S)) * 10 strafe = (KeyDown(KEY_D) - KeyDown(KEY_A)) * 10 MoveEntity(fw.Main.camera, Vec3(strafe / 10.0, 0, move / 10.0)) EndIf EndFunction Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.