Frictional Games Forum (read-only)
Need help with CheckPoint function - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Need help with CheckPoint function (/thread-5736.html)



Need help with CheckPoint function - LowFire3 - 12-15-2010

I set up a checkpoint on my map that is suppose to spawn me in another location if i die, and this works fine, however, i've been having some trouble figuring something out.

I've coded my checkpoint so that when you do die, it sets a deactivated script area to active, unfortunately, it doesn't work. Sad

Code:
void ChemicalBlueMonster(string &in asParent,string &in asChild, int alState)
{
    if(HasItem("chemical_blue") == true)
    {
        AddTimer("",1.0f,"ChemScareDelay");
        AddTimer("react_scare.snt",0.4f,"ChemScareFreak");
        SetEntityActive("ChemGrunt",true);
        RemoveEntityCollideCallback("Player","ChemicalBlueTrigger");
        CheckPoint("","DeathRestart2","GruntFailFunction","DeathHints","DeathRestartHint1");
    }
}
void ChemScareDelay(string &in asTimer)
{
    GiveSanityDamage(20.0f,true);
}
void ChemScareFreak(string &in asTimer)
{
    PlaySoundAtEntity("","react_scare.snt","Player",0,false);
}
void GruntFailFunction()
{
    SetEntityActive("GruntFailCollide",true);
}
//CODE FOR MONSTER AFTER DEATH FROM CHEM MONSTER//
void ChemGruntFail(string &in asParent,string &in asChild, int alState)
{
    SetEntityActive("GruntFail",true);
    SetEnemyIsHallucination("GruntFail",true);
    RemoveEntityCollideCallback("Player","GruntFailCollide");
}

EDIT: I guess my main question here is what to put in the asCallback part of the Checkpoint function. I know what a callback is, but I'm still not entirely sure what exactly i'm suppose to put there.

Btw, here is the function: CheckPoint(string& asName,string& asStartPos ,string& asCallback, string &asDeathHintCat, string &asDeathHintEntry);


I hope i explained my problem as clearly as possible. Any help would be appreciated.

Thanks. Big Grin


RE: Need help with CheckPoint function - Stangi - 12-15-2010

Looks to me like you forgot the callback syntax after
Quote:void GruntFailFunction()
{
SetEntityActive("GruntFailCollide",true);
}

It should be
Quote:void GruntFailFunction(string &in asName, int alCount)
{
SetEntityActive("GruntFailCollide",true);
}

Or at least I think so... Blush


RE: Need help with CheckPoint function - LowFire3 - 12-16-2010

(12-15-2010, 09:30 PM)Stangi Wrote: Looks to me like you forgot the callback syntax after
Quote:void GruntFailFunction()
{
SetEntityActive("GruntFailCollide",true);
}

It should be
Quote:void GruntFailFunction(string &in asName, int alCount)
{
SetEntityActive("GruntFailCollide",true);
}

Or at least I think so... Blush

That worked. Thanks a bunch. Smile