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
need help with a door
sassix Offline
Member

Posts: 56
Threads: 13
Joined: Jan 2011
Reputation: 0
#1
need help with a door

ye guys , im sry but mb i failed to search.

But i need a script or just a know how to make a door open a bit, i dont know how to explain with my tard english ;/. the player should go out and if hes near the door , the door should close fast.
01-13-2011, 03:10 AM
Find
Tottel Offline
Senior Member

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

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

Filled in example:

AddPropForce("MyDoor", 100.0f, 0.0f, 0.0f, "World");


You can use this to add a 'push' to your door. In the level editor, you can check what the X/Y/Z co-ordinates are, then just apply it.

Also note that 100 might not be enough. Try starting with 1000 or something to first see if it actually worked on the proper axis, then tone it down.
(This post was last modified: 01-13-2011, 10:33 AM by Tottel.)
01-13-2011, 10:32 AM
Find
sassix Offline
Member

Posts: 56
Threads: 13
Joined: Jan 2011
Reputation: 0
#3
RE: need help with a door

(01-13-2011, 10:32 AM)Tottel Wrote:
void  AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);

Filled in example:

AddPropForce("MyDoor", 100.0f, 0.0f, 0.0f, "World");


You can use this to add a 'push' to your door. In the level editor, you can check what the X/Y/Z co-ordinates are, then just apply it.

Also note that 100 might not be enough. Try starting with 1000 or something to first see if it actually worked on the proper axis, then tone it down.

Oh dude your awsome, didnt tryed it yet but im glad ur here in this forum ;D
god bless u man ^^

----------------

Edit: Well, i tryed everything but looks like it wont work or i did something wrong

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "doorslam", "doorslam", true, 1);
}

and


void doorslam(string &in entity, int alState)
{
AddPropForce("ausgang", -1000.0f, 0.0f, 0.0f, "World");
}

i tryed on every axes the number between 1000.0f and -1000.0f.

btw i missed the say i need to open it on the same way on start so the player shouldnt see how the door opens automatic, or is there a way to place the door in the editor with working closing function ? i tryed to turn it around a bit, but the position how its placed is the end position too. Hope u understand :/ im now trying something complicated may it works but i dont think so

----

God im with stupid -.- i had to watch the entity tab first on the door

"openamount" ftw Tongue

but thx for your help lol now i just need the
Quote:SetSwingDoorClosed("ausgang", true, true);
and its done Tongue
(This post was last modified: 01-13-2011, 05:51 PM by sassix.)
01-13-2011, 04:47 PM
Find




Users browsing this thread: 1 Guest(s)