Frictional Games Forum (read-only)

Full Version: Timer + Flying Jesus (easy problem)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,

I want to make a script that wenn you open a cabinet a flying jesus (like here http://wiki.frictionalgames.com/hpl2/tut...iferorange)
comes out. But the problem is i dunno how to use timers, because if i open it he shouldn´t fly throw the cabinet door, so the timer should have sth like 0.5 seconds. I know that i have to use
void AddTimer(string& asName, float afTime, string& asFunction);

but don´t know how. can someone pls explain? thx Big Grin


Void OnStart()
{
SetEntityPlayerInteractCallback("Cabinet_Jesus", "Cabinet_Jesus_Func", false);
}




void Cabinet_Jesus_Func(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus_2", true);
AddPropForce("Jesus_2", -30000, 0, 0, "World");
PlaySoundAtEntity("Scream_1", "scream_1.ogg", "Player", 0.0f, false);
}

Code:
void Cabinet_Jesus_Func(string &in asParent, string &in asChild, int alState)
{    
    AddTimer("", 2.0f, "Timer_01");
}

void Timer_01(string &in asTimer)
{
    SetEntityActive("Jesus_2", true);    
    AddPropForce("Jesus_2", -30000, 0, 0, "World");
    PlaySoundAtEntity("Scream_1", "scream_1.ogg", "Player", 0.0f, false);
}
I highly suggest you re-think this "scare" anyway.
yea delete this script...problem solved =)
You can make this scare if you arent gonna release this story =) If your gonna make to some of your friends and see them get scared then this is ok.But if you are gonna release this PLEASE DONT PUT FLYING JESUSES IN IT!!!
This is development support, he asked for some help with his script, why are you commenting negatively on his idea? It's his right to apply it wheter it's good or not.
(04-19-2012, 07:01 PM)ClayPigeon Wrote: [ -> ]This is development support, he asked for some help with his script, why are you commenting negatively on his idea? It's his right to apply it wheter it's good or not.
As much as I hate this "scare", I agree.

Don't shoot him down guys... If you don't like it, just don't play his campaign. That's my way of dealing with it.