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
entity callback Problem
strassenbelag Offline
Junior Member

Posts: 4
Threads: 2
Joined: Apr 2012
Reputation: 0
#1
entity callback Problem

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

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);
}
(This post was last modified: 04-17-2012, 06:38 PM by strassenbelag.)
04-17-2012, 01:57 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#2
RE: entity callback Problem

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

That should work.
(This post was last modified: 04-17-2012, 02:18 PM by ClayPigeon.)
04-17-2012, 02:17 PM
Find
strassenbelag Offline
Junior Member

Posts: 4
Threads: 2
Joined: Apr 2012
Reputation: 0
#3
RE: entity callback Problem

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

That should work.
thanks for help, but it doesn´t work...
04-17-2012, 02:41 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#4
RE: entity callback Problem

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);

}

(This post was last modified: 04-17-2012, 02:55 PM by ClayPigeon.)
04-17-2012, 02:55 PM
Find
strassenbelag Offline
Junior Member

Posts: 4
Threads: 2
Joined: Apr 2012
Reputation: 0
#5
RE: entity callback Problem

Thank you veeeeeeeeeery much Big Grin
04-17-2012, 06:36 PM
Find




Users browsing this thread: 2 Guest(s)