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: