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?
Nye Offline
Senior Member

Posts: 250
Threads: 8
Joined: Jan 2011
Reputation: 2
#7
RE: Doing nothing on an IF & Resetting level on death?

(02-11-2011, 02:57 PM)junkfood2121 Wrote: 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.


Somehow, you need to set the local variable EVENTDONE to 0 again. This is what I would do...

On the spawn point, make a tiny script area, to act as a trigger. Make it small, so that there is a very low chance the player will backtrack and step on it. Then, when the player spawns, he/she will trigger it and you can do this to set it back to 0:

SetLocalVarInt("EVENTDONE", 0);

There might be a better way, but the game was not built to accomodate this, so I don't think there is an "On Death" sort of procedure. Undecided

02-11-2011, 05:55 PM
Find


Messages In This Thread
RE: Doing nothing on an IF & Resetting level on death? - by Nye - 02-11-2011, 05:55 PM



Users browsing this thread: 1 Guest(s)