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
Confused with void Func_Name
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#3
RE: Confused with void Func_Name

What goes in the condition for the function (i.e. the bit that goes in '()' after the function name) changes for which function CALLED that function in the first place.

To explain, you used the AddTimer function, which adds a function 'callback'. The specific conditions for the callback function when created by the AddTimer function are (string &in asTimer)

void AddTimer(string& asName, float afTime, string& asFunction);

Creates a timer which calls a function when it expires.
Callback syntax: void MyFunc(string &in asTimer)

asName - the name of the timer
afTime - time in seconds
asFunction - the function to call

The part you need to look at is the 'Callback syntax'. Now look at the function you used earlier,

SetEntityPlayerInteractCallback("key_2", "spawn_func", true);

void spawn_func(string &in item)

The correct 'Callback sytax' for this function is (string &in asEntity)

void 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
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity

All this I've taken from the Engine Scripts page on the wiki,
http://wiki.frictionalgames.com/hpl2/amn..._functions

Hope this helps mate
(This post was last modified: 03-10-2012, 02:54 AM by Adrianis.)
03-10-2012, 02:52 AM
Find


Messages In This Thread
Confused with void Func_Name - by DaAinGame - 03-10-2012, 02:32 AM
RE: Confused with void Func_Name - by Adrianis - 03-10-2012, 02:52 AM
RE: Confused with void Func_Name - by DaAinGame - 03-10-2012, 03:06 AM
RE: Confused with void Func_Name - by Adrianis - 03-11-2012, 04:33 AM
RE: Confused with void Func_Name - by DaAinGame - 03-11-2012, 08:00 PM



Users browsing this thread: 1 Guest(s)