Frictional Games Forum (read-only)
Timer + Flying Jesus (easy problem) - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Timer + Flying Jesus (easy problem) (/thread-14901.html)



Timer + Flying Jesus (easy problem) - strassenbelag - 04-18-2012

Hey guys,

I want to make a script that wenn you open a cabinet a flying jesus (like here http://wiki.frictionalgames.com/hpl2/tutorials/scripting/scaresbyjenniferorange)
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);
}




RE: Timer + Flying Jesus (easy problem) - ClayPigeon - 04-18-2012

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);
}



RE: Timer + Flying Jesus (easy problem) - JetlinerX - 04-19-2012

I highly suggest you re-think this "scare" anyway.



RE: Timer + Flying Jesus (easy problem) - Quotentote - 04-19-2012

yea delete this script...problem solved =)



RE: Timer + Flying Jesus (easy problem) - Datguy5 - 04-19-2012

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!!!


RE: Timer + Flying Jesus (easy problem) - ClayPigeon - 04-19-2012

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.


RE: Timer + Flying Jesus (easy problem) - Statyk - 04-19-2012

(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.