The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
EntityCollideCallback not working - by Obsolete - 04-22-2020, 07:39 AM



Users browsing this thread: 1 Guest(s)