Jump to content

Recommended Posts

Posted

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

post-12224-0-04096400-1403084900_thumb.pngpost-12224-0-19373000-1403084915_thumb.png

 

 

Thanks in advance.

Posted
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?

Posted

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.

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.

×
×
  • Create New...