Jump to content

Recommended Posts

Is there any way to make custom missile warheads? I'm trying to script smoke missiles into a mission I'm making.

Share this post


Link to post
Share on other sites

U could track the missile (using Fired-EH) after launch and spawn a smoke grenade or something similar shortly before touchdown and delete the missile

For a bigger smoke effect use arty smoke rounds

Share this post


Link to post
Share on other sites
Posted (edited)

use this code to replace a fired projectile with a GBU. This could be substituted for a smoke shell.

 

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;

    _projectile = "Bomb_04_F" createVehicle [0,0,0];
    _projectile setPosWorld _position;
    _projectile setVectorDirAndUp _dirAndUp;
    _projectile setVelocity _velocity;

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

This will transfer ownership of the projectile to the smoke shell or whatever you fired.

 

This is for a smoke bullet.

 

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;

    _projectile = "G_40mm_SmokeOrange" createVehicle [0,0,0];
    _projectile setPosWorld _position;
    _projectile setVectorDirAndUp _dirAndUp;
    _projectile setVelocity _velocity;

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

 

Edited by jakeplissken
Fixed code.
  • Like 1

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

×