Jump to content

kirumy

Member
  • Content Count

    11
  • Joined

  • Last visited

  • Medals

Community Reputation

19 Good

2 Followers

About kirumy

  • Rank
    Private First Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, Sorry for necroing this ancient thread but if you've still got that mission file on hand @Zerenco, please provide it to me, I think I've got a more performant work around, that utilises seperate recognise and engage threads; I think I also have a way to force the CRAM AI to orient the gun to a certain elevation and azimuth and fire the gun, in a more reliable way. I want to continue to avoid invoking dependencies on mods and even CBA. Link to thread containing info on how to set elevation: As time goes on, I'll try and port this logic to Reforger as well, for those interested 🙂
  2. This version now features boosting to the target + curving missiles + simulated guidance types. The "fuse" proximity has been dramatically lowered. Naturally, this is completely untested as I'm at work, though this time I am confident it will work out of the box (considering I ripped the last one to do it and Barbuse's lovely guided missile script). Hey Floof, do you reckon it's possible to use a distance check to produce an anti-air site battery that "shares" data via global variables? We could also use those arrays to determine which missile/c-ram is engaging which target -> an array of batteries engages its corresponding missile number. So _incoming select 0 is engaged by _battery select 0 and so on. If we want, we can shuffle the order of the array by sending the most recently used battery to the back of the array. Also, since we have a method to fetch the ammotypes of the batteries, we can also track outgoing/whitelisted projectiles to reduce clutter + use simulated proximity fuses on each of the projectiles to determine a hit as opposed to using randomization. This is the beautiful thing about this engine, even novices like me can create some heckin' detailed frameworks. 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; }; }; }; }; FSG_fnc_addSam = { params["_sam", "_range"]; _null = [_sam, _range]spawn{ private ["_sam","_range", "_incoming","_target","_interceptor"]; _sam = _this select 0; _range = _this select 1; _magazine = weaponState [_sam, [0]]; _ammo = getText (configFile >> "CfgMagazines" >> magazines _sam select 0 >> "ammo"); while {alive _sam}do{ _incoming = _sam nearObjects ["ShellBase", _range]; //advisable to comment this one out, unless you're roleplaying the IDF _incoming = _incoming + (_sam nearObjects["MissileBase", _range]); _incoming = _incoming + (_sam nearObjects["RocketBase", _range]); hint format ["%1 incoming projectiles", count _incoming]; if (count _incoming > 0) then{ _missile = selectRandom _incoming; _fromTarget = _missile getDir _sam; _dirTarget = direction _missile; _target = position _missile; _sam lookAt _target; sleep (random 4)+3; _engaged = _missile getVariable "engaged"; if(_dirTarget <_fromTarget + 60 &&_dirTarget >_fromTarget - 60 && alive _missile && isNil "_engaged") then { _missile setVariable ["engaged", 123,true]; [_sam, _magazine select 1] call BIS_fnc_fire; _interceptor = position _sam nearObjects [_ammo, 5] select 0; sleep 0.1; //moved to catch missile immediately. hint format ["%1 Launched!", _interceptor]; _failCount = 0; _boostTimer = time + 1.5; _boostAngle = _interceptor call BIS_fnc_getPitchBank select 0; //sleep 0.09; boost stage can now be used for guidance without breaking muh immersion while {alive _missile} do { _minDist = _missile distance _interceptor; drawIcon3D["", [1,0,0,1], ASLtoAGL getPosAsl _interceptor, 1,1,45,"Interceptor",1,0.05, "TahomaB"]; drawIcon3D["", [1,0,0,1], ASLtoAGL getPosAsl _missile, 1,1,45,"Target",1,0.05,"TahomaB"]; //_velocity = (velocityModelSpace _interceptor) vectorMultiply 1.00001; _velocity = (velocityModelSpace _interceptor) vectorMultiply 1.01; _velocityTrue = velocityModelSpace _interceptor; _dirHor = [_interceptor, _missile] call BIS_fnc_DirTo; _interceptor setDir _dirHor; _dirVer = acos ((_missile distance2D _interceptor) /(_missile distance _interceptor)); hint format ["Direction: %1, distance2d: %2, Distance3d: %3", _dirVer, _missile distance2D _interceptor, _missile distance _interceptor]; // idk?_dirVer = (_dirVer * -1); if (serverTime > _boostTimer) then { if (_boostAngle < 70) then {_boostAngle = _boostAngle+2.5}; [_interceptor, _boostAngle, 0] call BIS_fnc_setPitchBank; _interceptor setVelocityModelSpace _velocityTrue; } else { [_interceptor, _dirVer, 0] call BIS_fnc_setPitchBank; _interceptor setVelocityModelSpace _velocity; };//boosts up for 3 seconds. sleep 0.002; // adjust if laggy if (_minDist < _missile distance _interceptor) then { _failCount = _failCount + 1; } else {_failCount = 0}; if (_interceptor distance _missile < 60 or _failCount > 3) /* Cheat mode*/ then { "HelicopterExploBig" createVehicle (getPos _missile); deleteVehicle _missile; }; }; sleep 0.1; if (alive _interceptor) then { sleep 0.5; "HelicopterExploBig" createVehicle (getPos _interceptor); deleteVehicle _interceptor; }; }; }; if (count _incoming == 0) then { sleep 0.5; }; }; }; }; }; This one is EXTRAORDINARILY complicated, due to all the guidance simulation without actually introducing any new missiles! Frankly, it'll be a miracle if it works, but I secretly have really high hopes for this. One day, some day, we will be doing ship-to-ship combat and it'll be important. Or you could just go download HAFM Navy, that works too.
  3. I was bored at work and was trying to come up with possible improvements. A "centralised" targetting system would be good. If the missiles flew up to altitude before turning to face the incoming projectiles, it would look much more realistic: I will upload another version where the missiles "curve" (multiple stages of flight with multiple changes to the direction vector as well as the velocity vector (atm it's only velocity which is why it looks so jank). Might also attach some smoke grenades or something to give the missiles a nicer trail.
  4. Recommend increasing the offset angle from 25 to 55, this produces more realistic results without risking firing at outgoing ammo. Also, I'd spend some time testing this against the desired munition to triple check it doesn't do anything crazy.
  5. Use a description.ext, they're so much less jank (somehow) than the editor stuff. I always get this problem when I use 3den based respawn.
  6. Debugging that's going to be a nightmare, I'll add a debugger version soonTM. I did the entire thing in regular notepad so the syntax is probably less than stellar. of course, considering how well POOK's SAM pack works, this is might be rather redundant, though I still like the idea of getting this all to work vanilla. Maybe one day we'll be able to do hit-to-kill simulation. ALSO, it'd be very neat if you could get the rounds to airburst near the object - even if you do something with smoke and mirrors (just spawning many small explosions to occur in a rough area with staggered detonations before deleting the shell or similar). Alright, final edit: GOT IT WORKING YAY. Apparently 20m was too small a margin of error and 50m was good. We could make our missile more manoeuvrable to compensate, but why waste the performance?
  7. I think you're in good shape atm. I recommend looking at (pun not intended) this function https://community.bistudio.com/wiki/lookAt and example 3 on that function. I gave making the mk21 sam version a go (it's not limited to the mk21, should work with any SAM, even Igla pods or static AA launchers), obviously you'd need to adjust the cram_init. Keep in mind I wrote this while at work and it's completely untested, though I see no reason why it shouldn't work (though it probably won't). 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; }; }; }; }; FSG_fnc_addSam = { params["_sam", "_range"]; _null = [_sam, _range]spawn{ private ["_sam","_range", "_incoming","_target","_interceptor"]; _sam = _this select 0; _range = _this select 1; _magazine = weaponState [_sam, [0]]; _ammo = getText (configFile >> "CfgMagazines" >> magazines _sam select 0 >> "ammo"); while {alive _sam}do{ _incoming = _sam nearObjects ["ShellBase", _range]; //advisable to comment this one out, unless you're roleplaying the IDF _incoming = _incoming + (_sam nearObjects["MissileBase", _range]); _incoming = _incoming + (_sam nearObjects["RocketBase", _range]); hint format ["%1 incoming projectiles", _incoming]; if (count _incoming > 0) then{ _missile = _incoming select 0; _fromTarget = _missile getDir _sam; _dirTarget = direction _missile; if(_dirTarget <_fromTarget + 25 &&_dirTarget >_fromTarget - 25 && alive _missile) then { _target = (position _missile) vectorAdd (velocity _missile vectorMultiply (_missile distance _sam)*0.0001); //this is our offset _unitVector = vectorNormalized (position _sam vectorDiff _target); //I strongly advise _sam lookAt position _missile; //adjusting on a per rocket sleep 1; // let it swing the gun around basis [_sam, _magazine select 1] call BIS_fnc_fire; sleep 0.01; _interceptor = position _sam nearObjects [_ammo, 500] select 0; hint format ["%1 Launched!", _interceptor]; sleep 0.09; while {alive _missile} do { _target = (position _missile) vectorAdd ((velocity _missile) vectorMultiply (_missile distance _interceptor)*0.0001); //re _unitVector = vectorNormalized (position _interceptor vectorDiff _target); _interceptor setVelocity (_unitVector vectorMultiply (vectorMagnitude velocity _missile)); sleep 0; // adjust if laggy if (_interceptor distance _missile < 200) then { "HelicopterExploBig" createVehicle (getPos _missile); deleteVehicle _missile; deleteVehicle _interceptor; }; }; }; }; if (count _incoming == 0) then { sleep 1; }; }; }; }; }; Init: 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; }; }; if (_x isKindOf "B_SAM_System_02_F")then{ //you could also add B_SAM_System_01_F, B_SAM_System_03_F or anything you want, that's got a missile. if((side _x) == West)then{ [_x,8000]call FSG_fnc_addSam; // the cramdis doesn't even do anything lol }; }; } 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; }; if(_obj isKindOf "B_SAM_System_02_F")then{ // you know the drill [_obj, 8000]call FSG_fnc_addSam; }; }]; }forEach FSG_CURATORS; //could also do allCurators if you feel heckin' lazy };
  8. A few questions: Why aren't you using doTarget for the round instead of the wonky createVehicle? Why don't you use the normal turret and ammo for the vehicle? You could fetch them by weaponsTurret. Why is the AI being disabled - the doWatch should override the the AI ability. Why are you using fire instead of fireAtTarget (once again to avoid the wonkiness of creating the vehicle)? Presumably, you have good answers for these, so now I'm going to ask about alternatives: Instead of pulling the variables for leadPrediction out of a hat, why aren't you using the velocity function? Why is there a sleep for blowing up the round? It takes too long for most missiles - you should sleep for the delete target instead and do that AFTER the round is deleted. Why is there a chance variable? It doesn't even do anything. Why didn't you create a fakeHelo target for the missiles part of CRAM script? Sorry if I come across as really demanding - this is a brilliant script and I can see you've put a lot of work into it, I just wanted to offer some real criticism that you could use to improve it! Also, if I'm necroing this thread, sorry, but I will post a dump of my version soonTM Thanks for the hard work Floof
  9. Yo yo yo, got the RPTs here for dat error. So, I was curious and decided to test whether the problem would occur on a listen server. It did not, which was weird. Then I went ahead and tested it on a dedi and, sure enough, it didn't work. Exact same files and everything, I triple checked. ARGHHGHHGHGH. Anyways here are the files: Listen client rpt (I don't know where the listen server rpts go): http://puu.sh/rtWit/def48baccf.rpt Dedi server client rpt (as in, the client that connected to the server even though it's all local): http://puu.sh/rtWlF/90ea03d19c.rpt Dedi server rpt (just the server): http://puu.sh/rtWsp/27bcbdfa68.rpt I'm not the smartest cookie, so I don't know what's going on but I would VERY much appreciate one of you smart fellas telling me what's going on and how to fix. In the meanwhile I will revert versions which should hopefully fix. :)
  10. While the not-so-recent sound update dramatically improved the quality of sounds, especially gunshots, in ArmA3 by adding a very nice dynamic echoing system, the actual gunshots of certain weapons still feel very lackluster. In particular, one of the biggest problems (in my opinion) is the sound of heavier weapons. While the marksman DLC gpmg's sound okay, most of the other weapons, including the vanilla .50 HMG and the GMG sound... less terrifying than they should. I'd like to use an example of what I consider to be one of the best heavy weapons sound effects system, the ArmA2 mod ACEX_SM. If you want an example, the following link contains some audio from ArmA2's acex_sm sound mod. The heavier weapons are more deep and sonorous, and you can EASILY tell the direction in which they are firing from, even with youtube's stereo audio compression. You only need to listen for a few moments for this to become abundantly clear. In comparison, ArmA3's lmgs and hmgs sound considerably more ambiguous. The sound of the supersonic rounds snapping overhead is excellent, but the attenuation of the source gunshots is unrealistically exaggerated. It takes a significant amount of experience for a player to estimate which direction they are being fired at from, and even then, visual cues are vital in determining the source. As an example; I note that this is a particularly poor example, as I am unsure of the nature of the weapon being used to fire at the soldier in cover, however, it's quite clear that the snaps dramatically overwhelm the audio of the weapon being fired. Also, the snaps are the same in sound regardless of the caliber of weapon being fired. (A 40mm cannon round whizzing overhead sounds identical to a 5.56). The source of the shots cannot be audibly gauged. Credits to ShackTactical and Dslyecxi for the footage. I used it in the context of education and feedback, I'm sure they won't mind.
  11. kirumy

    MP Splendid Camera?

    Do you know if a player can have this script executed on him if he dies and respawns as a bird (I.e goes into normal spectator?). Any ideas what would happen to him if he attempted to teleport himself, if Splendid Camera can be enabled? I would experiment on this myself, but, sadly, I have very limited internet bandwidth (100 megs:sulk:)
×