Jump to content

Having Trouble Treating AI Like Civilians


havok

Recommended Posts

So I am editing this script in order to make some of the missions spawn AI that actually takes away humanity when you kill them.  When the mission is called, I gather whether the mission is major or minor and toss it into an array with the mission name.  Then, if the mission is one of those listed in my 'civillian missions' array, it sets the units to bandit or not like so:
 
 

//havok edit: set the unit to be a bandit
    if (DZMSMajMission select 0) then { //Need the combination of mission size and name to determine whether the AI are bad guys or not
        _unit setVariable["abandit", true];
        _mission = DZMSMajMission select 1;
        {
            diag_log format [_x];
            diag_log format [DZMSMajMission select 1];
            if (_mission == _x) then {
                _unit setVariable["abandit", false];
            };
            
        } foreach [ DZMSMajCivMissions ];
    } else {
        _unit setVariable["abandit", true];
        _mission = DZMSMinMission select 1;
        {
            if (_mission == _x) then {
                _unit setVariable["abandit", false];
            };
        } foreach [ DZMSMinCivMissions ];
    };
    //End havok edit

I am looping the arrays at the moment because I was troubleshooting another issue, but that is neither here nor there.  Everything seems to be working up to this point.
 
Anyway, once the AI is killed, I have the following going on:

//havok var for non bandits
    _banditdied = _unit getvariable ["abandit",0];
    
    //If the player gets humanity per config, lets give it
    if (DZMSMissHumanity) then {
        // havok edit: not so fast, there are farmers, you know!
            if (_banditdied) then {
                _player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];
            } else {
                _player setVariable ["humanity",_humanity-1000,true];
            };
        //end havok edit
    };

The AI spawns just fine, but when they are killed, humanity is not affected.  As for the RPT, I get the following:

6:02:38 "[DZMS]: Running Major Mission SM7."
 6:02:38 Warning Message: No entry 'bin\config.bin/CfgMagazines.M4A1_RCO_GL'.
 6:02:38 Warning Message: No entry '.picture'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.scope'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: Error: creating magazine M4A1_RCO_GL with scope=private
 6:02:38 Warning Message: No entry '.displayName'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.displayNameShort'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.nameSound'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.Library'.
 6:02:38 Warning Message: No entry '.libTextDesc'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.type'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.count'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.maxLeadSpeed'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.initSpeed'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.reloadAction'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.modelSpecial'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.ammo'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry 'bin\config.bin/CfgMagazines.M16A4_ACG_GL'.
 6:02:38 Warning Message: No entry '.picture'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.scope'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: Error: creating magazine M16A4_ACG_GL with scope=private
 6:02:38 Warning Message: No entry '.displayName'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.displayNameShort'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.nameSound'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.Library'.
 6:02:38 Warning Message: No entry '.libTextDesc'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.type'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.count'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.maxLeadSpeed'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.initSpeed'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.reloadAction'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.modelSpecial'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.ammo'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 ""
 6:02:38 "SM7"
 6:02:38 Error in expression <[DZMSMajMission select 1];
if (_mission == _x) then {
_unit setVariable["abandit>
 6:02:38   Error position: <== _x) then {
_unit setVariable["abandit>
 6:02:38   Error ==: Type Array, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location
 6:02:38 File z\addons\dayz_server\EMS\Scripts\DZMSAISpawn.sqf, line 44
 6:02:38 Warning Message: No entry 'bin\config.bin/CfgMagazines.M4A1_RCO_GL'.
 6:02:38 Warning Message: No entry '.picture'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.scope'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: Error: creating magazine M4A1_RCO_GL with scope=private
 6:02:38 Warning Message: No entry '.displayName'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.displayNameShort'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.nameSound'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.Library'.
 6:02:38 Warning Message: No entry '.libTextDesc'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.type'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.count'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.maxLeadSpeed'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.initSpeed'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.reloadAction'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.modelSpecial'.
 6:02:38 Warning Message: '/' is not a value
 6:02:38 Warning Message: No entry '.ammo'.
 6:02:38 Warning Message: '/' is not a value
 6:02:43 ""
 6:02:43 "SM7"
 6:02:43 Error in expression <[DZMSMajMission select 1];
if (_mission == _x) then {
_unit setVariable["abandit>
 6:02:43   Error position: <== _x) then {
_unit setVariable["abandit>
 6:02:43   Error ==: Type Array, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location
 6:02:43 File z\addons\dayz_server\EMS\Scripts\DZMSAISpawn.sqf, line 44
 6:02:48 ""
 6:02:48 "SM7"
 6:02:48 Error in expression <[DZMSMajMission select 1];
if (_mission == _x) then {
_unit setVariable["abandit>
 6:02:48   Error position: <== _x) then {
_unit setVariable["abandit>
 6:02:48   Error ==: Type Array, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location
 6:02:48 File z\addons\dayz_server\EMS\Scripts\DZMSAISpawn.sqf, line 44
 6:02:53 ""
 6:02:53 "SM7"
 6:02:53 Error in expression <[DZMSMajMission select 1];
if (_mission == _x) then {
_unit setVariable["abandit>
 6:02:53   Error position: <== _x) then {
_unit setVariable["abandit>
 6:02:53   Error ==: Type Array, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location
 6:02:53 File z\addons\dayz_server\EMS\Scripts\DZMSAISpawn.sqf, line 44
 6:04:04 "CLEANUP: Deleted 13 Loot Piles out of 24"
 6:05:43 "12 Active ground units"
 6:05:43 "0 Active emplacement units"
 6:05:43 "0 Active chopper patrol units (Crew)"
 6:05:43 "0 Active vehicle patrol units (Crew)"

Any ideas as to where I am going wrong here?

Link to comment
Share on other sites

6:02:38 Warning Message: No entry 'bin\config.bin/CfgMagazines.M16A4_ACG_GL'.

 6:02:38 Warning Message: No entry '.picture'.

should be cfgWeapons

I haven't changed any lines with that in it, but i will check to see what's up.

 

and are you sure it should be "abandit" and not "bandit" ?

 

Pretty sure, but i will check through the code for consistency.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...