Simple AI Tutorial (no rMod or DayZ_Factions)

Syncois could you please reply to my message above Delbert_Grady
Yeah, you can't do that. You have to do the random like I showed.
Code:
_rndWeapon = floor(random 3);
switch (_rndWeapon) do {
case 0: {_sniperRifle="M24";_sniperAmmo="5Rnd_762x51_M24";};
case 1: {_sniperRifle="SVD_CAMO";_sniperAmmo="10Rnd_762x54_SVD";};
case 2: {_sniperRifle="DMR";_sniperAmmo="20Rnd_762x51_DMR";};
case 3: {_sniperRifle="M40A3";_sniperAmmo="5Rnd_762x51_M24";};
};

Put this in place of of your _sniperRifle and _sniperAmmo lines. Also, can M40A3 use M24 rounds?
 
here is what i have done...i definatly have insta respawning ai in one loca and in another they dont respawn at all..its odd
Which ones are respawning, and which ones arent? Those are some very bizarre locations by the way.. negative z coordinates?
 
there is 5 sets on skalinsky island..they constant respawn as fast as we can shoot...the other set is on otmel and they do not respawn...i took the location from a marker i placed in the 3d editor and converted it etc etc..i thought it looked real funny as well but its working..there spawning there
 
there is 5 sets on skalinsky island..they constant respawn as fast as we can shoot...the other set is on otmel and they do not respawn
in unit_killed.sqf do this:
diag_log format["Respawning in %1",_respawnTime];

right above the line that says "sleep _respawnTime;"

and then check the logs after you kill both groups.. see what it says your respawn times are..

You have it set to 15 minute respawns.. So I don't know why they would be instant..
 
Yeah, you can't do that. You have to do the random like I showed.
Code:
_rndWeapon = floor(random 3);
switch (_rndWeapon) do {
case 0: {_sniperRifle="M24";_sniperAmmo="5Rnd_762x51_M24";};
case 1: {_sniperRifle="SVD_CAMO";_sniperAmmo="10Rnd_762x54_SVD";};
case 2: {_sniperRifle="DMR";_sniperAmmo="20Rnd_762x51_DMR";};
case 3: {_sniperRifle="M40A3";_sniperAmmo="5Rnd_762x51_M24";};
};

Put this in place of of your _sniperRifle and _sniperAmmo lines. Also, can M40A3 use M24 rounds?
And then i have to add skins to each of them and etc? Thats gonna take a long time
 
And then i have to add skins to each of them and etc? Thats gonna take a long time
Wait, what are you trying to accomplish? I thought you said you wanted a random weapon for 1 of your gearSets.. If so, this is all you need. All the other variables would stay how they are.. This is only setting _sniperRifle and _sniperAmmo..

If you want different snipers to have different gearsets, then you just use a different gearSet.. If you want random troops, then for unitType you enter 0..
 
ok.i added the line as u stated and same result for skalinsky loca..first 2 i shot respawnd right afer i killed em
i have not made it to other group to test em
thanks for helping me by the way..been strugling with it for a while now
 
Wait, what are you trying to accomplish? I thought you said you wanted a random weapon for 1 of your gearSets.. If so, this is all you need. All the other variables would stay how they are.. This is only setting _sniperRifle and _sniperAmmo..

If you want different snipers to have different gearsets, then you just use a different gearSet.. If you want random troops, then for unitType you enter 0..

I want random for sniper gunner etc..
 
in unit_killed.sqf do this:
diag_log format["Respawning in %1",_respawnTime];

right above the line that says "sleep _respawnTime;"

and then check the logs after you kill both groups.. see what it says your respawn times are..

You have it set to 15 minute respawns.. So I don't know why they would be instant..

