Generic Entity Posted June 18, 2014 Share Posted June 18, 2014 Hello, I am very new to both Leadwerks game engine and Lua scripting. If this is an issue that has already been solved, sorry for making another thread but I could not find an answer with Google's search engine or by searching these forums briefly. I have been trying to get the 'Hello World' script to run, but it runs the map instead (In this case, a black screen because the map is empty). So, does anyone know how to get individual scripts to run in order to learn Lua with the integrated Script Editor? Here are some screenshots to hopefully make your lives easier: Script to run with output from previous run Thanks in advance. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 18, 2014 Share Posted June 18, 2014 The app.lua is allways the first lua file being run by leadwerks. if you replace your start function in app.lua it will work. Quote Link to comment Share on other sites More sharing options...
Generic Entity Posted June 18, 2014 Author Share Posted June 18, 2014 The app.lua is allways the first lua file being run by leadwerks. if you replace your start function in app.lua it will work. Ah, I see. Thank you, it works now. Is there any way to get it to run a script other than App.lua first? Or does the integrated Script Editor assume that you are trying to run a game on each run and thus treats App.lua as the main function/method? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 19, 2014 Share Posted June 19, 2014 app.lua is always executed first and thus harcoded. What you can do is call your own script from app.lua. Other than that, you can paste the body of your code in to an object script which you attach to a pivot in your scene. 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.