Rick Posted September 27, 2011 Share Posted September 27, 2011 Looks like the example start.lua file isn't using the fw variable? Since we can just use the fw variable when running scripts in the editor I would think start.lua should have that same setup for the example. Does anyone have the snippet of code to setup start.lua to be the same as when ran from editor? Not sure if anyone has ran into any other gotcha's when switching from editor to engine. Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 27, 2011 Share Posted September 27, 2011 are you talking about a standalone lua script like the spinning cube example that uses framework? 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...
Rick Posted September 27, 2011 Author Share Posted September 27, 2011 Yeah. Just to get an example of the setup that needs to be done in Lua so that it's setup the same as when ran from the editor which does this (and other maybe?) setup for you. Come to think of it shouldn't Engine.exe set the framework up? That would seem the best way I guess so that we could xfer our editor lua game script right over to run in Engine.exe without changes. When I just tried that it complained about fw. I don't even know if Engine.exe is going to not have this Lua issue I'm having but just wanted to try it before making my own exe because if I don't have to then great! Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 27, 2011 Share Posted September 27, 2011 the standalone script creates the graphics context whereas the in-game script is already using the one from the editor and the framework has already been created in the editor... and i personally do not want engine.exe to create these things for me as i do not always use framework... its just like using a c++ or bmax program where you have to create your own graphics context and framework... as for the standalone spinning cube example that uses framework: require("Scripts/constants/keycodes") RegisterAbstractPath("") Graphics(1024,768) fw=CreateFramework() fw.main.camera:SetPosition(Vec3(0,0,-2)) light=CreateSpotLight(10) light:SetRotation(Vec3(45,55,0)) light:SetPosition(Vec3(5,5,-5)) material=LoadMaterial("abstract::cobblestones.mat") mesh=CreateCube() mesh:Paint(material) ground=CreateCube() ground:SetScale(Vec3(10,1,10)) ground:SetPosition(Vec3(0,-2,0)) ground:Paint(material) light=CreateDirectionalLight() light:SetRotation(Vec3(45,45,45)) while AppTerminate()==0 do if KeyHit(KEY_ESCAPE)==1 then break end mesh:Turn(Vec3(AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5)) fw:Update() fw:Render() Flip(0) end 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...
Rick Posted September 27, 2011 Author Share Posted September 27, 2011 Thanks. I guess it would just be nice not have to change my game script at all from editor to engine. I could modify my editor one to check for fw and if not there make it I guess, but would be nice in my mind to not have to worry about that. At least it's easy Thanks again. 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.