AggrorJorn Posted March 29, 2010 Share Posted March 29, 2010 I am trying Lua outside the editor at the moment. When I load a terrain (sbx) I only get the models placed in the terrain, but not the ground or the skybox. I am using just the Loadscene command. scene = LoadScene("abstract::camerapath.sbx") Quote Link to comment Share on other sites More sharing options...
macklebee Posted March 30, 2010 Share Posted March 30, 2010 perhaps you have another sbx file of the same name? Try hardcoding the path to the file... scene = LoadScene("Maps/camerapath.sbx") just know I can load my maps without any issues... what are you setting the abstract path to? require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/math/math") RegisterAbstractPath("") Graphics(800,600) fw=CreateFramework() scene=LoadScene("Maps/train.sbx") controller=CreateController(1.8,0.45,0.25,45,0.9) controller:SetCollisionType(COLLISION_CHARACTER,0) controller:SetMass(100) controller:SetPosition(Vec3(0,1,0)) camerapitch=fw.main.camera.rotation.x camerayaw=fw.main.camera.rotation.y HideMouse() MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) while KeyHit(KEY_ESCAPE)==0 do jump=KeyHit(KEY_SPACE)*6.0 if controller:IsAirborne()==1 then jump=0 end gx=Round(GraphicsWidth()/2) gy=Round(GraphicsHeight()/2) dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed()) dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed()) MoveMouse(gx,gy) camerapitch=camerapitch+dy camerayaw=camerayaw-dx camerapitch=math.min(camerapitch,90) camerapitch=math.max(camerapitch,-89.99) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) movespeed=4 movesmoothing=10 if controller:IsAirborne()==1 then movesmoothing=200 end move=Curve( (KeyDown(KEY_W)-KeyDown(KEY_S))*movespeed,move,movesmoothing) strafe=Curve( (KeyDown(KEY_D)-KeyDown(KEY_A))*movespeed,strafe,movesmoothing) controller:Update(camerayaw,move,strafe,jump,400,1) fw:Update() fw.main.camera:SetPositionf(controller.position.x,controller.position.y+1.8,controller.position.z,1) fw:Render() Flip(0) end controller:Free() ShowMouse() Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 30, 2010 Author Share Posted March 30, 2010 Thanks for the reply Macklebee. The path wasn't the problem since the scene gets loaded. I restarted my computer and afterwards the script worked as it should be. 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.