Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by Floof

  1. 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.
  2. Depends on what you want, if you just want random locations you can use BIS_fnc_randomPos. If i would make this i'd probably make a list of cities/towns and select one randomly, then select a random road to spawn a pick-up point on. Then you can filter different cities based on distance so you can't drive 100m and finish the mission quick. Also if you want to go with the random approach, select a location with randomPos and use getPos to set the drop-off point, this way you can set the min distance between the spawn/drop points.
  3. Sorry for taking a long time to respond. To answer your question i think we should use a global variable for incoming targets. However i have no idea how to seperate them. Say we have 3 C-RAMs in a triangle. How do they know which target to engage? You could store xyz positions of projectiles, but i think this would be slow. My idea was originally to scan for projectiles within range (say theres 5 crams in 1km, they all use the same central point for scanning). This would make the system more realistic by using a central point, a virtual "radar" (even though we have way higher transfer-speeds IRL), this would be great for MILSIMs due to seperate human operated groups, wouldn't work for AI as well. In my opinion it would be great to have radar groups to detect incoming missiles, almost like it works IRL (even tho irl they're more automated (and boring)). If you have other ideas let me know, and since you're clearly interested in this script idea feel free to add me on steam.
  4. Floof

    Infinite Range Artillery

    Don't think there's a way other than making an addon and increasing its range. You could fake it by creating a mortar and firing it, wait a while based on distance and see the round come down. I still don't know if you would hear the mortar fire at extreme ranges, might be worth a shot. You could customize the virtual module to fake a launch at range, i still don't think you'd be able to see/hear it tho. So faking is the only way i see, unless you're willing to make an addon.
  5. Didn't really work on this for a while, came up with a new version that works for now. I think this is how it should've looked like from the start, works better too. Last version was a bunch of ideas mashed into one script that barely worked. I have some free time now so i guess it would be a good idea to just finish this project. Also works with Zeus now, i'll try to get some ideas on how to improve performance with many C-RAMs in one area, maybe add some targeting system so all of them don't shoot at a single target. We'll see. And @kirumy half of the script didn't make sense anyways, better to rewrite it. Chance variable was supposed to be a ~0.001% chance to miss the target, wasn't implemented. Createvehicle for targeting was a bad idea from the start, i still have no idea how to get zeroing to work, suggestions welcome.
  6. This should have all you need.
  7. You can use playSound3D, or something else to play the sound on all units in the vehicle. For example: { _x playSound "kek.ogg"; }forEach crew vehicle player; //Untested There's some other workarounds but playsound3d should work good, unless you need JIP compatibility.
  8. Didn't take a look at ur profile so yeah, can't assume that most of the time here hehe. U could use showCommandingMenu to select a specific menu call, or just find it in the config like this: player setVariable ['BIS_SUPP_request', ['Artillery', _pos]]; That does exactly what the menu does. But if u want to just select the command use showCommandingMenu. Some stuff here.
  9. Find out what the call itself does. Stealth for example could look something like this: { _x setBehaviour "STEALTH"; } forEach units group player; Then just copy it or find the call itself.
  10. All extensions (.dll's etc) need to be approved by battleye for multiplayer usage. Read more here. To whitelist an extension contact battleye here. Include a title & description, and add a download link to up your chances of approval.
  11. Not sure if you are trying to get passengers into a heli or a pilot/gunner. Use moveInDriver/moveInGunner/moveInCommander for pilot/gunner/command, seems like ur plane doesn't have passenger seats. (If it does, then post some more details like planes name etc)
  12. Do you have any mods enabled? Just tested and works fine for disabling/enabling saving. Test on a fresh mission to see if it works.
  13. nObj = nearestObjects[casPos, ["sarheli0","sarheli1","sarheli"]]; casSpawn assignAsCargo nObj select 0; [casSpawn] orderGetIn true; In the future remember that nearestObject returns a single type, doesn't support arrays. nearestObjects returns an array so use that, should work. wiki. Also for future reference its recommended to add a radius to nObj's nearestObjects, so that the engine doesn't have to scan a 15km and lag everyone for no reason if the vehicles are far away.
  14. Everything u need is here. Define roles & respawn inventories in description.ext and you're done. Add to units/sides/groups with this. It's pretty simple. edit: wrong link xd
  15. Was away for a while but FSG_PRAET_OFFSET is used as a detection cone basically, if you fire towards the praetorian and the missile is going towards the praet in a 50 degree radius it will be shot down. This is needed so the praets don't shoot down your own mortars etc. I made a picture so you understand: Updating the script this weekend.
  16. Don't worry it's not dying, just got done fixing the targeting for the moment. I'm still trying to get somewhat accurate target lead & zeroing to work properly. Here's how it looks now: Gonna post an update later this evening. (It's 3 pm here) edit: Script seems to be working pretty good now, if the cram shoots you, you are too close. Apparently the Praetorian engages hostile vehicles. (delete the part that enables auto-targeting if you don't want this)
  17. Just tested it myself and it does fire at the ground for some reason, even though it shouldn't be able to fire after the incoming round gets destroyed. Targeting part of the script is a mess anyways so i might as well rewrite it, shouldn't take long unless more stuff gets broken (like always).
  18. Back at it again trying to get the Mk21 Centurions to work, but for now this is happening: Radar works properly now Praetorians switch to using their own radar incase main is destroyed/not in use Somewhat working target prioritization (Only when main radar is on) Now doesn't drop down to 15 fps with multiple Praetorians on the map Going to try and get the centurions working for the next update.
  19. Make a trigger, set its type to skip waypoint and activation whatever you want (set waypoint activation too). It will break the cycle and proceed to next wp.
  20. if(count magazines _mortar == 0)then{hint "yep"}; It counts flares & smokes too.
  21. Define names in description.ext: class CfgIdentities { class dave { name = "Dave"; nameSound = "Givens"; face = "whiteHead_06"; glasses = "None"; speaker = "Male05ENG"; pitch = 1.1; }; }; and add this to each units init box: this setIdentity "dave"; Should show up everywhere.
  22. Fixed a bunch of minor bugs, it works like this now: Main radar that scans the skies (optional) Autoinit on every praetorian Mk21 Centurion is very buggy and not included for the time being About a 90% improvement in performance with multiple CRAMs Now ready for mission implementation. (This means you can implement it now and update later without changing settings) More to come soon, had to fix the broken mess here.
  23. Should be pretty easy, first i'd like to make it so it doesn't shoot down your own missiles/mortars. And make the praetorian actually shoot down incoming rounds. After that why not, good idea.