Checking when an object impacts the ground?

Post » Sat Jul 12, 2014 8:44 am

Hello everyone!

I was wondering about quite a simple thing: An OnImpact() - Event. There doesn't seem to be one, and the only objects that can respond to impacts are projectiles. Now I wanted to create a powder barrel that explodes when it is shot with a sufficent amount of force, but right now I'm failing because of the abscence of such a thing. However, Skyrim seemed to do it with the FallingOilTraps, but I just can't see how they worked, neither. Any ideas?

Thanks,

Nicolas

User avatar
XPidgex Jefferson
 
Posts: 3398
Joined: Fri Sep 08, 2006 4:39 pm

Post » Sat Jul 12, 2014 9:03 am

I asked the exact same thing several weeks ago and no one was able to figure it out. It must be hard coded (for the oil lamps) or the Nif has some special collision layer.

I needed it for a bottle that was thrown into the air for target practice. If the player missed the bottle it had to be disabled when it hit the ground in order for me to create a "glass breaking" effect.

The way I solved it was with polling for the x y z position and looked for when the "speed" changed drastically indicating the movement was interfered with by hitting the ground or some object such as a roof on a house.

User avatar
Kortniie Dumont
 
Posts: 3428
Joined: Wed Jan 10, 2007 7:50 pm

Post » Sat Jul 12, 2014 7:05 am

Event OnTrapHitStart(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, \float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType)

Maybe this? I think your object needs a special collision layer. Should should be able to be done with nifscope if needed.

User avatar
Ryan Lutz
 
Posts: 3465
Joined: Sun Sep 09, 2007 12:39 pm


Return to V - Skyrim