Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AddPropImpulse not working [SOLVED]
Author Message
junkfood2121 Offline
Senior Member

Posts: 267
Joined: Jan 2011
Reputation: 3
Post: #1
AddPropImpulse not working [SOLVED]
Okay, so I have a problem with my door. I've made a script on another door for closing it but no matter how high I put the vals on the prop impulse on this door, nothing happens (Not even if I put the door slightly open)

My door looks like this:
http://i53.tinypic.com/2elr28y.jpg

And my script:
void CollideGruntChase(string &in asParent, string &in asChild, int alState)
{
    AddPropImpulse("GruntChaseDoor", 1.0f, 0.0f, 1.0f, "World"); //Have also tried 1.0f, 0.0f, 0.0f - 0.0f, 0.0f, 1.0f - 0.0f, 1.0f, 0.0f and a few other combinations but the door just won't even move slightly.
    
    GiveSanityDamage(7.0f, true);
    
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, true);
    PlaySoundAtEntity("", "door_prison_open.snt", "mansion_4", 0, true);
    StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
    
    SetEntityActive("grunt_1", true);
    
    ShowEnemyPlayerPosition("grunt_1");
}

So I simply want the door to get slammed open. All the other scripts in this code works except for the AddPropImpulse one. Any clues? (Btw, the door has the name "GruntChaseDoor" exactly as it's written.

May I present to you.. the Grunt Cannon:
http://www.youtube.com/watch?v=v9KjvvVzNNg
(This post was last modified: 02-10-2011 09:38 PM by junkfood2121.)
02-10-2011 04:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Tottel Offline
Senior Member

Posts: 307
Joined: Nov 2010
Reputation: 0
Post: #2
RE: AddPropImpulse not working
Put the values a lot higher. ^^

As in.. 10000

Also, you don't have to guess. Check in your level editor along what axis you need to apply the force to make it swing open.
(This post was last modified: 02-10-2011 04:08 PM by Tottel.)
02-10-2011 04:07 PM
Find all posts by this user Quote this message in a reply
junkfood2121 Offline
Senior Member

Posts: 267
Joined: Jan 2011
Reputation: 3
Post: #3
RE: AddPropImpulse not working
Still doesn't do anything O.o
In my first map, I had

AddPropImpulse("prison_4", 1.0f, 0.0f, 1.0f, "World");

And that threw my door open really good.

Edit: It works if the door is open a bit now, but it won't slam open if closed.

May I present to you.. the Grunt Cannon:
http://www.youtube.com/watch?v=v9KjvvVzNNg
(This post was last modified: 02-10-2011 04:23 PM by junkfood2121.)
02-10-2011 04:18 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #4
RE: AddPropImpulse not working
1.0f? How do yo expect that to work? Just one direction, where door opens and closes, put something like 150.0f - 200.0f

02-10-2011 04:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
junkfood2121 Offline
Senior Member

Posts: 267
Joined: Jan 2011
Reputation: 3
Post: #5
RE: AddPropImpulse not working
It STILL doesn't work. The door remains closed. Is there any syntax to open the door?

May I present to you.. the Grunt Cannon:
http://www.youtube.com/watch?v=v9KjvvVzNNg
02-10-2011 09:27 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #6
RE: AddPropImpulse not working
From my script:
SetSwingDoorLocked("prison_6", false, true);
    SetSwingDoorClosed("prison_6", false, true);
    SetSwingDoorDisableAutoClose("prison_6", true);
    AddPropImpulse("prison_6", 0.0f, 0.0f, 150.0f, "World");

02-10-2011 09:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
junkfood2121 Offline
Senior Member

Posts: 267
Joined: Jan 2011
Reputation: 3
Post: #7
RE: AddPropImpulse not working
YES! TYVM! That door has been bugging me so much! Big Grin

May I present to you.. the Grunt Cannon:
http://www.youtube.com/watch?v=v9KjvvVzNNg
02-10-2011 09:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #8
RE: AddPropImpulse not working [SOLVED]
I know, I worked on the damn door for hours till I saw a tip on forums.

02-10-2011 11:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)