"Which mod is Dev's mod?"
SHAMELESS PLUG
1/2:
For starters, make sure your ship has a hardpoint named HpCockpit (usually you will want to place it where the ship's cockpit is, though you don't have to). If you don't have this hardpoint, when you switch to cockpit view (ctrl+v) the game will freak out and the camera get screwed up, as you have observed. Also note that the cockpit offset that you set in shiparch.ini is based on the position of HpCockpit, not the center of the ship. For the uninformed, the camera offset in the ship's definition looks like this:
camera_offset = 70, 320
The first value is the Y offset (+ up/- down) and the second is the Z offset (+ back/- forward).
The cockpit file is also specified in shiparch.ini, by a line such as this:
cockpit = cockpits\liberty\l_freighter.ini
I'm pretty sure the game will crash if you don't have a valid cockpit file specified for every ship. Here's a look at a cockpit file:
[Cockpit
mesh = cockpits\civilian\models\cv_cockpit.cmp
int_brightness = 0.500000
head_turn = 30, 5
[CockpitCamera
[RearViewCamera
view_position = 0, 20, 400
[TurretCamera
tether = 0, 0, 450
yaw_rotate_speed = 3
pitch_rotate_speed = 3
accel_speed = 5
The important ones:
mesh = model. This is the model you see when you switch to cockpit view. The normal model of your ship will disappear, though visual effects and (possibly, don't remember) mounted equipment will still be visible.
view_position = X, Y, Z. If you go to rear-view mode (I think it's v by default), this is where the camera gets placed relative to the center of your ship.
tether = X, Y, Z. This is where the turret camera gets placed when you switch to turret view. If X and Y are 0, the center of rotation will be the ship's center, with Z specifying how far away from the center the camera is. Nonzero X and Y values will move the center of rotation away from the ship's center, if you want that.
yaw_rotate_speed = how fast the camera can rotate horizontally
pitch_rotate_speed = how fast the camera can rotate vertically
accel_speed = how fast the camera rotations accelerate; use a higher value for greater responsiveness.
3:
If you look in weapon_equip.ini, you will find that the weapons that exhibit this behavior have force_gun_ori = true. This means that the gun will always fire directly where it is pointing regardless of where your mouse pointer is (however, a rotating weapon will still try to aim where you are pointing). Setting this to false will make the gun fire only when the mouse pointer is within the cone of fire of the barrel (this is set in constants.ini, MUZZLE_CONE_ANGLE; it's in degrees).
4:
Freelancer doesn't handle collisions with large objects very elegantly. Increasing the mass of your ship can reduce how badly your ship gets thrown when it hits a lighter ship (usually it causes the smaller ship to take more damage as well); increasing the rotational inertia will make it more difficult for a torque imparted by a collision to rotate your ship. However, collision detection cannot run continuously; everything has to happen periodically, maybe 10 or 20 times a second (I honestly have no idea how often Freelancer does it, and I suspect that you might be able to adjust this rate). So, what I suspect happens with larger ships is that an incoming object gets deep inside the surface of your ship, making the registered collision force very large. Because the ship is large, the distance from the center of mass to the point of impact is also large. This results in an enormous torque that spins your ship far more than it should. However, that's just a guess, I don't know for sure one way or the other.
The guaranteed hack to cut down on ship spin is the following. In constants.ini, you can add this constant under [PhySysConsts:
ANOM_LIMITS_MAX_ANGULAR_VELOCITY_PER_PSI = (value)
This is an absolute cap on how fast anything in the game can rotate. So, all you have to do is set this value just above how fast your ship can rotate naturally and you're set. Sure, you'll still get dinked a bit when something hits you, but it's nothing that you can't match with your ship's rotational thrusters.
But wait! What about all the OTHER ships? Won't they be affected to? The answer is that yes they will... in single player. If you are playing on a server that does not have this value set, then all NPCs, missiles, etc will not be subject to the angular velocity cap, just you and you alone. This also means that different players can use different values, corresponding to what ships they are flying.
However, what value to set this constant to is not obvious. Experimentally I have found that the value should approximately equal max_turn_rate * 0.001/0.045, where max_turn_rate is in radians. For those not familiar with Freelancer ship physics, the max turn rate exactly equals (steering_torque / angular_drag).
For example, the default liberty dreadnought turns at ~0.114 radians/second max, so if you were flying one you would set ANOM_LIMITS_MAX_ANGULAR_VELOCITY_PER_PSI to about 0.0025. If you find that your natural turn rate was a bit impaired you could try 0.0026 or 0.0027; 0.003 should be more than high enough.
Edited by - Dev on 12/7/2006 4:47:20 PM