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
Script Help Timers
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#6
RE: Timers

Quick question:

Judging by the sound effects you're using and the FOV change, are you trying to simulate the sanity damage effect used in game?

Anyways, this script should give you no errors at all:


void OnStart()
{
SetEntityPlayerInteractCallback("key_study_1", "OnPickup", true);
}

void OnPickup(string &in asEntity)
{
SetMessage("Messages", "noise", 4.0f);
AddTimer("FOV", 0, "ChangeFOV");
AddTimer("Normal1", 4, "ChangeFOV");
PlaySoundAtEntity("", "enemy_hallucination_disappear.snt", "Player", 0, false);
GiveSanityDamage(25.0f, false);
}

void ChangeFOV(string &in asTimer)
{
if(asTimer == "FOV")
{
FadePlayerFOVMulTo(0.5f, 2);
SetPlayerActive(false);
}
if(asTimer == "Normal1")
{
FadePlayerFOVMulTo(1, 2);
SetPlayerActive(true);
}
}

I rate it 3 memes.
(This post was last modified: 08-10-2012, 08:17 PM by Adny.)
08-10-2012, 08:14 PM
Find


Messages In This Thread
Timers - by TheIcyPickle - 08-10-2012, 07:27 AM
RE: Timers - by EXAWOLT - 08-10-2012, 08:24 AM
RE: Timers - by TheIcyPickle - 08-10-2012, 06:53 PM
RE: Timers - by Steve - 08-10-2012, 07:44 PM
RE: Timers - by TheIcyPickle - 08-10-2012, 08:04 PM
RE: Timers - by Adny - 08-10-2012, 08:14 PM
RE: Timers - by TheIcyPickle - 08-10-2012, 08:21 PM



Users browsing this thread: 1 Guest(s)