(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 :
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, "");
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.