Frictional Games Forum (read-only)
How To Make An Object Fly Once I Trigger It? - 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: How To Make An Object Fly Once I Trigger It? (/thread-4404.html)

Pages: 1 2


How To Make An Object Fly Once I Trigger It? - theDARKW0LF - 09-15-2010

I was wondering how to make a vase in my map fly into the air and to a specific position (as if being thrown by a ghost) after I trigger it to become active when I step into a certain area? I got the triggering to become active part down, but I don't know how to make it fly when I enter my script area. Any help?


RE: How To Make An Object Fly Once I Trigger It? - Argoon - 09-16-2010

If you mean thrown spining in the air them just give it a impulse force using the physics system just like FG did with the iron maiden doors. If you mean flying strait to other point like a near table or something them imo you will need to animate it on a 3d app and them call that animation in a script.


RE: How To Make An Object Fly Once I Trigger It? - theDARKW0LF - 09-16-2010

(09-16-2010, 12:17 AM)Argoon Wrote: If you mean thrown spining in the air them just give it a impulse force using the physics system just like FG did with the iron maiden doors. If you mean flying strait to other point like a near table or something them imo you will need to animate it on a 3d app and them call that animation in a script.

Yeah it doesn't necessarily matter where it goes, I just want it to fly to another part of the room it's in so it looks like it was tossed... How do you set up the addbodyimpulse function? I tried but couldn't figure out what to put in past the part where I enter in the entity's name?


RE: How To Make An Object Fly Once I Trigger It? - Argoon - 09-16-2010

http://www.frictionalgames.com/forum/thread-4379.html

Try the link above. Smile


RE: How To Make An Object Fly Once I Trigger It? - theDARKW0LF - 09-16-2010

(09-16-2010, 12:27 AM)Argoon Wrote: http://www.frictionalgames.com/forum/thread-4379.html

Try the link above. Smile

Oh yeah I've seen that thread, but they nowhere mention what is put into each field "void AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);". All I know is that in the "string& asName", I put in the entity's name, but I've tried putting in different numbers for each of the "float afX, Y, Z's" and nothing happens - it could be due to the fact that I don't know what to put into the "string& asCoordSystem" field... Any ideas? Also, what is the entire string put under? StartOn, OnEnter, or nothing? Thanks...


RE: How To Make An Object Fly Once I Trigger It? - Argoon - 09-16-2010

Can't help you sorry i'm no coder Sad


RE: How To Make An Object Fly Once I Trigger It? - theDARKW0LF - 09-16-2010

(09-16-2010, 12:48 AM)Argoon Wrote: Can't help you sorry i'm no coder Sad

Ok, thanks anyways. Is there anyone else who can point in the right direction?
Anyone daring enough to help me with this code?

EDIT: Looks like I figured it out on my own, thanks anyways... Dodgy


RE: How To Make An Object Fly Once I Trigger It? - Armored Cow - 09-16-2010

If you could tell what you did I would love to know.


RE: How To Make An Object Fly Once I Trigger It? - alfie - 09-16-2010

I guess coord system would be local or global?


RE: How To Make An Object Fly Once I Trigger It? - theDARKW0LF - 09-16-2010

Ok so what you do is add "AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);" into your script file, replacing the "string& asName" with the name of the entity in question, and replace the "float afX, float afY, and float afZ" with the amount of force (in numbers) you wish to have applied to the entity in that direction, and leave the "string& asCoordSystem" as "".

So, for instance, with one of my objects it looks like this: AddPropImpulse("crossboo_1", 0, 0, -2, "");

EDIT2: Oh, and make sure that the string is put under (without quotations):
"void OnEnter()
{
}"


Hope that helps!

EDIT: Oh and if you don't mind, give me an Internet if it helped! Big Grin