Frictional Games Forum (read-only)

Full Version: Corridor scare and saw planks to open door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
(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
(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!