DZAI heli spawn times

I too am having trouble with this variable. I believe it has something to do with the respawn sqf but not sure yet.
 
Can you clarify what is meant by "heli spawn delay?". I don't have much to go on here.

Sent from my Nexus 5 using Tapatalk
 
Personally, it's the amount of time before a new heli patrol is spawned after a previous one is disposed of. Apologies if the guys before me have a different take on it.

Thanks.
 
I am planning on reworking the helicopter respawn process so that the respawn rate can be changed. The way it is now is somewhat primitive as I've been focusing on other things. So stay tuned for now is all I can say at the moment.

Sent from my Nexus 5 using Tapatalk
 
I actually have the heli respawns tweaked with code that Buttface helped me with before the old thread was deleted. This is out of the DZAI_Scheduler.sqf file. The code is setup to not respawn the heli patrol's until they are all dead and a full scheduler cycle has completed. On my public server I have 10 heli's spawn and after all 10 are dead they will respawn roughly 15-30 minutes later.

Code:
if (DZAI_aiHeliPatrols && (DZAI_curHeliPatrols < 0)) then {
        DZAI_curHeliPatrols = 0;
        _helipatrols = [] spawn fnc_spawnHeliPatrol;
        waitUntil {sleep 1; scriptDone _helipatrols};
        sleep 3;
    };
    if (DZAI_curHeliPatrols == 0) then {
          DZAI_curHeliPatrols = -1;
    };
 
This is just a heads up that the next update will have separately configurable minimum/maximum respawn times for helicopter patrols and land vehicle patrols. I just hooked everything into the respawn handler script that's being used for on-foot AI.
 
Love all the updates to the new version but have a question. With the changes to the vehicle patrol system how can I setup what I had before where the AI heli's won't respawn until after all of them are shot down? I'm looking at the code right now to try and come up with it but having some issues.

EDIT:
I'm thinking this in the setup_veh_patrols.sqf in place of the original.

Original
Code:
     if (DZAI_maxHeliPatrols > 0) then {
     if ((count DZAI_heliTypes) < 1) then {DZAI_heliTypes = ["UH1H_DZ"]};
     _helipatrols = DZAI_maxHeliPatrols spawn DZAI_spawnHeliPatrol;
     sleep 5;
     };
New
Code:
     if ((DZAI_maxHeliPatrols > 0) && (DZAI_curHeliPatrols < 0)) then {
        if ((count DZAI_heliTypes) < 1) then {DZAI_heliTypes = ["UH1H_DZ"]};
        DZAI_curHeliPatrols = 0;
        _helipatrols = DZAI_maxHeliPatrols spawn DZAI_spawnHeliPatrol;
        sleep 5;
    };
    if (DZAI_curHeliPatrols == 0) then {
          DZAI_curHeliPatrols = -1;
    };
 
In the future, it is up to you if you want to modify code for your own purposes because I won't always have the time to plan and make custom code for each person. I could give you directions about what files to edit but you will have to handle the code writing part of it.

You will need to modify these files: heli_destroyed.sqf, heli_airlanding.sqf, and heli_getout.sqf.

Replace all instances of:

Code:
0 = ["air"] spawn fnc_respawnHandler;

with:

Code:
if (DZAI_curHeliPatrols == 0) then {
    _nul = [] spawn {
        sleep (DZAI_respawnTMinA + random (DZAI_respawnTMaxA - DZAI_respawnTMinA));
        _nul = DZAI_maxHeliPatrols spawn DZAI_spawnHeliPatrol;
    };
};
 
In the future, it is up to you if you want to modify code for your own purposes because I won't always have the time to plan and make custom code for each person. I could give you directions about what files to edit but you will have to handle the code writing part of it.


Ok I totally understand. Thank you very much for all the help you have given my thus far and adding all these awesome extra options. Let me know if there is anything I can help you with in the future.
 
I do have a question not regarding new/modified code. Do the heli patrols communicate with one another within a certain range? Like if you fire at one heli and another is say within 2km will it come running to help/avenge it's hurt/fallen comrade?
 
I haven't added specific code for this (its default Arma2 AI behavior), but the heli patrols will step in to help other friendly AI units/vehicles that they witness being fired upon. So for example, if you see 2 AI helicopters in the area and you shoot one of them, chances are that both will retaliate - the helicopter that took damage, and the other nearby helicopter if the crew detects you.
 
Back
Top