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
Is it possible to make monsters open doors?
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#5
RE: Is it possible to make monsters open doors?

(07-28-2013, 10:42 AM)The chaser Wrote: AddBodyForce("Door_body_1", 0, 0, 0, "world"); ///Without Body force, it

Just to add to this, if you use the coordinate setting "local" rather than "world" as the 5th parameter, then it uses the coordinates (x,y,z) of the door entity itself, rather than the whole world. That means that if you have 2 doors at a right angle to each other, you can apply force in the same direction and it will still open it, meaning you can use 1 generic function for any door

For example, I used this function in a test i was doing

void OnStart()
{
    SetEntityPlayerInteractCallback("castle_1", "OpenTheDoors", false);
    SetEntityPlayerInteractCallback("castle_arched01_1", "OpenTheDoors", false);
    SetEntityPlayerInteractCallback("prison_1", "OpenTheDoors", false);
    SetEntityPlayerInteractCallback("sewer_arched_1", "OpenTheDoors", false);
    SetEntityPlayerInteractCallback("metal_1", "OpenTheDoors", false);
}

void OpenTheDoors(string &in strEnt)
{
    SetSwingDoorDisableAutoClose(strEnt, true);
    if (GetSwingDoorClosed(strEnt)) SetSwingDoorClosed(strEnt, false, true);
    AddPropImpulse(strEnt, 0, 0, 4, "Local");
}

That meant I could call OpenTheDoors("name_of_any_door") or use SetEntityPlayerInteractCallback to swing open any door, keeping the function generic enough to work (with the exception of mansion doors, iirc)
Should be easy to transfer that idea to using an area collide callback

(This post was last modified: 07-29-2013, 07:45 PM by Adrianis.)
07-29-2013, 07:43 PM
Find


Messages In This Thread
RE: Is it possible to make monsters open doors? - by Adrianis - 07-29-2013, 07:43 PM



Users browsing this thread: 1 Guest(s)