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
#4
RE: Doing nothing on an IF & Resetting level on death?

Thanks! The first code worked x)
The second worked aswell, but I got a problem.
When changing the val to false on the collidecallback, each time I run into the collide box the event appears so you can run back and fourth into the box to make the event reappear. Any idea on how to fix it?

My code to make sure I did correct Tongue
    //Collide callbacks
    AddEntityCollideCallback("Player", "MoveStatues", "CollideMoveStatues", false, 1);
    AddEntityCollideCallback("Player", "ShutDoor", "CollideShutDoor", true, 1);
    AddEntityCollideCallback("Player", "SoundSteps", "CollideSoundSteps", true, 1);
    AddEntityCollideCallback("Player", "StrangeSound_1", "CollideStrangeSound_1", true, 1);
    AddEntityCollideCallback("Player", "StrangeSound_2", "CollideStrangeSound_2", true, 1);
    SetLocalVarInt("EVENTDONE", 0);
    }

and the other code:

//Throws the two statues heads off and creates dust at them
void CollideMoveStatues(string &in asParent, string &in asChild, int alState)
{
    if(GetLocalVarInt("EVENTDONE") == 0)
    {
        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);
    }
}

Creator of The Dark Treasure.
02-11-2011, 08:14 AM
Website Find


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



Users browsing this thread: 1 Guest(s)