Frictional Games Forum (read-only)
Scare Event Help - 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: Scare Event Help (/thread-13868.html)

Pages: 1 2


Scare Event Help - ArcherKiller - 03-09-2012

Hello guys. I'm new to this forum and new to scripting. Can anyone help me with my script?

So here is idea. When Player picks up the lantern an event occurs: the scratch sound is played on door and Player forced to look at this door for 2 seconds. Scared breath is activated on Player.

Here how I tried to script it. I now there is huge mistake, but could you explain my mistake and maybe tell me how it is should be done?


void DoorScratch1(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch_intense", "private_room", 0, false);
StartPlayerLookAt("private_room", -1, 1, "SetLanternActive");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
StopPlayerLookAt();
}



RE: Scare Event Help - Shives - 03-09-2012

I hope this works


void DoorScratch1(string &in asItem, string &in asEntity)

{

PlaySoundAtEntity("", "scare_scratch_intense", "private_room", 0, false);

PlaySoundAtEntity("", "react_breath", "Player", 0, false);
StartPlayerLookAt("private_room", 2, 4, "StopPlayerLookAt");

}




RE: Scare Event Help - Stepper321 - 03-09-2012

Quote:void DoorScratch1(string &in Entity) // I assume you have on Pickup Callback on the Lantans properties.
{
PlaySoundAtEntity("", "scare_scratch_intense", "private_room", 0, false);
StartPlayerLookAt("private_room", 20, 20, ""); //Adjust your own speed, -1 or 0 is not possible
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2");
}

void DoorStratch2(string &in asTimer)
{
StopPlayerLookAt();
}



RE: Scare Event Help - ArcherKiller - 03-09-2012

Thank you for the answers. So here is the thing. The sound of scratching doesn't stop. Here is script.


SetEntityPlayerInteractCallback("lantern_1", "DoorScratch1", true);
}

void DoorScratch1(string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch", "private_room", 0, false);
StartPlayerLookAt("private_room", 10, 10, "");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2");
}

void DoorScratch2(string &in asTimer)
{
StopPlayerLookAt();
}

Oh and if possible can you tell me how can I add a lantern lighted while player is looking and to add text. Sorry for making requests, but I learn better from examples.


RE: Scare Event Help - Datguy5 - 03-09-2012

What do you mean with add text?


RE: Scare Event Help - ArcherKiller - 03-09-2012

well when a message comes in on the screen


RE: Scare Event Help - Datguy5 - 03-10-2012

Heres a tutorial http://wiki.frictionalgames.com/hpl2/tutorials/scripting/messages_jenniferorange


RE: Scare Event Help - Asphex - 03-10-2012

SetEntityPlayerInteractCallback("lantern_1", "DoorScratch1", true);
}

void DoorScratch1(string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch", "private_room", 0, false);
StartPlayerLookAt("private_room", 10, 10, "");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2");
}

void DoorScratch2(string &in asTimer)
{
StopPlayerLookAt();
StopSound("scare_scratch", 0);
}


Try if that works. And about the text.. did you mean that you want the text to appear on pickup?


RE: Scare Event Help - ArcherKiller - 03-10-2012


void DoorScratch1(string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch", "private_room", 0, false);
SetMessage("Messages", "Popup2", 3);
StartPlayerLookAt("private_room", 10, 10, "");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2");
}

void DoorScratch2(string &in asTimer)
{
StopPlayerLookAt();
StopSound("scare_scratch", 0);
}


This still didn't help. The sound won't stop. Btw I found out that some sounds in level editor are combined sounds from sound folder. For example. In sound folder there are 4 types of animal squeal sounds, but in level editor there is only 1 and each time it plays a random one from those 4... is there a way around it?


RE: Scare Event Help - Nevicar - 03-10-2012

Don't you need .snt at the end of the sound file in the string, as well? Or can this be overlooked sometimes?

i.e: PlaySoundAtEntity("", "scare_scratch.snt", "private_room", 0, false);

and

PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);