tjheldna Posted May 16, 2014 Posted May 16, 2014 Just wondering is there any way you can tell if an entity has a script attached in C++? Cheers Quote
Josh Posted May 17, 2014 Posted May 17, 2014 Not in the API, but there is a component member in the class. If that is NULL, there is no script. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
AggrorJorn Posted May 17, 2014 Posted May 17, 2014 Gold info. http://leadwerks.wikidot.com/wiki:checking-if-script-is-attached Quote
tjheldna Posted May 17, 2014 Author Posted May 17, 2014 The member is there, however if I do a check for it, the if statement is entered regardless if a script is attached or not. Maybe it has something to do with where I'm doing it in the LoadWorldHook. if (entity->script != NULL) { std::cout << entity->GetKeyValue("name", ""); Door *object = new Door(); object->entity = entity; } Quote
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.