tjheldna Posted May 16, 2014 Share Posted May 16, 2014 Just wondering is there any way you can tell if an entity has a script attached in C++? Cheers Quote Link to comment Share on other sites More sharing options...
Josh Posted May 17, 2014 Share 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. Link to comment Share on other sites More sharing options...
tjheldna Posted May 17, 2014 Author Share Posted May 17, 2014 Nice thanks! Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 17, 2014 Share Posted May 17, 2014 Gold info. http://leadwerks.wikidot.com/wiki:checking-if-script-is-attached Quote Link to comment Share on other sites More sharing options...
tjheldna Posted May 17, 2014 Author Share 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 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.