Frictional Games Forum (read-only)

Full Version: Death areas / out of bounds
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone, in my level ive got a massive stream. (which you currently just fall through forever)

is it possible to have areas which will kills you.

the only example is from the main game is when you die from falling off an edge.

thanks
Yes, it is possible.
Create a script area and call it WhateverYouLike.

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "WhateverYouLike", "KillThePlayer", false, 1);
}

void KillThePlayer(string &in asParent, string &in asChild, int alState)
{
/**
* Type can be: BloodSplat, Claws or Slash.
* void  GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);
*/

GivePlayerDamage(1000, "BloodSplat", true, true);
}

//player dies, number has to be 100+ to kill the player when he wasn't damaged yet
//1000 = Amount of Damage, "BloodSplat" = Animation played on the screen when getting damage
//first true = make the player spin when he gets damaged
//second true = makes it lethal damage so you actually die from it

[edit]
The developers actually used
AddPlayerHealth(-200);

Up to you how you want to do it. Big Grin