I was wondering what type of script would be used to only activate a features when entering an area in a certain direction. An example would be in the custom story "The Attic" the scene where you get knocked down the stairs. Going up the stairs there are no effects, however when going back down you get pushed and thrown all the way down. After looking at the scrip the author has made I have concluded that this was the script he used.
void Scare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("levelchangefade", true);
SetSwingDoorLocked("mansion_8", false, true);
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor1", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor1", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor2", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor2", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor3", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor3", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor4", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor4", false);
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
GiveSanityDamage(20, true);
AddPlayerBodyForce(-40000, 25000, 0, false);
FadePlayerRollTo(75, 3, 2);
StartPlayerLookAt("mansion_8", 2, 2, "");
SetPlayerCrouching(true);
AddTimer("", 2, "Timer1");
AddTimer("", 10, "Timer2");
GivePlayerDamage(10, "BloodSplat", false, false);
PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
FadeRadialBlurTo(1, 0.5);
}
//--------------------------------------------------------------------------------//
void Timer1(string &in asTimer)
{
StartPlayerLookAt("mansion_8", 0.4, 0.4, "");
FadePlayerRollTo(-75, 3, 2);
AddTimer("", 2, "Timer3");
PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
}
//--------------------------------------------------------------------------------//
void Timer3(string &in asTimer)
{
PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
StartPlayerLookAt("mansion_8", 0.4, 0.4, "");
FadePlayerRollTo(0, 0, 0);
AddTimer("", 2, "Timer5");
FadeRadialBlurTo(0, 1);
}
//--------------------------------------------------------------------------------//
void Timer5(string &in asTimer)
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
//--------------------------------------------------------------------------------//
void Timer2(string &in asTimer)
{
SetPlayerCrouching(false);
StopPlayerLookAt();
}
I can't really explain it but if you watch this video and skip to 10:33 and watch until 12:50, you should get an understanding of what I mean