So currently I'm having an issue with an dealing with ship-ship collisions in my super cool awesome rad mod I've been working on. Every time the player touches a ship, he'll skid along the surface. I know why this is happening. It's every frame I add to the player's velocity an equivalence speed to what the camera is scrolling at. Pretty scarey equation too to make it work.
Take a look if you dare."So, Andrew, why exactly are you doing this?"
Why? I rather
not do this to be honest, but certain...silliness about how FSO does collision detection. Originally, I had just moved the player's position every frame at the same rate as the axes scroll rates (everything else except the player that is slaved to the scrolling still does this actually). The issue comes when the player sits still and he is scrolled into a ship. Since neither the player or the ship he's about to run into do really have an actual velocity, the engine knows none of the better and pretends they aren't even intersecting, leading to ALPHA ONE becoming ETHEREAL ALPHA ONE.
Right, so enough rambling, I need some coming up with a way to deal with ship-ship collisions without causing the player to skid forward, become ethereal and noclip through the sucker, or as you'll see in the script I show down below, the player gets hurled forward moments later. This is the last physics issue I have that is wrt my script I made.
Here's the whole script. This one is an updated revision to fixes some other issues such as weapons and player being blocked by exploding ships. The speed adjustment related stuff begins on line 138 and ends with the Simulation hook.
I personally see only two options:
- Rewrite how collsion detection works. Like hell I can do that.
- Reduce the player hitbox for ship-ship collsions and kill the player instantly if he does collide. Because, hell, you'll be dead in levels where it is claustrophobic anyway.
I rather not do the second option, and I lack the skills to take on the first option.