mixpro Posted June 27, 2015 Share Posted June 27, 2015 Hi im new to leadwerks sorry if this might sound so easy . i have leadwerks 3.5 c++,lua , i opened a new project and tried to create an entity using lua code , i mean i have two .cpp files (main,app) and then i have a main.lua file , i tried writing the code in this http://www.leadwerks.com/werkspace/page/api-reference/_/emitter/emittercreate-r618 link in the main.lua file before the line : while window:KeyDown(Key.Escape)==false do but it didn't work . i tried adding an emitter in the editor and was successful , i want to know how can you add entities using code and see them when you press run game in the editor . Quote Link to comment Share on other sites More sharing options...
mixpro Posted June 28, 2015 Author Share Posted June 28, 2015 ok i figured it out , i need first to create a prefab of the entity (entity complex) , then use Prefab:Load() . Quote Link to comment Share on other sites More sharing options...
Lunarovich Posted June 28, 2015 Share Posted June 28, 2015 Leadwerks recently changed the way the application starts. The entry point of the game was App.lua. Now it's Main.lua. API doc does not yet reflect that change and continues to give examples using App.lua. That said, you can simply create an App.lua (named exactly that way) script in Scripts folder (should be exactly in that folder) and copy paste examples from API doc pages. They should work instantly. Namely, if LE finds App.lua, it treats it as an entry point for your game, for the backwards combatibility sake. Anyway, create App.lua file, copy paste example in it and you should be fine for now. You can tweak the examples in order to understand better how LE works. Hope that helps... Quote Link to comment Share on other sites More sharing options...
mixpro Posted July 1, 2015 Author Share Posted July 1, 2015 i tried adding App.Lua it runs the script but i get black screen . i dont get any errors , just a black screen . 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.