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
FlaW Offline
Junior Member

Posts: 48
Threads: 9
Joined: Nov 2011
Reputation: 0
#1
clickable entities

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

02-12-2012, 09:17 PM
Find
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
FlaW Offline
Junior Member

Posts: 48
Threads: 9
Joined: Nov 2011
Reputation: 0
#3
RE: clickable entities

Thank you. Not noticed. Big Grin

(This post was last modified: 02-12-2012, 09:23 PM by FlaW.)
02-12-2012, 09:23 PM
Find
onv Offline
Member

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

Np Big Grin
(This post was last modified: 02-12-2012, 09:26 PM by onv.)
02-12-2012, 09:26 PM
Find




Users browsing this thread: 1 Guest(s)