andy_s Posted July 27, 2011 Share Posted July 27, 2011 I have a problem loading scenes. I get the error stating that LE.NET can't open scripts/class. I have the complete scripts folder from the sdk in my project. I use the latest LE.NET. Here is the c# code I use: namespace Loading_Scene_NET { class Loading_Scene_NET { private const int ScreenWidth = 1024; private const int ScreenHeight = 768; private const string MediaDir = "D:/Leadwerks_Projects/Loading_Scene_NET"; private const string AppTitle = "Loading_Scene_NET"; static void ErrOut( string message ) { Console.WriteLine( message ); } static void Main(string[] args) { try { // Initialize LE.Initialize(); LE.SetAppTitle(AppTitle); LE.RegisterAbstractPath(MediaDir); // Set graphics mode if( LE.Graphics(ScreenWidth,ScreenHeight) == 0 ) { ErrOut( "Failed to set graphics mode." ); return; } // Create framework object and set it to a global object so other scripts can access it TFramework fw = LE.CreateFramework(); if( !fw.IsValid ) { ErrOut( "Failed to initialize engine." ); return; } // Set Lua framework object LE.SetGlobalObject( "fw", fw.Handle ); // Set Lua framework variable IntPtr lua = LE.GetLuaState(); LE.lua_pushobject( lua, fw.Handle ); LE.lua_setglobal( lua, "fw" ); LE.lua_pop( lua, 1 ); LE.TFilter(1); LE.AFilter(4); // Get framework main camera TCamera camera = LE.GetLayerCamera( LE.GetFrameworkLayer(0) ); LE.PositionEntity( camera, new TVec3(0,0,-2) ); //Load the scene TEntity scene = LE.LoadScene("abstract::scene.sbx"); what am I doing wrong? Quote Link to comment Share on other sites More sharing options...
Roland Posted July 27, 2011 Share Posted July 27, 2011 I tested your code with LE.NET and the tunnels.sbx scene and it loaded and showed the scene. One thing is that you may need to copy the Scripts (and its sub folders) to your bin\release or bin\debug directory Another issue can be that your camera is placed or rotated so the scene isn't visible Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
ZioRed Posted July 27, 2011 Share Posted July 27, 2011 The error message box "can't open scripts/class" is raised usually when you haven't the "Scripts" LUA folder in your bin/Debug folder (or Release, accordingly to your compilation mode) as Roland mentioned. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
andy_s Posted July 28, 2011 Author Share Posted July 28, 2011 Thanks guys. I don't have it in the bin/debug or bin/release folder. Will try tonight, but I guess this is it. 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.