02-09-2014, 10:13 PM
Hello there,
I'm working on a custom story and had this cool idea for something which requires script.
It's basically like this:
the player interacts with the lever, the screen fades black and then the player teleports to another area.
I've found script from the Cellar Archives from TDD, which is exactly what I want:
But - I really do want the player to interact with the lever first, before the screen fades black. Help?
Can you give me an example?
I'm working on a custom story and had this cool idea for something which requires script.
It's basically like this:
the player interacts with the lever, the screen fades black and then the player teleports to another area.
I've found script from the Cellar Archives from TDD, which is exactly what I want:
Quote: FadeOut(0.3);
AddTimer("scare", 0.3f, "TimerPlayerReact");
AddTimer("breath", 2.0f, "TimerPlayerReact");
AddTimer("breathl", 4.0f, "TimerPlayerReact");
AddTimer("breathl", 6.0f, "TimerPlayerReact");
AddTimer("TeleportHowl", 0.5f, "TimerTeleportHowl");
AddTimer("TeleportDone", 3.5f, "TimerTelportDone");
PlaySoundAtEntity("stomp","scare_wall_stomp","Player", 0, false);
PlaySoundAtEntity("darkamb","07_amb_breath","Player", 5, true);
PlaySoundAtEntity("wateramb", "ambience_water_no3d.snt", "sound_idle_1", 5, true);
FadePlayerFOVMulTo(4.0f, 4.0f);
SetRadialBlurStartDist(0.1f);
FadeRadialBlurTo(1.0f, 5.0f);
StartEffectFlash(0.2, 0.1,0.3);
FadeGlobalSoundVolume(0, 0.3);
StopMusic(0.3f, 0);
StartScreenShake(0.1, 4.7, 0.05, 0.5);
FadePlayerFOVMulTo(0.5, 3);
}
void TimerPlayerReact(string &in asTimer)
{
if(asTimer == "scare"){
PlayGuiSound("react_scare", 1.0f);
}
else if(asTimer == "breath"){
PlayGuiSound("react_breath", 0.8f);
}
else if(asTimer == "breathl"){
PlayGuiSound("react_breath", 0.5f);
}
}
void TimerTeleportHowl(string &in asTimer)
{
PlaySoundAtEntity("howl","guardian_activated.snt","Player", 0, false);
SetPlayerActive(false);
SetFogActive(true);
}
void TimerTelportDone(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_3");
FadeGlobalSoundVolume(1,2);
SetPlayerActive(true);
FadePlayerFOVMulTo(1.0f, 0.5f);
FadeRadialBlurTo(0.0f, 1.0f);
FadeIn(1.3);
FadePlayerFOVMulTo(1, 1);
StartUpDarkSide();
}
But - I really do want the player to interact with the lever first, before the screen fades black. Help?
Can you give me an example?