Frictional Games Forum (read-only)
clickable entities - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: clickable entities (/thread-13289.html)



clickable entities - FlaW - 02-12-2012

HI everyone . I have stypid question: how to create clickable entities ,i.e same script ,after clicking on it ,something happened.
Sorry for bad explanation, I don't know how to explain it differently. I hope you understand me


RE: clickable entities - onv - 02-12-2012

SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);



Calls a function when the player interacts with a certain entity.

Callback syntax: void MyFunc(string &in asEntity)




asName - internal name (of the entity you want to click on)

asCallback - function to call

abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity

void CALLBACKNAMEHERE(string &in asEntity)
{
Commands here
}


Let's say i want to active a monster when picking a key , my script would be like that :

void OnStart ();
{
SetEntityPlayerInteractCallback("key_study_1", "ActivateMonster", true);
}

void ActiveMonster(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
}


RE: clickable entities - FlaW - 02-12-2012

Thank you. Not noticed. Big Grin


RE: clickable entities - onv - 02-12-2012

Np Big Grin