Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Opening doors with wind
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#1
Opening doors with wind

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-27-2012, 09:40 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Opening doors with wind

Try a force greater than 2000 (or -2000)
09-27-2012, 10:01 PM
Find
Akos115 Offline
Member

Posts: 101
Threads: 14
Joined: Aug 2012
Reputation: 0
#3
RE: Opening doors with wind

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

(This post was last modified: 09-27-2012, 10:11 PM by Akos115.)
09-27-2012, 10:11 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Opening doors with wind

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

Tutorials: From Noob to Pro
09-27-2012, 10:40 PM
Website Find
Vic7im Offline
Junior Member

Posts: 44
Threads: 9
Joined: Sep 2012
Reputation: 3
#5
RE: Opening doors with wind

I usually open doors with impulse, rather than force

Something between 20 and 25 should do the trick, imo.
09-28-2012, 12:43 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#6
RE: Opening doors with wind

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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-28-2012, 12:52 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Opening doors with wind

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!

Trying is the first step to success.
(This post was last modified: 09-28-2012, 01:22 PM by FlawlessHappiness.)
09-28-2012, 01:22 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#8
RE: Opening doors with wind

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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-28-2012, 01:52 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: Opening doors with wind

You are pushing the right way right?

Trying is the first step to success.
09-28-2012, 02:15 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#10
RE: Opening doors with wind

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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-28-2012, 02:20 PM
Find




Users browsing this thread: 2 Guest(s)