Search the Community
Showing results for tags 'C-ram'.
Found 3 results
-
Need help to find the intented Target of AI
Heavensrevenger posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey I want to make the C-RAM bullets explode if they fly past the target. I know how I'll do the Code but I don't know how to get the object that the C-RAM is currently shooting at. Any help is appreciated! -
Made a c-ram script for my mission and decided to post it here, feel free to use as you wish. (Wip) Place into init.sqf: call compile preprocessFileLineNumbers "scripts\C-RAM\C-RAM.sqf"; _null = execVM"scripts\C-RAM\cram_init.sqf"; scripts\C-RAM\C-RAM.sqf if(isServer)then{ FSG_fnc_addCram = { params["_cram","_range"]; _null = [_cram,_range]spawn{ private["_cram","_range","_incoming","_target","_targetTime"]; _cram = _this select 0; _range = _this select 1; while{alive _cram}do{ _incoming = _cram nearObjects["ShellBase",_range]; _incoming = _incoming + (_cram nearObjects["MissileBase",_range]); _incoming = _incoming + (_cram nearObjects["RocketBase",_range]); if(count _incoming > 0)then{ _target = _incoming select 0; _fromTarget = _target getDir _cram; _dirTarget = direction _target; if(_dirTarget < _fromTarget + 25 && _dirTarget > _fromTarget - 25 && ((getPos _target) select 2) > 20 && alive _target)then{ _targetTime = time + 5; while{alive _cram && alive _target && _targetTime > time}do{ _cram doWatch _target; if((_cram weaponDirection (currentWeapon _cram)) select 2 > 0.15)then{ _cram fireAtTarget[_target,(currentWeapon _cram)]; }; }; }; if(alive _target && alive _cram && _target distance _cram < FSG_CRAMDIS && _target distance _cram > 40 && (getPos _target) select 2 > 20)then{ _null = [_target,_cram]spawn{ private["_target","_cram","_expPos","_exp"]; _target = _this select 0; _cram = _this select 1; _expPos = getPos _target; deleteVehicle _target; sleep 1; _exp = "helicopterexplosmall" createVehicle _expPos; }; }; }; if(count _incoming == 0)then{ sleep 1; }; }; }; }; }; scripts\C-RAM\cram_init.sqf if(isServer)then{ FSG_DEBUG = TRUE; //Show debug info FSG_CURATORS = []; //Add game masters here FSG_CRAMDIS = 2000; //Distance to scan for projectiles { if(_x isKindOf "B_AAA_System_01_F")then{ if((side _x) == West)then{ [_x,FSG_CRAMDIS]call FSG_fnc_addCram; }; }; } forEach vehicles; { _x addEventHandler["CuratorObjectPlaced",{ _obj = _this select 1; if(_obj isKindOf "B_AAA_System_01_F")then{ [_obj, FSG_CRAMDIS]call FSG_fnc_addCram; }; }]; }forEach FSG_CURATORS; }; SAMs (Mk21 Centurion) are not yet included.
- 37 replies
-
- 16
-
Tab lock on - How to set up for a target (C-ram)
alexboy posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Hey guys, I am back at it for sometime in programming the C-ram. I been working hard on this coding, but i need some help with one issue of coding. What I am trying to do is make a config that lets someone Tab- lock on to a target, just like if you had an AA gun - you press TAB and a white box goes around an air craft then it locks on when you are aiming in the direction of the target. also you can do this with machineguns (so that the zeroing is automatic and not manual), I am trying to make a target to be lock on able, so that it does automatic zeroing when aiming at it. right now my C-ram can "auto-zero" into aircraft since it can lock on to it and the zeroing adjusts so that the c-ram bullets hits the target while aiming at it, rather then the bullets ending up missing the target. =============================== EDIT ============================== Right now I can Tab-target aircraft with my c-ram so that it can auto-zero the turret so that the bullets can hit the target at far distances I am trying to be able to do that but with the target i make below Target code: class at_phalanx_target_base: TargetBase { class EventHandlers; }; class at_phalanx_target: at_phalanx_target_base //take out gps { model = "at_phalanx\at_phalanx_target"; displayName = "gun RAM TARGET"; _generalMacro = "at_phalanx_target"; // irTarget = 1; //side = 0; //hasdriver = 1; irLock = true; laserLock = true; nameSound = ""; // threat (VSoft, VArmor, VAir), how threatening vehicle is to unit types threat[] = {0.0, 0.0, 1.0}; //simulation = "artillerymarker"; //simulation = "nvmarker"; laserTarget = true; irTarget = true; nvTarget = 0; //artilleryTarget = true; type = VAir;//added vehicleClass = "Air"; side = TEast; //scope = protected; //laserTarget = 1; armor = 15; scope = 2; cost =10000000; //vehicleClass = "Static"; }; if anyone can help me, i will be very thankful. I been at just this point for a couple of days and i just feel like im missing something simple, and I am looking toward the community for some help Thank you in advance! alexboy