VeTaL Posted September 3, 2010 Share Posted September 3, 2010 This error appears after last update of Leadwerks, but i'm not sure that its the main reason as i test it also on clean 2.4 version (that is without latest update) So, somewhere on this forum, i found Josh's post about sources of enabling LUA in C++. The code, posted by Josh is // ==================================================================== // This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard // Written by Rimfrost Software // http://www.rimfrost.com // ==================================================================== #include "engine.h" int main( int argn, char* argv[] ) { Initialize() ; RegisterAbstractPath("C:/Leadwerks Engine SDK"); SetAppTitle( "luatest" ) ; Graphics( 800, 600 ) ; AFilter() ; TFilter() ; TWorld world; TBuffer gbuffer; TCamera camera; TMesh mesh; TLight light; TMesh ground; TMaterial material; world = CreateWorld() ; if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); return Terminate(); } TFramework framework=CreateFramework(); TLayer layer = GetFrameworkLayer(0); camera=GetLayerCamera(layer); PositionEntity(camera,Vec3(0,0,-2)); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L,"fw"); lua_pop(L,1); LoadModel("abstract::environment_atmosphere.gmf"); material=LoadMaterial("abstract::cobblestones.mat"); mesh=CreateCube(); PaintEntity(mesh,material); ground=CreateCube(); ScaleEntity(ground,Vec3(10,1,10)); PositionEntity(ground,Vec3(0,-2,0)); PaintEntity(ground,material); light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { // Rotate cube TurnEntity( mesh, Vec3( 0.5f*AppSpeed() ) ) ; // Update timing and world UpdateFramework(); // Render RenderFramework(); // Send to screen Flip(0) ; } } // Done return Terminate() ; } I saved it into Templates folder so i'm able now to quickly create base for new game. But today i had error and looking like there are some troubles with LUA: i cant see environment_atmosphere Log: Leadwerks Engine 2.40 Initializing Renderer... OpenGL Version: 3.2.0 GLSL Version: 1.50 NVIDIA via Cg compiler Render device: GeForce 8600M GT/PCI/SSE2 Vendor: NVIDIA Corporation DrawBuffers2 supported: 1 32 texture units supported. GPU instancing supported: 1 Max batch size: 64 Shader model 4.0 supported: 1 Conditional render supported: 0 Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//query.vert", ""... Loading model "z:/leadwerks engine sdk/models/entities/environment/atmosphere/environment_atmosphere.gmf"... Loading mesh "z:/leadwerks engine sdk/models/entities/environment/atmosphere/environment_atmosphere.gmf"... Loading material "z:/leadwerks engine sdk/materials/effects/invisible.mat"... Loading script "z:/leadwerks engine sdk/models/entities/environment/atmosphere/environment_atmosphere.lua"... Lua error: [string "z:/leadwerks engine sdk/models/entities/env..."]:3: attempt to call global 'CreateClass' (a nil value) Loading material "z:/leadwerks engine sdk/templates/resources/cobblestones.mat"... Loading texture "z:/leadwerks engine sdk/templates/resources/cobblestones.dds"... Loading texture "z:/leadwerks engine sdk/templates/resources/cobblestonesdot3.dds"... Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//mesh/mesh_diffuse_bumpmap.vert", "zip::z:/leadwerks engine sdk/shaders.pak//mesh/mesh_diffuse_bumpmap_specular.frag"... Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//postfilters/postfilter.vert", "zip::z:/leadwerks engine sdk/shaders.pak//postfilters/clearcolor.frag"... Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//guide.vert", "zip::z:/leadwerks engine sdk/shaders.pak//editor/guide.frag"... Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//mesh/mesh_shadow.vert", ""... Loading texture "incbin::noise.dds"... Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//postfilters/postfilter.vert", "zip::z:/leadwerks engine sdk/shaders.pak//lighting/directionallight.frag"... Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//postfilters/postfilter.vert", "zip::z:/leadwerks engine sdk/shaders.pak//postfilters/postfilter.frag"... Loading shader "zip::z:/leadwerks engine sdk/shaders.pak//postfilters/postfilter.vert", "zip::z:/leadwerks engine sdk/shaders.pak//postfilters/depthblit.frag"... Loading texture "incbin::Arial9.dds"... Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted September 3, 2010 Share Posted September 3, 2010 This error appears after last update of Leadwerks, but i'm not sure that its the main reason as i test it also on clean 2.4 version (that is without latest update) I saved it into Templates folder so i'm able now to quickly create base for new game. But today i had error and looking like there are some troubles with LUA: i cant see environment_atmosphere Log: Lua error: [string "z:/leadwerks engine sdk/models/entities/env..."]:3: attempt to call global 'CreateClass' (a nil value) It looks like you are missing the Class.lua script. Did you copy the Scripts folder to your game's working directory? 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...
VeTaL Posted September 7, 2010 Author Share Posted September 7, 2010 macklebee, you're the best ) Maybe its a good idea to create FAQ from this simple questions? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2010 Share Posted September 7, 2010 Its just one those things to be aware of if you are using the LE lua scripts in your game. I believe its due to the fact that abstract paths do not work in the lua command 'require()'. This is one of the things first mentioned when LE2.3 first came out and there have been other posts asking this as well in the past. I do not know if it is or not, but I would think that Aggror probably mentioned this in the user's guide as well. 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...
gamecreator Posted September 8, 2010 Share Posted September 8, 2010 Thanks from me as well. Just came across this and was so glad the answer was here. Quote Link to comment Share on other sites More sharing options...
Scott Richmond Posted October 29, 2010 Share Posted October 29, 2010 Just wanted to pipe and say I just hit this problem as well. Thanks for the fix notes. Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
VeTaL Posted October 30, 2010 Author Share Posted October 30, 2010 I think again about FAQ creation. Maybe, when i would have some free time, i'll do that. Quote Working on LeaFAQ 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.