Frictional Games Forum (read-only)
Call a function when pick up an item - 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: Call a function when pick up an item (/thread-14944.html)



Call a function when pick up an item - RenanFOX2 - 04-20-2012

Hey guys, I'm having a big trouble to call a function when the player pick up an item. I tried to use SetEntityPlayerInteractCallback but it didn't worked.


RE: Call a function when pick up an item - SilentStriker - 04-20-2012

Wrong thread for help, it's supposed to be in Development support Smile

You can call the function with the item in the level editor



RE: Call a function when pick up an item - RenanFOX2 - 04-20-2012

(04-20-2012, 03:05 PM)SilentStriker Wrote: Wrong thread for help, it's supposed to be in Development support Smile

You can call the function with the item in the level editor
Please come one. Sorry for postin in the wrong thread for help, but I'm stunk here for two days.

How to call a function using this way?


RE: Call a function when pick up an item - SilentStriker - 04-20-2012

When creating an item in the level editor, select it and press the entity tab on the right, then in Callback func write the name of your function then in the .hps you write like this

void OnStart()
{

}

void NAMEOFFUNCTION(string &in asEntity, string &in asType)
{
//Stuff you want to happen
}



RE: Call a function when pick up an item - RenanFOX2 - 04-20-2012

(04-20-2012, 03:20 PM)SilentStriker Wrote: When creating an item in the level editor, select it and press the entity tab on the right, then in Callback func write the name of your function then in the .hps you write like this

void OnStart()
{

}

void NAMEOFFUNCTION(string &in asEntity, string &in asType)
{
//Stuff you want to happen
}
Thanks a lot!!!
It's working now XD


RE: Call a function when pick up an item - SilentStriker - 04-20-2012

You're welcome Smile