Jump to content
jakeplissken

Changing bullet velocity without a mod.

Recommended Posts

I was experimenting with scripting and I found out how to change the speed of a bullet without using a mod.

 

player addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    if (!local _unit) exitWith {};

    private _position = getPosWorld _projectile;
    private _dirAndUp = [vectorDir _projectile, vectorUp _projectile];
    private _velocity = velocity _projectile;

    deleteVehicle _projectile;

	_bullet = typeOf _projectile;
    _projectile = _bullet createVehicle [0,0,0];
    _projectile setPosWorld _position;
    _projectile setVectorDirAndUp _dirAndUp;
    _projectile setVelocityModelSpace [0, 5900, 3];

    [_projectile, [_unit, _gunner]] remoteExec ["setShotParents", 2];
}];

I was firing an MXM at 2.9 KM range zeroed at 700m and my bullets were dead on the aiming point. So this can can change bullet velocity, but I should try and work out how to add wind to bullets, there should be a simple way.

 

Apparently, this works for simple projectiles, but I need to work out how to do this with my script above and have simple wind deflection without using ACE.

 

_flrObj setVelocity [wind select 0, wind select 1,-10];

But it might require more advanced math than I think. But if you find this useful it is cool, I wonder what else you can do to manipulate a bullet. Could you deflect a bullet if it is aimed at a BLUFOR instead of OPFOR? Or would that script be too intensive on a large COOP mission?

 

Screenshot: 20200730174054-1.jpg

 

Edited by jakeplissken
Added screenshot.
  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×