Frictional Games Forum (read-only)
[SCRIPT] Opening doors with wind - 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] Opening doors with wind (/thread-18532.html)

Pages: 1 2


Opening doors with wind - The chaser - 09-27-2012

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


RE: Opening doors with wind - Statyk - 09-27-2012

Try a force greater than 2000 (or -2000)


RE: Opening doors with wind - Akos115 - 09-27-2012

If it still doesn't work use an unlimited timer. Make it that when it reaches zero, use it again.


RE: Opening doors with wind - Your Computer - 09-27-2012

Incremental force is normally better than forcing the door open once. However, unlimited timers for this is absurd.


RE: Opening doors with wind - Vic7im - 09-28-2012

I usually open doors with impulse, rather than force

Something between 20 and 25 should do the trick, imo.


RE: Opening doors with wind - The chaser - 09-28-2012

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.


RE: Opening doors with wind - FlawlessHappiness - 09-28-2012

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!


RE: Opening doors with wind - The chaser - 09-28-2012

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.


RE: Opening doors with wind - FlawlessHappiness - 09-28-2012

You are pushing the right way right?


RE: Opening doors with wind - The chaser - 09-28-2012

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.