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
Doing nothing on an IF & Resetting level on death?
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#6
RE: Doing nothing on an IF & Resetting level on death?

Mm.. I've done it like this:

AddEntityCollideCallback("Player", "MoveStatues", "CollideMoveStatues", false, 1);
The script is set to false as you said, and it doesn't repat now ^^

I also have this script within "OnStart":
SetLocalVarInt("EVENTDONE", 0);

However, it doesn't work if you die. It doesn't do anything if you run through the triggerbox again.

void CollideMoveStatues(string &in asParent, string &in asChild, int alState)
{
    if(GetLocalVarInt("EVENTDONE") == 0)
    {
        SetLocalVarInt("EVENTDONE", 1);
        AddPropImpulse("Statue_1", 2.0f, 5.0f, 2.0f, "World");
        CreateParticleSystemAtEntity("StatueBehead_1", "ps_dust_impact_vert.ps", "StatueDust_1", false);
        AddPropImpulse("Statue_2", -2.0f, 5.0f, -2.0f, "World");
        CreateParticleSystemAtEntity("StatueBehead_2", "ps_dust_impact_vert.ps", "StatueDust_2", false);
        GiveSanityDamage(3.0f, true);
        PlaySoundAtEntity("StatueScare", "react_breath", "Player", 0.5f, false);
    }
}

I have my code like that.

Creator of The Dark Treasure.
02-11-2011, 02:57 PM
Website Find


Messages In This Thread
RE: Doing nothing on an IF & Resetting level on death? - by Linus Ågren - 02-11-2011, 02:57 PM



Users browsing this thread: 1 Guest(s)