Frictional Games Forum (read-only)
I need some Help. HARDCORE SCRIPT :P - 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: I need some Help. HARDCORE SCRIPT :P (/thread-9238.html)

Pages: 1 2


RE: I need some Help. HARDCORE SCRIPT :P - Tanshaydar - 07-19-2011

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

If you don't want player to teleport, just go to TimerTeleportHowl or TimerTelportDone function, which one has the TeleportPlayer function, end remove it. That's it.


RE: I need some Help. HARDCORE SCRIPT :P - xtron - 07-19-2011

oh ok

Add this instead then:
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "scriptname", "functionname", true, 1);
}

void functionname(string &in asParent, string &in asChild, int alState)
{
FadeOut(0);
AddTimer("", 1.5, "TimerName");
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0.5f, false);
SetPlayerCrouching(true);
}

void TimerName(string &in asTimer)
{
TeleportPlayer("StartPosName");
AddTimer("", 0.0f, "TimerName2");
FadeIn(1.0f);
}

void TimerName2(string &in asTimer)
{
FadeRadialBlurTo(15.0f, 0.5f);
StartScreenShake(0.3f, 0.5f, 0.5f, 0.5f);
AddTimer("", 1.6f, "TimerName3");
GiveSanityDamage(5.0f, true);
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0.5f, false);
PlaySoundAtEntity("", "water_lurker_hunt.snt", "Player", 0.5f, false);
}

void TimerName3(string &in asTimer)
{
StartScreenShake(0.0f, 0.0f, 0.0f, 0.0f);
FadeRadialBlurTo(0.0f, 0.5f);
SetPlayerCrouching(false);
}


EDIT: You can change the durration of the screen effects by changing the AddTimer("", 1.6f, "TimerName3"); To how many secs you want the screen effects to last.


RE: I need some Help. HARDCORE SCRIPT :P - Angerpull - 07-19-2011

(07-19-2011, 03:11 AM)xtron Wrote: oh ok

Add this instead then:
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "scriptname", "functionname", true, 1);
}

void functionname(string &in asParent, string &in asChild, int alState)
{
FadeOut(0);
AddTimer("", 1.5, "TimerName");
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0.5f, false);
SetPlayerCrouching(true);
}

void TimerName(string &in asTimer)
{
TeleportPlayer("StartPosName");
AddTimer("", 0.0f, "TimerName2");
FadeIn(1.0f);
}

void TimerName2(string &in asTimer)
{
FadeRadialBlurTo(15.0f, 0.5f);
StartScreenShake(0.3f, 0.5f, 0.5f, 0.5f);
AddTimer("", 1.6f, "TimerName3");
GiveSanityDamage(5.0f, true);
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0.5f, false);
PlaySoundAtEntity("", "water_lurker_hunt.snt", "Player", 0.5f, false);
}

void TimerName3(string &in asTimer)
{
StartScreenShake(0.0f, 0.0f, 0.0f, 0.0f);
FadeRadialBlurTo(0.0f, 0.5f);
SetPlayerCrouching(false);
}


EDIT: You can change the durration of the screen effects by changing the AddTimer("", 1.6f, "TimerName3"); To how many secs you want the screen effects to last.

Thank you! But it's still not the way I want it... It does the effects and all but not the beginning. like the BOOM and then shit hits the fan, it just Instantly turns black without any BOOM sound.

Any fix?



RE: I need some Help. HARDCORE SCRIPT :P - Kyle - 07-19-2011

To let everyone know how useful timers in one function is, for the one's who don't know, that it'll save you a lot of time and length. http://wiki.frictionalgames.com/hpl2/tutorials/script/advancedtimers


RE: I need some Help. HARDCORE SCRIPT :P - Kurton - 07-19-2011

You could certainly peruse your sounds folder for a suitable BOOM sound, then add another PlaySoundAtEntity for it.


RE: I need some Help. HARDCORE SCRIPT :P - xtron - 07-19-2011

yea just add another
Code:
PlaySoundAtEntity("", "sound_file.snt", "Player", 0.5f, false);

and replace sound_file.snt with a BOOM sound.


btw: add it under "functionname"