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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To Make An Object Fly Once I Trigger It?
Author Message
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Argoon Offline
Member

Posts: 100
Joined: Jan 2009
Reputation: 3
Post: #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 all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Argoon Offline
Member

Posts: 100
Joined: Jan 2009
Reputation: 3
Post: #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 all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Argoon Offline
Member

Posts: 100
Joined: Jan 2009
Reputation: 3
Post: #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 all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Armored Cow Offline
Member

Posts: 72
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
alfie Offline
Junior Member

Posts: 34
Joined: May 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




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