Frictional Games Forum (read-only)

Full Version: clickable entities
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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);
}
Thank you. Not noticed. Big Grin
Np Big Grin