Morox AI - Sycosis Simple AI mod

I am currently working on two things for this mod.
1. AI will use vehicles if they find them
2. Mission sqm converter - so you can create all your AI and waypoints in the mission editor, the converter will output a file that the mod reads and the AI will follow the exact routes, for finer control of exactly what the AI do.

If any one has any other requests let me know.
 
Thanks a bunch for the info. From my past Googling, I've heard conflicting statements about whether or not bandit kills give humanity.

Edit: I think I've found the script responsible for humanity, compile/player_death.sqf. However it doesn't seem to award humanity for bandit kills, as the code for that is commented out. So now I'm scratching my head in confusion.


I was wrong about the main file in dayz, the two spots are the damage handler for if you shoot a non-bandit and the playerdeath.sqf which contains this, which has the bandit humanity commented out so it seems you are correct humanity for bandit kills is not active. Instead + humanity comes from bandage/morphine/painkiller/transfusing another player (+20,+50,+20,+250) respectively.

Code:
if (!_canHitFree and !_isBandit) then {
//Process Morality Hit
_humanity = -(2000 - _myKills);
_kills =_source getVariable ["humanKills",0];
_source setVariable ["humanKills",(_kills + 1),true];
_wait = 300;
} else {
//Process Morality Hit
//_humanity = _myKills * 100;
_killsV =_source getVariable ["banditKills",0];
_source setVariable ["banditKills",(_killsV + 1),true];
_wait = 0;
};
 
I have played with Sarge's and it is a fantastic mod it does far more than this does, the example I gave to Sarge when he asked, was about custom loadouts per AI - which he has since added a version of outside of weapons and ammo in the current release.

The use case I think of is, Let's say you wanted an AI called John who always had the same skin, always had the same weapon and always had the same gear and should always be standing in devil's castle - almost like an RPG NPC (the begginings of a mission or info giver) - if a player killed them you would want him there withing 60 to 120 sec or whatever - Don't really have a way to do this with Sarge's AI at the moment, with this it would be quite easy.
can you show me how to give them random loadouts and custom stationary spawn?
 
Sarge's already does random weapons, I have not used it since the addition of the item loadout and the stationary spawn, he has is own thread now which covers all the aspects of his mod in detail, I think that would be a good place for you to start.
 
Hi im having an issue with the zeds, they are red dotted and they get auto targeted. ive been adjusting the set_unit_faction. so far i have this

waitUntil{initialized};
//0Day
createCenter east;
createCenter resistance;
//Survivors
WEST setFriend [RESISTANCE,.7];
WEST setFriend [EAST,.7];
//AI Units
RESISTANCE setFriend [WEST,.7];
RESISTANCE setFriend [EAST,0];
//AI Units 2
EAST setFriend [WEST,.7];
EAST setFriend [RESISTANCE,0];

Ai works great so far, looking forward to seeing zed attacking AI.

So i can get it to stop but i have to change the server difficulty to veteran, want to keep this as recruit
 
Essix,

The red dotted zeds has to do with the difficulty as you said and should not be affected by this code, I don't currently know if there is a way to customize which parts of the difficulty settings are on and off.

Onur123,

Can you post your _aispawn lines, if you set them with a radius of 1 and wpnum 1 they will stay still.
 
