Jump to content

"Can't open scripts/classr" error


VeTaL
 Share

Recommended Posts

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"...

Working on LeaFAQ :)

Link to comment
Share on other sites

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?

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

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.

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

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...