Jump to content
Heavensrevenger

How to identify selected objects class

Recommended Posts

I'm making interceptable Artillery rounds, however I can't attach a drone (that acts as the target for AA) to Cluster rounds / MLRS, i fixed MLRS by teleporting the drone to the round at all times. I was planning to do the same for the cluster, but since howitzers have multiple ammo types I need to find out if the round is a Cluster or not.
 

this addEventHandler ["Fired",    
{    
 params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];  
 _drone = createVehicle ["B_UAV_02_F", [0,0,1000], [], 0]; 
_drone disableCollisionWith _unit;  
_drone attachTo [_projectile,[0,0,0]];  
_drone setObjectTextureGlobal [_index, ""];   
createVehicleCrew _drone; 
_drone disableAI "LIGHTS"; 
 
_drone disableCollisionWith _vehicle;  
_drone setVehicleAmmo 0; 
_drone setCollisionLight false; 
nul = [_drone, _projectile] spawn {   
params ["_drone","_projectile"];
if ( _projectile == "Cluster_155mm_AMOS" ) then {		//this doesnt work
while {alive _drone} do { 
_drone setpos getPosASL _projectile; 
_drone setVelocity velocity _projectile; 
sleep 0.001; 
}; 
};
waitUntil {sleep 0.001; !alive _drone};   
_bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle getPosASL _projectile;   
_bomb setDamage 1;  
deleteVehicle _projectile;    
deleteVehicle _drone;    
};   
}];

I either need a way to check the projectiles Cfg class or a way to attach the drone to the artillery round
Thank you in advance
 

Edit:

if ( getText (configOf _projectile / "vehicleClass") == "Cluster_155mm_AMOS" ) then {

this doesn't work either

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

×