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
How To Make An Object Fly Once I Trigger It?
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#1
How To Make An Object Fly Once I Trigger It?

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?

Check out my custom stories(1)(2)!
09-15-2010, 11:34 PM
Find
Argoon Offline
Member

Posts: 109
Threads: 5
Joined: Jan 2009
Reputation: 3
#2
RE: How To Make An Object Fly Once I Trigger It?

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.
09-16-2010, 12:17 AM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#3
RE: How To Make An Object Fly Once I Trigger It?

(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?

Check out my custom stories(1)(2)!
09-16-2010, 12:21 AM
Find
Argoon Offline
Member

Posts: 109
Threads: 5
Joined: Jan 2009
Reputation: 3
#4
RE: How To Make An Object Fly Once I Trigger It?

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

Try the link above. Smile
09-16-2010, 12:27 AM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#5
RE: How To Make An Object Fly Once I Trigger It?

(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...

Check out my custom stories(1)(2)!
09-16-2010, 12:38 AM
Find
Argoon Offline
Member

Posts: 109
Threads: 5
Joined: Jan 2009
Reputation: 3
#6
RE: How To Make An Object Fly Once I Trigger It?

Can't help you sorry i'm no coder Sad
09-16-2010, 12:48 AM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#7
RE: How To Make An Object Fly Once I Trigger It?

(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

Check out my custom stories(1)(2)!
(This post was last modified: 09-16-2010, 02:06 AM by theDARKW0LF.)
09-16-2010, 01:50 AM
Find
Armored Cow Offline
Member

Posts: 72
Threads: 3
Joined: Sep 2010
Reputation: 0
#8
RE: How To Make An Object Fly Once I Trigger It?

If you could tell what you did I would love to know.
09-16-2010, 07:08 PM
Find
alfie Offline
Junior Member

Posts: 34
Threads: 3
Joined: May 2010
Reputation: 0
#9
RE: How To Make An Object Fly Once I Trigger It?

I guess coord system would be local or global?
09-16-2010, 07:25 PM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#10
RE: How To Make An Object Fly Once I Trigger It?

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

Check out my custom stories(1)(2)!
09-16-2010, 08:14 PM
Find




Users browsing this thread: 1 Guest(s)