Clackdor Posted January 10, 2012 Share Posted January 10, 2012 So, how do I go about utilizing objects with Lua scripts that I place inside the editor? I've figured out that I can access entities using FindChild(); This lets me position the entities and manipulate them in that manner. How would I associate them with a controller or access the animations written in the .lua file associated with the .gmf. Specifically, I am talking about zaphos' skeleton models. They are my favorite toy right now. It's the first truely complex model I've incorporated into my game. Until now, I have been using the editor to carve out a static scene and then adding all of my dynamic content via C++. This has the unfortunate drawback of making me re-write all of the code in C++ that was already written in Lua. Any other models I've imported, I've had to write code for anyway, so I did it in C++. Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted January 10, 2012 Share Posted January 10, 2012 BP lua = GetLuaState(); lua_pushobject(lua, fw); lua_setglobal(lua, "fw"); lua_pop(lua,1); and so if there is an object that you load in C++ that you want to access in LUA you need to set it as global SetGlobalObject(object); Now all your LUA code should work when you load the model in c++ or via LoadScene(). Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! 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.