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
Script Help EntityCollideCallback not working
Obsolete Offline
Junior Member

Posts: 5
Threads: 3
Joined: Jul 2015
Reputation: 0
#1
EntityCollideCallback not working

Hi,

I was wondering if anyone could help me with a problem in my script file. I wanted to add a collidecallback between the player and a scriptarea that results in the players death. However, after all my hard work. Testing it didn't give promising results. When the player interacts with the scriptarea nothing happens! Can somebody help me out? here is my script:

/////SOME EXPLANATION: 

upon entering the area, the screen should fade out, the player shouldn't be in control anymore, and a timer is added which ultimately scripts for the dead of the player. But nothing happens. I've already checked the name of the scriptarea in the .map file, and that is correct.

There are a whole bunch of other things in this script file that I removed, like multiple collidecallbacks, teleportarea's, interactcallbacks etc. on the start of the map, they all work fine. But for now they are removed to not make this an endless post of scripttext.//////////

void OnStart()


AddEntityCollideCallback("Player", "AreaDrown", "DrownDeath", false, 1);
}



void Drowndeath(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
FadeOut(1);
AddTimer("Deathtimer", 1.5, "YourDeath");
}

void YourDeath(string &in asTimer)
{
SetDeathHint("DeadHints", "Drowned");
DisableDeathStartSound();
AddPlayerHealth(-200);

}
04-22-2020, 07:39 AM
Find
MatiCekuriel Offline
Member

Posts: 79
Threads: 11
Joined: Aug 2012
Reputation: 3
#2
RE: EntityCollideCallback not working

Quote:void Drowndeath(string &in asParent, string &in asChild, int alState)

You forgot the capital D to "Death" Wink
(This post was last modified: 04-22-2020, 04:13 PM by MatiCekuriel.)
04-22-2020, 04:12 PM
Find
Obsolete Offline
Junior Member

Posts: 5
Threads: 3
Joined: Jul 2015
Reputation: 0
#3
RE: EntityCollideCallback not working

So silly haha, thanks Smile
04-22-2020, 08:34 PM
Find




Users browsing this thread: 1 Guest(s)