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
Timers... How do they work!?
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#1
Timers... How do they work!?

So, I have this:
void OnStart()
{
        AddEntityCollideCallback("Player", "attic_sound_scare1", "OnStart", true, 1);
        SetEntityPlayerInteractCallback("note_attic_desk", "OnPickup", true);
        AddEntityCollideCallback("Player", "mainatticscare", "OnPickup", true, 1);
}
void OnStart(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "amb_idle_whimp.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "insanity_baby_cry.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "door_level_cistern_close.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "general_thunder.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "break_stairs.snt", "attic_sound_scare1", 0.0f, true);
}
void OnPickup(string &in parent, string &in child, int state)
{
     if (parent == "Player" && child == "note_attic_desk")
     SetEntityActive("mainatticscare");
     {
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor1", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor1", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor2", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor2", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor3", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor3", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor4", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor4", false);
        PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
        GiveSanityDamage(20, true);
        AddPlayerBodyForce(-40000, 25000, 0, false);
        FadePlayerRollTo(75, 3, 2);
        StartPlayerLookAt("level_celler_1", 2, 2, "");
        SetPlayerCrouching(true);
        AddTimer("", 2, "Timer1");
        AddTimer("", 10, "Timer2");
        GivePlayerDamage(10, "BloodSplat", false, false);
        SetLanternDisabled(true);
        PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
        FadeRadialBlurTo(1, 0.5);
     }
}
void OnLeave ()
{
}
(That I am getting fatal errors on if someone would help on my other topic -_-)

But I have no idea how to work the two timers that I have in there, what goes in the places where I have "Timer1" and "Timer2"???

Thanks all!

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-17-2011, 08:59 PM
Website Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Timers... How do they work!?

You can put anything in them. As long as you use the same word for the void thingie.

Like with your Timer1 it would be

void Timer1(string &in asTimer)
{
//whatever you want to happen when he 2sec is gone goes between these
}

08-17-2011, 09:07 PM
Find




Users browsing this thread: 1 Guest(s)