Frictional Games Forum (read-only)
entity callback Problem - 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: entity callback Problem (/thread-14865.html)



entity callback Problem - strassenbelag - 04-17-2012

Hi together i´m from germany so pls don´t worry about my bad english.
My problem is that in my custom story I wanna make a script with a callback that makes some pots explode if i open a cabinet (named Schrank_Vase) and some items appears on a desk.
I looked and all entities are right named, so that´s not the problem.


In addition to that I am really noob in hpl, so i also dunno if the Callbackfunc is the right one. Pls let me know if you see something Wink

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "Schrank_Vase", "Schrank_Func", false, 1);
}
void Schrank_Func(string &in asParent, string &in asEntity)
{
SetPropHealth("pot_explode1", 0);
SetPropHealth("pot_explode2", 0);
SetPropHealth("pot_explode3", 0);
SetEntityActive("Item1", true);
SetEntityActive("Item2", true);
SetEntityActive("Item3", true);
SetEntityActive("Item4", true);
SetEntityActive("Item5", true);
}



RE: entity callback Problem - ClayPigeon - 04-17-2012

Code:
void Schrank_Func(string &in asParent, string &in asChild, int alState)

That should work.


RE: entity callback Problem - strassenbelag - 04-17-2012

(04-17-2012, 02:17 PM)ClayPigeon Wrote:
Code:
void Schrank_Func(string &in asParent, string &in asChild, int alState)

That should work.
thanks for help, but it doesn´t work...


RE: entity callback Problem - ClayPigeon - 04-17-2012

Oh wait it shouldn't even be a collide callback.
It should be an interaction callback.

SetEntityPlayerInteractCallback("Schrank_Vase", "Schrank_Func", false);

void Schrank_Func(string &in asEntity)
{
SetPropHealth("pot_explode1", 0);
SetPropHealth("pot_explode2", 0);
SetPropHealth("pot_explode3", 0);
SetEntityActive("Item1", true);
SetEntityActive("Item2", true);
SetEntityActive("Item3", true);
SetEntityActive("Item4", true);
SetEntityActive("Item5", true);

}




RE: entity callback Problem - strassenbelag - 04-17-2012

Thank you veeeeeeeeeery much Big Grin