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 Triggers not resetting
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#1
Triggers not resetting

I KNOW there is a similar topic below, but I dont want to hijack his since he is still getting help.

Whats wrong with my script, that is making the areas not reactivate?

My Checkpoint

CheckPoint ("Check1", "BridgeDeathRespawn", "BridgeDeath", "DeathHints", "StayLow");

My Function:


void BridgeDeath(string &in asName, int alCount)
{
SetEntityActive("SprintDisable", true);
SetEntityActive("SprintEnable", true);
SetEntityActive("StandKill", true);
}


Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-08-2012, 09:00 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#2
RE: Triggers not resetting

Going to need more information. Can you post up the full script?
04-08-2012, 09:08 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#3
RE: Triggers not resetting

Sure thing!

void OnEnter ()
{
        AddEntityCollideCallback("Player", "Wakeupscript", "Wakeupscript", true, 1);
        AddEntityCollideCallback("Player", "Levelchange_1", "Levelchange", true, 1);
        AddEntityCollideCallback("Player", "NoScare", "NoScare", true, 1);
        AddEntityCollideCallback("Player", "SprintDisable", "NoSprint", true, 1);
        AddEntityCollideCallback("Player", "SprintEnable", "Sprint", true, 1);
        AddEntityCollideCallback("Player", "StandKill", "KillStand", true, 1);
}
void Wakeupscript(string &in asParent, string &in asChild, int alState)
{
        SetLanternDisabled(true);
        SetPlayerActive(false);
        SetPlayerCrouching(true);
        FadeOut(1.0f);
        PlayMusic("Map1Ambiance.ogg", true, 100, 1, 0, false);
        FadePlayerRollTo(50, 33, 33);
        AddTimer("", 10, "Rollback");
        SetPlayerSanity(10);
        SetPlayerMoveSpeedMul(0.5);
        SetPlayerLookSpeedMul(0.5);
}
void Rollback(string &in asTimer)
{
        SetPlayerActive(true);
        FadeIn(10.0f);
        FadePlayerRollTo(0, 33, 33);
        CheckPoint ("Check1", "BridgeDeathRespawn", "BridgeDeath", "DeathHints", "StayLow");
}
void Levelchange(string &in asParent, string &in asChild, int alState)
{
        FadeOut(1.0f);
        AddTimer("", 1.0f, "Change");
}
void Change(string &in asTimer)
{
        ChangeMap("map02.map", "PlayerStartArea_1", "", "");
}
void NoScare(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "03_no.snt", "Levelchange_1", 0, true);
        StartPlayerLookAt("Levelchange_1", 2, 2, "");
        AddTimer("", 5, "Away");
}
void Away(string &in asTimer)
{
        StopPlayerLookAt();
}
void NoSprint(string &in asParent, string &in asChild, int alState)
{
        SetPlayerRunSpeedMul(0);
}
void Sprint(string &in asParent, string &in asChild, int alState)
{
        SetPlayerRunSpeedMul(1);
        GiveSanityBoost();
}
void KillStand(string &in asParent, string &in asChild, int alState)
{
        SetPlayerHealth(0);
}
void BridgeDeath(string &in asName, int alCount)
{
        SetEntityActive("SprintDisable", true);
        SetEntityActive("SprintEnable", true);
        SetEntityActive("StandKill", true);
}
void OnLeave ()
{
}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-08-2012, 09:10 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#4
RE: Triggers not resetting

It appears you are deleting your callbacks on collision instead of de-activating the areas - so you will need to re-add them. Your checkpoint function should look as follows:

void BridgeDeath(string &in asName, int alCount)
{
        AddEntityCollideCallback("Player", "SprintDisable", "NoSprint", true, 1);
        AddEntityCollideCallback("Player", "SprintEnable", "Sprint", true, 1);
        AddEntityCollideCallback("Player", "StandKill", "KillStand", true, 1);
}

Also note that adding your callbacks in OnEnter will mean they are added every time the map is entered. OnStart is usually a better place for adding the initial callbacks.

Edit: Forum formatting Tongue
(This post was last modified: 04-08-2012, 09:17 PM by Apjjm.)
04-08-2012, 09:17 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#5
RE: Triggers not resetting

Opp, silly me. I knew areas dont get deleted, they just have to be recalled. DERRPPP. Sorry to waste your time. + rep.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-08-2012, 09:27 PM
Website Find




Users browsing this thread: 1 Guest(s)