Frictional Games Forum (read-only)
[SCRIPT] Slight problem with prop impulse - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Slight problem with prop impulse (/thread-21212.html)



Slight problem with prop impulse - serbusfish - 04-19-2013

I have a script set up that pushes a door open. The script works fine, however I find sometimes if you try to open the door (it starts out locked) when it comes to the script activating for some reason the door wont open. Here is the script:

Code:
void BLOWOPEN(string &in asParent, string &in asChild, int alState)
            
            {
                    
                    AddTimer("OPEN", 1, "OPEN");
                    
                    SetSwingDoorLocked("castle_arched01_2", false, false);
                    SetSwingDoorDisableAutoClose("castle_arched01_2", true);
                    SetSwingDoorClosed("castle_arched01_2", false, false);
            }

void OPEN(string &in asTimer)
                    
                    {
                            AddPropImpulse("castle_arched01_2", 1, 0, 1.8, "world");
                            
                    }



RE: Slight problem with prop impulse - PutraenusAlivius - 04-19-2013

(04-19-2013, 02:59 PM)serbusfish Wrote: I have a script set up that pushes a door open. The script works fine, however I find sometimes if you try to open the door (it starts out locked) when it comes to the script activating for some reason the door wont open. Here is the script:

Code:
void BLOWOPEN(string &in asParent, string &in asChild, int alState)
            
            {
                    
                    AddTimer("OPEN", 1, "OPEN");
                    
                    SetSwingDoorLocked("castle_arched01_2", false, false);
                    SetSwingDoorDisableAutoClose("castle_arched01_2", true);
                    SetSwingDoorClosed("castle_arched01_2", false, false);
            }

void OPEN(string &in asTimer)
                    
                    {
                            AddPropImpulse("castle_arched01_2", 1, 0, 1.8, "world");
                            
                    }
You need to have it to be above 2000 to see the effects. And you need .f after each one.


RE: Slight problem with prop impulse - Yare - 04-19-2013

(04-19-2013, 03:13 PM)JustAnotherPlayer Wrote: You need to have it to be above 2000 to see the effects. And you need .f after each one.

You need 2000+ in AddPropForce. Impulse is much stronger. And you need .f only if you type float values. Integers work without it.

I am wondering why you put a force both on x and z axis. If you want to push the door, I think you need a force only along one axis, depending on how the door is situated. If you want the door to open entirely, I recommend to use 5+ values. Also remember about a proper direction by typing a value over or below 0.
You can simply select your door in Level Editor, drag it into direction you wish it to open, and watch how its position values on the right panel change. For example, if the value on "x" axis increases, you need to type 5 or more. If it goes down, -5 or less.


RE: Slight problem with prop impulse - serbusfish - 04-19-2013

Ah right I see, I didnt realise there was prop force and impulse. I will give the force command a try and see if that fixes it, cheers guys Smile