Frictional Games Forum (read-only)
question about collides loops? - 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: question about collides loops? (/thread-41054.html)



question about collides loops? - sabrinagsoledad - 03-01-2016

Hi

Is it possible to make a collide function works every time the player enters to that script area?... e.g. the chekpoint where you enter it teleport to a position, but what I want to know how should I change the code to make it every time the player enteres the area he is teleport and not only the first time?


RE: question about collides loops? - Spelos - 03-01-2016

Quote:AddEntityCollideCallback("Player", "Area", "CollisionFunc", false, 1);

The false means the callback will NOT be deleted when Player touches the area.

PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""Area""CollisionFunc"false1);
}

void CollisionFunc(string &in asParentstring &in asChildint alState
{
    
TeleportPlayer("PositionName");




RE: question about collides loops? - sabrinagsoledad - 03-02-2016

Thanks!!!


RE: question about collides loops? - sabrinagsoledad - 03-02-2016

One thing... I read a guide in the wiki about Checkpoints using ScriptArea's, and the code i made from that guide is the next...

OnStart()
{
AddEntityCollideCallback("Player", "AreaOfDeep", "Drowned", false, 1);
}

void Drowned(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "impact_water_high3.snt", "Player", 0, false);
CheckPoint("Checkpoint1", "PlayerStartArea_1","", "DeathCategory", "Deathtext");
}

Yet now nothing hapens... I read on that guide that for the chekpoint is not necesary kill the player if I dont want the the sound and screen effects when the player dies.

On the lang file I have this

<CATEGORY Name="DeathCategory">
<Entry Name="Deathtext"> Avoid water </Entry>
</CATEGORY>

But now in the game nothing hapens neither once get teleport...


RE: question about collides loops? - Spelos - 03-02-2016

I am going to make a video on this topic soon.

But the thing with CheckPoints is that you set it as soon as possible and by this command, you're actually saying:
IF player dies FROM THIS POINT, they will see THIS DEATH SCREEN, and APPEAR ON THIS POSITION, as well as (and this is optional) CALL THIS FUNCTION WHEN THEY APPEAR.

It has nothing to do with killing the player.
I already told you (I think) that if you want to kill the player, use
PHP Code:
SetPlayerHealth(0.0f); 
AFTER the CheckPoint command.