Andy Gilbert Posted December 17, 2012 Share Posted December 17, 2012 HI, in the "driver" example, when you run the game from within the editor, the script creates the car and places it ETC. This sort of defeats the object of the editor. So my question is, how can i place an object in the editor that has a lua script, then from the "game" script find that object and do stuff with it? I have read the lua guide, but it doesnt explain it in there, unless ive missed it. thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Andy Gilbert Posted December 17, 2012 Author Share Posted December 17, 2012 Done it: for entity in iterate(fw.main.world.entities) do if entity:GetKey("name")=="myModel_1" then myModel = entity end end Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
ParaToxic Posted December 17, 2012 Share Posted December 17, 2012 Why you don't use FindChild ?? You get the world of the Framework( index 0 ) and call FindChild, place your entityname and get the entity back Quote Link to comment Share on other sites More sharing options...
fumanshoo Posted December 17, 2012 Share Posted December 17, 2012 Could you possibly tell me where you found out how to do this? A source would be much appreciated. Quote Link to comment Share on other sites More sharing options...
Andy Gilbert Posted December 17, 2012 Author Share Posted December 17, 2012 If your referring to the method i posted then it was a combination of the Lua guide and trial And error. Otherwise I'm not sure bout paratoxic and although I'm sure it will work I haven't tried it. Thanks Andy 1 Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
ChrisMAN Posted December 17, 2012 Share Posted December 17, 2012 I might be due for another pass through the scripts folder. All of that stuff is there. The class script is probably the most important. The code reads really well. I have wondered how much of a perf boost could be gained on the lua side by doing proper prototypical inheritance instead of creating extra functions everywhere. 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.