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
switch and cases
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#5
RE: switch and cases

I've tryed to work forth and back with it for sometime, but i cant find a way to fix this.
This is what i have now

void OnStart()
{

AddEntityCollideCallback("Player", "EventArea", "RandomEvent", true, 1);

AddTimer("event",1 , "EventTimer");

if(GetLocalVarInt("Var1") == 6)
{
SetLocalVarInt("Var1", 0);
}
}


void RandomEvent(string &in asParent, string &in asChild, int alState)
{
switch(GetLocalVarInt("Var1"))
{
case 1:
StartScreenShake(0.06, 5, 1, 2);
PlaySoundAtEntity("laugh", "00_laugh.snt", "shield02_5", 0, false);
GiveSanityDamage(10, true);
break;
case 2:
StartScreenShake(0.06, 5, 1, 2);
PlaySoundAtEntity("laugh", "00_laugh.snt", "shield02_5", 0, false);
GiveSanityDamage(25, true);
break;
case 3:
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
FadeSepiaColorTo(0.3, 2);
FadeRadialBlurTo(0.3, 2);
StartScreenShake(0.1, 11, 0, 1);
GiveSanityDamage(50, true);
AddTimer("NoramlScreen", 10, "NormalScreen");
AddTimer("PlayerReact", 1.5, "PlayerReact");
break;
case 4:
PlaySoundAtEntity("", "insanity_monster_roar02.ogg", "Player", 0, false);
FadeSepiaColorTo(0.3, 2);
FadeRadialBlurTo(0.3, 2);
StartScreenShake(0.1, 6, 0, 1);
GiveSanityDamage(100, true);
AddTimer("NoramlScreen", 5, "NormalScreen");
AddTimer("PlayerReact", 1.5, "PlayerReact");
break;
case 5:
AddEffectVoice("CH02L17_Alexander_01.ogg", "", "", "CH02L17_Alexander_01.ogg", false, "", 0, 0);
break;
}
}

void PlayerReact(string &in asTimer)
{
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
}

void NormalScreen(string &in asTimer)
{
FadeRadialBlurTo(0, 2);
FadeIn(2);
}

void EventTimer(string &in asTimer)
{
AddLocalVarInt("Var1", 1);
AddTimer("event", 1, "EventTimer");
}

CURRENT PROJECT:
A Fathers Secret == Just started
09-07-2013, 03:31 PM
Find


Messages In This Thread
switch and cases - by Lizard - 09-07-2013, 10:09 AM
RE: switch and cases - by Apjjm - 09-07-2013, 02:42 PM
RE: switch and cases - by Lizard - 09-07-2013, 03:01 PM
RE: switch and cases - by Kreekakon - 09-07-2013, 03:14 PM
RE: switch and cases - by Lizard - 09-07-2013, 03:31 PM
RE: switch and cases - by Kreekakon - 09-07-2013, 03:36 PM
RE: switch and cases - by Lizard - 09-07-2013, 03:44 PM



Users browsing this thread: 1 Guest(s)