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
Open a door with script
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#1
Open a door with script

Hey I have a kinda dumb question I gues.. but I wanted to know if it is possible to open a door with a script.
You close it with the setswingdoorclosed command but if you set it to false the door doesn't open, thats what i tried first.
So does anybody know how to open a door with script?

I mean not to unlock it but to make it swing open...

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
(This post was last modified: 01-09-2011, 03:25 PM by pawsUp1703.)
01-09-2011, 02:53 PM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#2
RE: Open a door with script

SetSwingDoorLocked("DoorName", false, true);
01-09-2011, 02:57 PM
Find
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#3
RE: Open a door with script

(01-09-2011, 02:57 PM)Tottel Wrote: SetSwingDoorLocked("DoorName", false, true);

Uuhm I mean to make the door open not just unlock it i mean i want it to swing open..

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
01-09-2011, 02:59 PM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#4
RE: Open a door with script

Oh, my bad.

I haven't actually used these before, but you can probably use one of these:

void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
01-09-2011, 03:12 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#5
RE: Open a door with script

Just use SetSwingDoorClosed Big Grin


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-09-2011, 03:15 PM
Find
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#6
RE: Open a door with script

(01-09-2011, 03:12 PM)Tottel Wrote: Oh, my bad.

I haven't actually used these before, but you can probably use one of these:

void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);

I#ll try these also they look a little bit complex...

(01-09-2011, 03:15 PM)Frontcannon Wrote: Just use SetSwingDoorClosed Big Grin

as I said i tried this but it didn't worked...

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
01-09-2011, 03:22 PM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#7
RE: Open a door with script

They allow you to put a force along a 3D vector (hence the 3 axes).
01-09-2011, 03:24 PM
Find
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#8
RE: Open a door with script

(01-09-2011, 03:24 PM)Tottel Wrote: They allow you to put a force along a 3D vector (hence the 3 axes).

The Script function site on wiki says that these commands shouldn't be used together with swingdoors as this would cause the game to crash.

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
01-09-2011, 03:26 PM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#9
RE: Open a door with script

No, it says do not use them on the joints. ^^

But as I said, I haven't used them before.
01-09-2011, 03:31 PM
Find
Andross Offline
Junior Member

Posts: 38
Threads: 1
Joined: Oct 2010
Reputation: 0
#10
RE: Open a door with script

AddPropForce("MyDoor", 100.0f, 0.0f, 0.0f, "World");
That's how I implemented it successfully at various locations (as well as the developers Smile).
The example assumes that your door swings open towards the x-axis. If I remember it correctly, 100.0 is not enough to open the door completely, so you might have to either call this multiple times by means of a timer or adjust the force value.
01-09-2011, 03:36 PM
Find




Users browsing this thread: 2 Guest(s)