Code:
if (isServer) then {
    _serverMonitor =    [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
    /*
    IMPORTANT STUFF STARTS HERE:
    */
    _factions = [] execVM "scripts\set_unit_faction.sqf";
    //diag_log format["Factions executed: %1",_factions];
    //Array to pass to .sqf: [[<worldspace>],radius of waypoints (in metres),number of waypoints,number of ai units]
    spawncnt = 0;
    _aispawn = [[6689.49,2623.59,0],400,9,2,4,0,8,10,0,1400] execVM "scripts\add_unit_server.sqf";//Chernaurs
    _aispawn = [[7622.51,7912.7,0],5000,20,6,4,0,8,10,1,1400] execVM "scripts\add_unit_server.sqf";//Chernaurs (Whole map)
    _aispawn = [[7625.51,7915.7,0],5000,20,6,4,0,8,10,0,1400] execVM "scripts\add_unit_server.sqf";//Chernaurs (Whole map)
    _aispawn = [[4598.66,10197.7,0],650,12,2,4,0,8,10,0,1400] execVM "scripts\add_unit_server.sqf";//NW Airfield
    _aispawn = [[10447.5,2246.96,0],350,9,2,4,0,8,10,1,1400] execVM "scripts\add_unit_server.sqf";//Electrozavodsk
    _aispawn = [[13253.3,6406.53,0],250,4,1,4,0,8,10,1,1400] execVM "scripts\add_unit_server.sqf";//Solnichniy
    /*
    IMPORTANT STUFF ENDS HERE
    */
};
 
@Morox,
Been a little while, was away but now back and picked up where I left off which has bought me here and with a weird issue, on server restart I have ALL vehicles duplicate, has anyone had this issue?
I will make some adjustments and run some more tests but this is an interesting bug.
I have moved to a reality server, (shouldn't make too much difference) and I have put it on Ovaron.
 
@Stealth

Yes this is todo with if you have two server_monitor lines in your init.sqf.. I did the same :)
Thankyou but, Sorry mate but cant seem to find second line in there. I have been over it several times.

This is not the first time I have run the respawning NPC's, just the first time I have tried these new updated files, and I never had the issue with the original files. so guess what I am saying is, was there a bug discovered yet.:confused:
 
Stealth,
Hmm, I have not seen it, I do know the server_monitor executed twice can cause this I am not running it anywhere in my code, I will take a look and see if I can replicate the issue.

Onur123,

Are they not moving at all from the beginning or is it after a respawn? Also are you running any other mods, the only time they get stuck in one spot is if I set the radius and num to 1,1 like I mentioned before.
 
Morox,
I fixed the issue by using Sycosis's files and using some of the fixes you posted in his thread, however, lolo_O, now when the AI respawn I get them multiplying, I have been back into my init.sqf again to check for 2 server_monitor lines but all seems normal in here, Never had this issue occur on the previous server so bit puzzled:confused:.
 
I noticed the ones wich dont move are bugged and be like a ghost , it seems they are already dead :) Im running debug monitor , Auto Blood&Refuel , and AI .
 
ok ya so veteran is the only way it works for no auto target, one other thing, is it possible to add more units to a case instead of just 3 per case? and any new news on the zombie attacking AI script? hows that progressing?
 
Onur,

If it is the civilan model with the beret, yeah that is an Arma glitch that I get as well. I don't know if it is related to the mod or it has to do with the death animation of that model however.

Stealth,

Can you post your init.sqf so I can take a look, mixing Sycosis's files with my new ones would be tricky, I used his as a base but made multiple changes to fix respawning, gear retention etc.

Essix,

You mean you want more than Sniper/Gunner/Militia? Or you just want to be able to generate bigger squads?
Either is possible, adding new units to the case could get cumbersome as you would need to modify all the case statements to handle the new unit.
 
If i Add say another militia to the case i want to modify and change the loadout will it conflict with the original militia loadout or would I have to add it as say (Militia2) as the statement in that case
 
Well there are 2 different things, there is a case section for loadouts, each loadout has a case for a sniper/gunner/militia then there is the case section for unit type - if you want to add a new loadout this is very easy copy the entire case 0 or 1 section and paste it and call it case 2, then you can call it from your spawn script, if your intent is to only use this load out for a certain type of unit you can just have that section (i.e for gunner)

Code:
case 2 : {
_gunnerSkin = "BAF_Soldier_MTP";
_gunnerRifle = "Mk_48_DZ";
_gunnerAmmo = "100Rnd_762x51_M240";
_gunnerAmmoCount = 10;
_gunnerGear = ["ItemBandage"];
_gunnerWeapons = ["ItemMatchbox"];
 
};

Realize though if you use case 2 for a sniper or militia it will not work, and you would not be able to squad a group together this way.

I assume you are trying to create a "squad" of more than three different types of AI?

