Frictional Games Forum (read-only)

Full Version: Opening doors with wind
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone!

So, I was making my map and I wanted to make a scare (a door opening) what doesn't work is the force part. I don't know what the hell is wrong, I've tried a lot of things but nothing works. So, I hope someone finds the problem. Confused
Here's the script, I only post the problematic part (Note that this is going to be used for a serious CS)

Script:

void Open_door_wind_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_1", false, true);
SetSwingDoorDisableAutoClose("castle_1", true);
AddTimer("", 0.5, "Door_1_timer");
}

void Door_1_timer (string &in asTimer)
{
CreateParticleSystemAtEntity("", "ps_dust_whirl", "AreaOpenEffect", false);
PlaySoundAtEntity("AreaOpenEffect", "scare_wind.snt", "Player", 1, true);
AddPropForce("castle_1", 0, 0, -800, "world");
}

void Open_door_wind_2(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_2", false, true);
SetSwingDoorDisableAutoClose("castle_2", true);
AddTimer("", 0.5, "Door_2_timer");
}

void Door_2_timer (string &in asTimer)
{
CreateParticleSystemAtEntity("", "ps_dust_whirl", "AreaOpenEffect_1", false);
PlaySoundAtEntity("AreaOpenEffect_1", "scare_wind.snt", "Player", 1, true);
AddPropForce("castle_2", -2000, 0, 0, "world");
}

I'm worried about this (and there is no map_cache, if someone thought that was the problem) Sad
Try a force greater than 2000 (or -2000)
If it still doesn't work use an unlimited timer. Make it that when it reaches zero, use it again.
Incremental force is normally better than forcing the door open once. However, unlimited timers for this is absurd.
I usually open doors with impulse, rather than force

Something between 20 and 25 should do the trick, imo.
Well, I've forgot to say something: Before it worked with castle_1, but I rotated it so it was like: "Get in the room, there is something awaiting..." like an invitation. When I rotated it this way, the force stopped working. Of course, I inverted the value.
Castle_2 never worked, though. I will try Vic7im tip, maybe works.
I use:
AddPropImpulse("DOORNAME", 3, 0, 0, "World");
CreateParticleSystemAtEntity("", "ps_dust_paper_blow.ps", "AreaParticleSystem_1", false);
PlaySoundAtEntity("", "scare_wind.snt", "mansion_5", 0, false);


It works great!
I'm messing up with AddBodyForce (impulse didn't work). This one works. I will see if something wrong happens, then I will still be in this thread.
You are pushing the right way right?
Yes, of course. That's one of the most common issues scripters have. In fact, I already have the doors working, except castle_2. It just gets a glitch and doesn't open. It seems to be different to castle_1.
Pages: 1 2