Jump to content

Has Script Attached

Recommended Posts

Just wondering is there any way you can tell if an entity has a script attached in C++?



Share this post

Link to post

Not in the API, but there is a component member in the class. If that is NULL, there is no script.

Share this post

Link to post

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;


Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...