If you let me know what you want I can build a quick demo file for you so you can see all the spots you would have to modify to do this.
 
This is what i have so far 3 cases of AI, case2 is what i put together, but yes i would like to see if i can add maybe 1 or 2 more AI's to case2 so it makes a bigger squad that follow the same waypoints. say if i was to spawn two diffrent Ai spawns in the same area they will part ways do to random waypoints. I would like to see if i can make a bigger squad of say 5-6 Ai's in case2. If by any chance is there a way to add customary waypoints for Ai to use in the map editor by chance? ive seen the Bus script were it aparantley drives around the map picking people up, but i havent tried it. Was thinking maybe the waypoint configuration from that could somehow be implemented to be used with the AI
------------------------------------------------------------------------------------------------------------------------------
Code:
// to add more gear sets, just add another case, and copy and paste the variables from one of the other cases into it, and then reference it in the init.
if (_checkset == 0) then {
switch (_gearSet) do {
    case 0 : {
        _sniperSkin = "BAF_Soldier_Sniper_MTP";
        _sniperRifle = "M40A3";
        _sniperAmmo = "5Rnd_762x51_M24";
        _sniperAmmoCount = 3;
        _sniperGear = ["ItemBandage"];
        _sniperWeapons = ["ItemMatchbox"];
        _gunnerSkin = "BAF_Soldier_MTP";
        _gunnerRifle = "Mk_48_DZ";
        _gunnerAmmo = "100Rnd_762x51_M240";
        _gunnerAmmoCount = 3;
        _gunnerGear = ["ItemBandage"];
        _gunnerWeapons = ["ItemMatchbox"];
        _militiaSkin = "BAF_Soldier_L_MTP";
        _militiaRifle = "AKS_74_kobra";
        _militiaAmmo = "30Rnd_762x39_AK47";
        _militiaAmmoCount = 3;
        _militiaGear = ["ItemBandage"]; // Additional gear (does not include tools or guns)
        _militiaWeapons = ["ItemMatchbox"]; //Additional Guns and Tools
    };
    case 1 : {
        _sniperSkin = "Citizen3";
        _sniperRifle = "LeeEnfield";
        _sniperAmmo = "10x_303";
        _sniperAmmoCount = 3;
        _sniperGear = ["ItemBandage"];
        _sniperWeapons = ["ItemMatchbox"];
        _gunnerSkin = "Worker1";
        _gunnerRifle = "Winchester1866";
        _gunnerAmmo = "15Rnd_W1866_Slug";
        _gunnerAmmoCount = 3;
        _gunnerGear = ["ItemBandage"];
        _gunnerWeapons = ["ItemMatchbox"];
        _militiaSkin = "Villager1";
        _militiaRifle = "AK_47_M";
        _militiaAmmo = "30Rnd_762x39_AK47";
        _militiaAmmoCount = 3;
        _militiaGear = ["ItemBandage"]; // Additional gear (does not include tools or guns)
        _militiaWeapons = ["ItemMatchbox"]; //Additional Guns and Tools
    };
    case 2 : {
        _sniperSkin = "US_Soldier_EP1";
        _sniperRifle = "DMR";
        _sniperAmmo = "20Rnd_762x51_DMR";
        _sniperAmmoCount = 3;
        _sniperGear = ["ItemBandage"];
        _sniperWeapons = ["ItemMatchbox"];
        _gunnerSkin = "USMC_Soldier_MG";
        _gunnerRifle = "M249";
        _gunnerAmmo = "100Rnd_556x45_M249";
        _gunnerAmmoCount = 3;
        _gunnerGear = ["ItemBandage"];
        _gunnerWeapons = ["ItemMatchbox"];
        _militiaSkin = "US_Soldier_EP1";
        _militiaRifle = "M4A1_AIM_CAMO";
        _militiaAmmo = "30Rnd_556x45_Stanag";
        _militiaAmmoCount = 3;
        _militiaGear = ["ItemBandage"]; // Additional gear (does not include tools or guns)
        _militiaWeapons = ["ItemMatchbox"]; //Additional Guns and Tools
    };
 
Back
Top