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
#14
RE: How To Make An Object Fly Once I Trigger It?

(09-17-2010, 11:44 PM)gosseyn Wrote: i have problems making this to run well, this is what i do(i try to make a chair fly a bit in the air when player collide with a script area) :

i create the function that will make the chair fly :
void ChairFly()
{
AddPropImpulse("MyChair", 0.0f, 15.0f, 0.0f, "world");
}

and then inside OnStart i add this :
AddEntityCollideCallback("player", "AreaChairFly", "ChairFly", true, 1);

What is wrong? Thanks!

Are you trying to give the item coordinates on where in the map to fly to? The easiest way I found it to work is to simply move the object in question to the area you want it to fly to and then write down how much force you need to get the object from its starting position to the position you want to get to by flying, then put those values into the script line to make it go there...

Here's what I have for a cross that falls off my shelf and scares my guy, decreasing his sanity:
void CollideCrossTrigger1(string &in asParent, string &in asChild, int alState)
{
    
    AddPropImpulse("crossboo_1", 0, 0, -2, "");
    
    GiveSanityDamage(5, true);
    
}
And of course, my AddEntityCollideCallBack is further up the page and is as follows:
AddEntityCollideCallback("Player", "CrossTrigger1", "CollideCrossTrigger1", true, 0);

I don't think you need to put in the "f"s after the numerical values you desire, I didn't and it works fine.

Check out my custom stories(1)(2)!
09-18-2010, 12:13 AM
Find


Messages In This Thread
RE: How To Make An Object Fly Once I Trigger It? - by theDARKW0LF - 09-18-2010, 12:13 AM



Users browsing this thread: 1 Guest(s)