Code:
_rndWeapon = floor(random 3);
    switch (_rndWeapon) do {
        _sniperSkin = "BAF_Soldier_Sniper_MTP";
        _sniperRifle = "M24","SVD_CAMO","DMR","M40A3";
        _sniperAmmo = "5Rnd_762x51_M24","10Rnd_762x54_SVD","20Rnd_762x51_DMR","5Rnd_762x51_M24";
        _sniperAmmoCount = 10;
        _sniperGear = ["ItemBandage"];
        _sniperWeapons = ["ItemMatchbox"];
        _gunnerSkin = "BAF_Soldier_MTP";
        _gunnerRifle = "Mk_48_DZ","M240","M249_DZ";
        _gunnerAmmo = "100Rnd_762x51_M240","100Rnd_762x51_M240","200Rnd_556x45_M249";
        _gunnerAmmoCount = 6;
        _gunnerGear = ["ItemBandage"];
        _gunnerWeapons = ["ItemMatchbox"];
        _militiaSkin = "BAF_Soldier_L_MTP";
        _militiaRifle = "Sa58V_EP1","BAF_L85A2_RIS_Holo","G36C","M4A1_HWS_GL","G36A_camo","M16A4_ACG";
        _militiaAmmo = "30Rnd_762x39_SA58","30Rnd_556x45_Stanag","30Rnd_556x45_G36","30Rnd_556x45_Stanag","30Rnd_556x45_G36","30Rnd_556x45_Stanag";
        _militiaAmmoCount = 10;
        _militiaGear = ["ItemBandage"]; // Additional gear (does not include tools or guns)
        _militiaWeapons = ["ItemMatchbox"]; //Additional Guns and Tools
 
if needed i can upload the entire pbo..but everything ive done makes no difference so far..one island dont respawn and the other insta respawn lol///me eyes aye burning
 
Random guns for each class

EDIT

Look at my post above dodge
So yeah, do that random i showed you, and use it to replace _sniperRifle and _sniperAmmo and then do the same for gunner and militia..

Code:
_sniperSkin = "BAF_Soldier_MTP"
_rndWeapon = floor(random 3);
switch (_rndWeapon) do {
  case 0: {_sniperRifle="M24";_sniperAmmo="5Rnd_762x51_M24";};
  case 1: {_sniperRifle="SVD_CAMO";_sniperAmmo="10Rnd_762x54_SVD";};
  case 2: {_sniperRifle="DMR";_sniperAmmo="20Rnd_762x51_DMR";};
  case 3: {_sniperRifle="M40A3";_sniperAmmo="5Rnd_762x51_M24";};
};
_sniperAmmoCount = 10;
_sniperGear = ["ItemBandage"];
_sniperWeapons = ["ItemMatchbox"];
_gunnerSkin = "BAF_Soldier_MTP";
_rndWeapon = floor(random 3);
switch (_rndWeapon) do {
  case 0: {_gunnerRifle="M24";_gunnerAmmo="5Rnd_762x51_M24";};
  case 1: {_gunnerRifle="SVD_CAMO";_gunnerAmmo="10Rnd_762x54_SVD";};
  case 2: {_gunnerRifle="DMR";_gunnerAmmo="20Rnd_762x51_DMR";};
  case 3: {_gunnerRifle="M40A3";_gunnerAmmo="5Rnd_762x51_M24";};
};
_gunnerAmmoCount = 6;
_gunnerGear = ["ItemBandage"];
_gunnerWeapons = ["ItemMatchbox"];
_militiaSkin = "BAF_Soldier_L_MTP";
_rndWeapon = floor(random 3);
switch (_rndWeapon) do {
  case 0: {_militiaRifle="M24";_militiaAmmo="5Rnd_762x51_M24";};
  case 1: {_militiaRifle="SVD_CAMO";_militiaAmmo="10Rnd_762x54_SVD";};
  case 2: {_militiaRifle="DMR";_militiaAmmo="20Rnd_762x51_DMR";};
  case 3: {_militiaRifle="M40A3";_militiaAmmo="5Rnd_762x51_M24";};
};
_militiaAmmoCount = 10;
_militiaGear = ["ItemBandage"]; // Additional gear (does not include tools or guns)
_militiaWeapons = ["ItemMatchbox"]; //Additional Guns and Tools
 
if needed i can upload the entire pbo..but everything ive done makes no difference so far..one island dont respawn and the other insta respawn lol///me eyes aye burning
add those diag_logs i told you to add and then upload your rpt.
 
Wow this is awesome stuff thanks very much. I am also wondering if someone can help me get code that will add a passanger chopper that will fly between the airports, or a Humvee that travels around major citys refueling that players can ride that works with this?
 
Hey Sycosis, one of my friends explained the gear sets to me. So I understand now. Thank you. Have you figured out a way to control the AI's with commands or if they can kill players with a certain Humanity level? Thank you
 
Hey Sycosis, one of my friends explained the gear sets to me. So I understand now. Thank you. Have you figured out a way to control the AI's with commands or if they can kill players with a certain Humanity level? Thank you
I had a script that would kill bandits, but it would pretty heavy on my server. I can find it and give it to you, but my server wouldn't run properly with it. As for commands, I think Axeman has something like that. I never figured it out.
 
Back
Top