Frictional Games Forum (read-only)
this could be interesting - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: this could be interesting (/thread-6282.html)



this could be interesting - THE/ILL/WILL - 01-19-2011

Ok so what im trying to do is as the player is watching a chair is going to be laying on the ground and im going to use a basic collide callback well what i want to happen is the chair to flip up and slide into a desk like a ghost did it Smile i tinkering with a few lines right now but nothing im doing is working so far so if anyone has any tips for on which script functions would work i would be vary willing to post a video of me dancing to shakera as payment... im a vary tall VERY white man, always funny Smile


RE: this could be interesting - Equil - 01-19-2011

The function you're looking for is probably AddPropImpulse.

Heres the syntax:
AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);

asName: The prop's name for the impulse to applied to, in this case the chair.

float afX: Impulse applied on the X axis, can be negative of positive values

float afY: Impulse applied on the Y axis, Y axis is always up and down, positive for up, negative for down

float afZ: Same properties as the X axis

asCoordSystem: Co-ordinate system to be used, in this case just use "world"

You'll need to experiment with and use a combination of values to get the right about of impulse you want. If you look in the editor you can see which directions the axises are by the coloured lines:

Red: X axis
Blue: Z axis
Green: Y axis

Hope this helps.


RE: this could be interesting - THE/ILL/WILL - 01-19-2011

ya that is what i was trying to use but on my first try all im able to do is slide the chair of fip it but none of the movements a precise enuff.


RE: this could be interesting - Equil - 01-19-2011

Then you'll just need to keep experimenting with the values.


RE: this could be interesting - Andross - 01-19-2011

Easy Peasy.
What you need is a Sticky Area.
Put its center wherever you want the chair to end up standing.
Then, when your event is triggered, push the chair towards that area via AddPropForce() or something equivalent.
Make sure that the area is large enough so that the chair will collide with it.
Done Smile