Jump to content
meowcat

I saw a video of a ballistic tracer script that showed the projectile with a dot. Where can I find that script?

Recommended Posts

I saw a video of a ballistic tracer script that showed the projectile with a dot. Where can I find that script? I know of the older one, that colors the tracer paths, but I do not know how to set it up to mark the projectile with a dot.

  • Like 1

Share this post


Link to post
Share on other sites

Why not just use tracer rounds? Maybe I am not understanding. Otherwise, just look up bis_fnc_tracebullets.

Share this post


Link to post
Share on other sites

It was on a video I can't find anymore, someone stuck a 3d visible marker to projectiles.

Share this post


Link to post
Share on other sites
player addEventHandler["FiredMan",
{
	params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
	_sphere = "Sign_Sphere10cm_F" createVehicle (getPosATL _projecitle);
	_sphere attachTo[_projectile,[0,0,0]];
}];

:shrug:

Share this post


Link to post
Share on other sites

Thanks, but it appears to have no effect. I have used it in the dev console and there was no visible objects.

Share this post


Link to post
Share on other sites

Errors? Did the debug console return the event handler index properly? Did you execute locally?

Share this post


Link to post
Share on other sites

Pasted the code into the console, exec locally, no errors.

Share this post


Link to post
Share on other sites
13 hours ago, Grumpy Old Man said:

_projectile

_projecitle

 

Cheers

What do you mean

Share this post


Link to post
Share on other sites
21 minutes ago, meowcat said:

What do you mean

When scripting, stuff like variables need to be typed correctly.

It's not typed correctly, in case those examples I posted didn't give it away.

 

Cheers

Share this post


Link to post
Share on other sites

Just so it's perfectly clear:

 

player addEventHandler["FiredMan",
{
    params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
    _sphere = "Sign_Sphere10cm_F" createVehicle (getPosATL _projecitle);
    _sphere attachTo[_projectile,[0,0,0]];
}];

 

It's not that "projectile" is spelled wrong, it's that it isn't spelled the same everywhere.

Share this post


Link to post
Share on other sites

To get it like this: 3xGegKf.jpg

Get the hit calculator by starting "arma3diag_x64.exe" (it is in the arma3 install folder, only with dev branch). 

Once you started it, just run this in the debug console:

Quote

diag_toggle "Shots";

 

run it again to disable and remove the tracers.

 

You can use the Freecam and mouse cursor, to target impact points or projectiles, to get speed damgage...

Share this post


Link to post
Share on other sites

Is there a way to auto delete the marker after some time or when the projectile is gone?

Share this post


Link to post
Share on other sites
38 minutes ago, meowcat said:

Is there a way to auto delete the marker after some time or when the projectile is gone?

What marker?

You mean the sphere?

 

player addEventHandler["FiredMan",
{
    params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
    _sphere = "Sign_Sphere10cm_F" createVehicle (getPosATL _projectile);
    _sphere attachTo[_projectile,[0,0,0]];

    _delete = [_sphere,_projectile] spawn {
    	params ["_sphere","_projectile"];
    	waitUntil {sleep 1; vectorMagnitude velocity _projectile <= 0.01};
    	deletevehicle _sphere;
    }
}];

Cheers

Share this post


Link to post
Share on other sites

thanks, this also a great script example for me to learn from.

Share this post


Link to post
Share on other sites
{
	_x addEventHandler["FiredMan", 
	{
		params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
		_sphere = "Sign_Sphere10cm_F" createVehicle (getPosATL _projectile);
		_sphere attachTo[_projectile,[0,0,0]];

		_delete = [_sphere,_projectile] spawn {
			params ["_sphere","_projectile"];
			waitUntil {sleep 1; vectorMagnitude velocity _projectile <= 0.01};
			deletevehicle _sphere;
    }
	];
} forEach allUnits;

I have tried converting it into foreach so it can be applied for all units at once, but it wont work. No error at all.

Share this post


Link to post
Share on other sites
On 3/12/2018 at 1:19 PM, Grumpy Old Man said:

What marker?

You mean the sphere?

 


player addEventHandler["FiredMan",
{
    params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
    _sphere = "Sign_Sphere10cm_F" createVehicle (getPosATL _projectile);
    _sphere attachTo[_projectile,[0,0,0]];

    _delete = [_sphere,_projectile] spawn {
    	params ["_sphere","_projectile"];
    	waitUntil {sleep 1; vectorMagnitude velocity _projectile <= 0.01};
    	deletevehicle _sphere;
    }
}];

Cheers

 

Hey Grumpy, could you help me with this so that instead of the attachTo command (which is super expensive for MP) it just registers the position of the bullet at the point of impact (change of velocity) so then that position can be used to make this suppression effect EH work:

 

// EH added to ai Unit who is able to inflict the suppress visual effect on player units:
_aiUnit addEventHandler["FiredMan",
{
    params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
	if (isNull _projectile) then {
		 _projectile = nearestObject [_unit, _ammo];
	};
    _getProjPos = [_unit,_projectile] spawn {
    	params ["_unit","_projectile"];
    	waitUntil {sleep 0.1; vectorMagnitude velocity _projectile <= 0.01};
    	_bulletImpactPos = getPos _projectile;
		[_unit,_bulletImpactPos] call bulletImpactCheck;
    };
}];

// Both bulletImpactCheck and suppressionEffect are placed on top of the Init.sqf.
bulletImpactCheck =
{
_aiWhoFired = _this select 0;
_bulletImpactPos = _this select 1;
_nearHumans = [];
_targetHumans = [];
_closestEnemy = objNull;
_nearHumans = nearestObjects [_bulletImpactPos, ["man"], 15];

	{
		if ((side _aiWhoFired) getFriend (side _x) < 0.6 && alive _x && !isNull _x && isPlayer _x) then {_targetHumans = _targetHumans + [_x];}
	}forEach _nearHumans;
	_targetsAmount = count _targetHumans;
	if (_targetsAmount > 0) then
	{
		{
		_null = [_x] remoteExec ["suppressionEffect",_x];
		} forEach _targetHumans;
	};
};

suppressionEffect =
{
	0 = ["ChromAberration", 200, [0.02, 0.02, true]] spawn { 
	 params ["_name", "_priority", "_effect", "_handle"]; 
	 while { 
	  _handle = ppEffectCreate [_name, _priority]; 
	  _handle < 0 
	 } do { 
	  _priority = _priority + 1; 
	 }; 
	 _handle ppEffectEnable true; 
	 _handle ppEffectAdjust _effect; 
	 _handle ppEffectCommit 0.1; 
	 waitUntil {ppEffectCommitted _handle};
	 uiSleep 0.2; 
	 _handle ppEffectEnable false; 
	 ppEffectDestroy _handle; 
	};
};

/* The EH works and it shows no error yet the effect does not happen on the player. The remoteExec works great so it must be the position that is not calculated right? */

As you can see the suppression effect are just visual and can only happen to players.

 

I know I am close but I can't get this to work so far.

 

johnnyboy suggested that perhaps BIS_fnc_inAngleSector could be used instead of a spawn so the whole EH is less expensive. And since I am doing this for a MP mission I really need to keep this as lean as possible. But after hundreds of tests I still cannot make this work.

 

If you can help me I would be in your debt!

 

Thanks in advanced

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

×