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
Doors not opening when the propforce function is used
ZRPT Offline
Junior Member

Posts: 17
Threads: 3
Joined: Aug 2011
Reputation: 1
#1
Doors not opening when the propforce function is used

I have this area which when a player looks at it, it forces a door to burst open. Here is the coding I have:

Added in onstart:
SetEntityPlayerLookAtCallback("wind", "windopen", true);

Another function I have set to activate the area:
void OnPickup(string &in asEntity, string &in type)
{
if(type == "OnPickup")
  {
   SetEntityActive("doorunlock", true);
   SetEntityActive("wind", true);
  }
}

and last but not least, the actual door function:
void windopen(string &in asEntity, int alState)
{
        
       SetSwingDoorDisableAutoClose("earthquakedoor", true);
       SetSwingDoorClosed("earthquakedoor", false, true);
       AddPropForce("earthquakedoor", -900, -900, -900, "world");

}



Any help would be much appreciated. ALSO telling me to use the collide callback function will not help as I want it to activate after I look at the area.
09-01-2011, 06:46 AM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#2
RE: Doors not opening when the propforce function is used

I usually use the propimpulse. Propforce requires a higher number. Have you checked that the lookat is called? Add a debugmessage or message to it.

[Image: mZiYnxe.png]


09-01-2011, 07:58 AM
Find
ZRPT Offline
Junior Member

Posts: 17
Threads: 3
Joined: Aug 2011
Reputation: 1
#3
RE: Doors not opening when the propforce function is used

(09-01-2011, 07:58 AM)Acies Wrote: I usually use the propimpulse. Propforce requires a higher number. Have you checked that the lookat is called? Add a debugmessage or message to it.

Yes the look at is being called because I added a sound to play in the windopen function, and the sound plays fine.
09-01-2011, 08:02 AM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#4
RE: Doors not opening when the propforce function is used

Then its a matter of numbers. You have set every number to -900. Check which direction the opens (positive or negative x or z) and only apply force or impulse in that direction. Try to impulse command too.

[Image: mZiYnxe.png]


09-01-2011, 08:08 AM
Find
ZRPT Offline
Junior Member

Posts: 17
Threads: 3
Joined: Aug 2011
Reputation: 1
#5
RE: Doors not opening when the propforce function is used

(09-01-2011, 08:08 AM)Acies Wrote: Then its a matter of numbers. You have set every number to -900. Check which direction the opens (positive or negative x or z) and only apply force or impulse in that direction. Try to impulse command too.

Is there anyway to check this? Like on which axis it opens on and which direction?
(This post was last modified: 09-01-2011, 08:14 AM by ZRPT.)
09-01-2011, 08:14 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Doors not opening when the propforce function is used

(09-01-2011, 08:14 AM)ZRPT Wrote: Is there anyway to check this? Like on which axis it opens on and which direction?
In the level editor, when you select an object, you will see blue, red and green arrows. The blue one is Z axis, red one is X axis, green is Y axis. They point in relation to world coordinates.

BTW, you don't need more than 500 for prop force to open a door by force.

Tutorials: From Noob to Pro
09-01-2011, 09:58 AM
Website Find
ZRPT Offline
Junior Member

Posts: 17
Threads: 3
Joined: Aug 2011
Reputation: 1
#7
RE: Doors not opening when the propforce function is used

Thanks to all that helped( Your Computer/Acies ) I have go it to work now. The only things I need too add now are some noises and reactions. Thank again!
09-01-2011, 07:54 PM
Find




Users browsing this thread: 1 Guest(s)