Frictional Games Forum (read-only)
[SCRIPT] Corridor scare and saw planks to open door - 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: [SCRIPT] Corridor scare and saw planks to open door (/thread-13831.html)



Corridor scare and saw planks to open door - Peldan - 03-07-2012

Hello guys!

I am currently working on my first custom story, and I have tried to add a function where you find a bone saw, use it on a couple of planks barricading a door to make them fall off and play a sound. I tried for like an hour. Didn't work. I have deleted the code, but I believe it was something like:

PHP Code:
void OnStart()
{
AddUseItemCallback("""bone_saw_1""planks_1""SawPlanks"true);
}

void SawPlanks(string &in asParentstring &in asChild)
{
SetEntityActive("planks_1"false);
PlaySoundAtEntity("","bla_bla_scare_sound","planks_1"0false);
SetSwingDoorLocked("mansion_1"falsetrue);    
RemoveItem("bone_saw_1");


Didn't use indentation in this example.
** I just wrote this code, there might by syntax errors. Also, the itemnames and soundnames aren't correct. I think it looked something like that. **

Also, I tried to make a corridor scare where you saw a statue (deformed man) standing in front of a window, and then the screen turns black, and he comes closer for every time. Couldn't figure it out. Tried for like 2 hours.

I used timers to set the first entity of the statue inactive, and at the same time the second entity active, for all 5 statues. When I came to the corridor, all of them were active, though. And the screen never really turned black, it just faded very dark, even if I set the FadeOut to like 5 seconds, and even 7. Any help, or advice?

Thanks in advance.


RE: Corridor scare and saw planks to open door - Obliviator27 - 03-07-2012

string &in asItem, string &in asEntity is the syntax you're looking for.
I also advise you set the planks to inactive, and set broken planks in it's place to active. Or SetPropHealth. Whichever.



RE: Corridor scare and saw planks to open door - Peldan - 03-07-2012

(03-07-2012, 08:29 PM)Obliviator27 Wrote: string &in asItem, string &in asEntity is the syntax you're looking for.
I also advise you set the planks to inactive, and set broken planks in it's place to active. Or SetPropHealth. Whichever.
Alright, will try that later! thanks brony Smile


RE: Corridor scare and saw planks to open door - Stepper321 - 03-08-2012

(03-07-2012, 09:30 PM)Peldan Wrote:
(03-07-2012, 08:29 PM)Obliviator27 Wrote: string &in asItem, string &in asEntity is the syntax you're looking for.
I also advise you set the planks to inactive, and set broken planks in it's place to active. Or SetPropHealth. Whichever.
Alright, will try that later! thanks brony Smile
I seriously laughed at: Thanks brony Big Grin!