Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
clickable entities
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#2
RE: clickable entities

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);
}
(This post was last modified: 02-12-2012, 09:25 PM by onv.)
02-12-2012, 09:20 PM
Find


Messages In This Thread
clickable entities - by FlaW - 02-12-2012, 09:17 PM
RE: clickable entities - by onv - 02-12-2012, 09:20 PM
RE: clickable entities - by FlaW - 02-12-2012, 09:23 PM
RE: clickable entities - by onv - 02-12-2012, 09:26 PM



Users browsing this thread: 2 Guest(s)