Jump to content

[Release] Wicked AI 2.2.0


f3cuk

Recommended Posts

i had the loot boxes spawn in the air in another script i was using, seems that if you have a loot box with more than 3 bc in it the antihack puts it into the air, you change a part of the AH.sqf script

 

just search for _cfid >=

 

if (_cfid >= 3) then            <<<<< Change the number here to exceed the number of briefs that are in your boxes

 

i changed the 3 to 10

 

try that

Link to comment
Share on other sites

i had the loot boxes spawn in the air in another script i was using, seems that if you have a loot box with more than 3 bc in it the antihack puts it into the air, you change a part of the AH.sqf script

 

just search for _cfid >=

 

if (_cfid >= 3) then            <<<<< Change the number here to exceed the number of briefs that are in your boxes

 

i changed the 3 to 10

 

try that

Thanks for that i will try that and see if the players have trouble with the lootboxes again.

When i think of it , it is probably this because it only happens to missions i put briefcases in like the mayors mansion and the president mission .

 

Thanks again

Link to comment
Share on other sites

sounds great. :)

I also had to remove the new WAI system because of low fps with a medium-high population. So, will try your version when I get back from holiday.

 

Couple of quick questions; what is your player population when running your version of WAI and getting low 30's fps? Also, how many Ai are on the server when you get that reading?

 

Are you going to start a new thread?

 

Thanks

I ran this on a low population, VPS server. AI count is kinda high, probably close to 100 most of the time, 200 if they were doing Sector B. I use a stripped version of WAI 1.7.9 for Sector B that waits until players are within 4000 meters before the AI spawn. Because of the low population, we could get away with it.

I am not going to start a new thread or act like I wrote any of this. I just pieced together stuff from many many other people who have worked on WAI from way back when until now. I wish I could give credit where it was due but I can't remember where or when i found some of this stuff.

 

Edited by Phail
Link to comment
Share on other sites

Hi, i recently installed a overpochins server on taviana, and i noticed that almost everytime missions are spawning on mountains?

 

How can i change that? For missions not to spawn high on mountains?

 

Cheers! :)

Try this in config.sqf

blacklist                    = [
            [[11900,16300,0],[14200,17300,0]],
            [[13100,15500,0],[14200,16400,0]],
            [[13600,14500,0],[14500,15600,0]],
            [[14000,12800,0],[15100,14600,0]],
            [[11000,12000,0],[12200,14400,0]],
            [[12100,8100,0],[14200,12100,0]],
            [[16900,8400,0],[18100,11700,0]],
            [[4400,6600,0],[6700,8100,0]],
            [[5600,6100,0],[7500,6600,0]],
            [[6400,5500,0],[7700,6200,0]],
            [[10400,1300,0],[10900,2000,0]],
            [[8500,15800.0],[9700,19000,0]],
            [[14000,13000,0],[15000,15000,0]],
            [[6400,5600,0],[7300,7200,0]],
            [[6000,6300,0],[7300,7300,0]],
            [[21000,17200,0],[25000,21000,0]]
        ];

and this in config.sqf

        wai_avoid_missions          = 2500;                                // avoid spawning missions this close to other missions, these are defined in wai_mission_markers
        wai_avoid_traders            = 300;                                // avoid spawning missions this close to traders

 

Then in @DayZ_Epoch_Server\addons\dayz_server\WAI\compile\find_position.sqf   change this

 

if(use_blacklist) then {
        _safepos        = [getMarkerPos "center",0,9500,(_this select 0),0,0.5,0,blacklist];
    } else {
        _safepos        = [getMarkerPos "center",0,9500,(_this select 0),0,0.5,0];
    };

 

to this

 

if(use_blacklist) then {
        _safepos        = [getMarkerPos "center",0,15000,(_this select 0),0,0.5,0,blacklist];
    } else {
        _safepos        = [getMarkerPos "center",0,15000,(_this select 0),0,0.5,0];
    };

 

It is working much better for me on Taviana this way.

 

Link to comment
Share on other sites

Try this in config.sqf

blacklist                    = [
            [[11900,16300,0],[14200,17300,0]],
            [[13100,15500,0],[14200,16400,0]],
            [[13600,14500,0],[14500,15600,0]],
            [[14000,12800,0],[15100,14600,0]],
            [[11000,12000,0],[12200,14400,0]],
            [[12100,8100,0],[14200,12100,0]],
            [[16900,8400,0],[18100,11700,0]],
            [[4400,6600,0],[6700,8100,0]],
            [[5600,6100,0],[7500,6600,0]],
            [[6400,5500,0],[7700,6200,0]],
            [[10400,1300,0],[10900,2000,0]],
            [[8500,15800.0],[9700,19000,0]],
            [[14000,13000,0],[15000,15000,0]],
            [[6400,5600,0],[7300,7200,0]],
            [[6000,6300,0],[7300,7300,0]],
            [[21000,17200,0],[25000,21000,0]]
        ];

and this in config.sqf

        wai_avoid_missions          = 2500;                                // avoid spawning missions this close to other missions, these are defined in wai_mission_markers
        wai_avoid_traders            = 300;                                // avoid spawning missions this close to traders

 

Then in @DayZ_Epoch_Server\addons\dayz_server\WAI\compile\find_position.sqf   change this

 

if(use_blacklist) then {
        _safepos        = [getMarkerPos "center",0,9500,(_this select 0),0,0.5,0,blacklist];
    } else {
        _safepos        = [getMarkerPos "center",0,9500,(_this select 0),0,0.5,0];
    };

 

to this

 

if(use_blacklist) then {
        _safepos        = [getMarkerPos "center",0,15000,(_this select 0),0,0.5,0,blacklist];
    } else {
        _safepos        = [getMarkerPos "center",0,15000,(_this select 0),0,0.5,0];
    };

 

It is working much better for me on Taviana this way.

 

Thanks for that, i haven`t had time to make that adjustments that were first proposed, so i`ll give this a try.

Those coords are the  just the mountains that are blacklisted? Also i have DZMS and DZAI installed, so just need to make sure that this blacklisted coords wont affect those in any way?

Anyhow, BIg thanks for your effort to share this :D 

Link to comment
Share on other sites

I just looked in the config file for wai I didn't see anything or don't know what it would be titled, how do you change from 2 missions spawning at once to say 3?  I might be running an outdated version as well.

 

after reading the change log, I guess the option is there to run more. the version I have must be out of date. I'll try this one on my test server tonight. 

 

thanks 

Edited by sampson42002
Link to comment
Share on other sites

Try this in config.sqf

blacklist                    = [
            [[11900,16300,0],[14200,17300,0]],
            [[13100,15500,0],[14200,16400,0]],
            [[13600,14500,0],[14500,15600,0]],
            [[14000,12800,0],[15100,14600,0]],
            [[11000,12000,0],[12200,14400,0]],
            [[12100,8100,0],[14200,12100,0]],
            [[16900,8400,0],[18100,11700,0]],
            [[4400,6600,0],[6700,8100,0]],
            [[5600,6100,0],[7500,6600,0]],
            [[6400,5500,0],[7700,6200,0]],
            [[10400,1300,0],[10900,2000,0]],
            [[8500,15800.0],[9700,19000,0]],
            [[14000,13000,0],[15000,15000,0]],
            [[6400,5600,0],[7300,7200,0]],
            [[6000,6300,0],[7300,7300,0]],
            [[21000,17200,0],[25000,21000,0]]
        ];

and this in config.sqf

        wai_avoid_missions          = 2500;                                // avoid spawning missions this close to other missions, these are defined in wai_mission_markers
        wai_avoid_traders            = 300;                                // avoid spawning missions this close to traders

 

Then in @DayZ_Epoch_Server\addons\dayz_server\WAI\compile\find_position.sqf   change this

 

if(use_blacklist) then {
        _safepos        = [getMarkerPos "center",0,9500,(_this select 0),0,0.5,0,blacklist];
    } else {
        _safepos        = [getMarkerPos "center",0,9500,(_this select 0),0,0.5,0];
    };

 

to this

 

if(use_blacklist) then {
        _safepos        = [getMarkerPos "center",0,15000,(_this select 0),0,0.5,0,blacklist];
    } else {
        _safepos        = [getMarkerPos "center",0,15000,(_this select 0),0,0.5,0];
    };

 

It is working much better for me on Taviana this way.

 

So i done as u said, and still they are spawning on mountains :(, i double checked that i maybe didn`t done something right, but as i see nothing wrong, but they keep spawning on mountains.

Link to comment
Share on other sites

So i done as u said, and still they are spawning on mountains :(, i double checked that i maybe didn`t done something right, but as i see nothing wrong, but they keep spawning on mountains.

 

In every mission replace this

_position        = [30] call find_position;                 or whatever is there   

with this

_position        = [10] call find_position;

 

That will make it so that the nearest object can be 10 meters away.

 

If they still spawn on mountains ALL the time IDK what is wrong, mine spawn there sometimes, not very often like before.

 

Edited by Phail
Link to comment
Share on other sites

Trying to get random coin's to spawn on dead AI.  This was working before I deleted everything to add the WAI 2.2.0.  I saw what ARC_solo  said and tried doing that but still the dead AI are not spawning with coins.  Here is the area of my spawn_group.sqf

if (isNil "_mission") then {


        
            _unit enableAI "TARGET";
            _unit enableAI "AUTOTARGET";
            _unit enableAI "MOVE";
            _unit enableAI "ANIM";
            _unit enableAI "FSM";
                        _cash = round(random 5) * 100;
                        _unit setVariable["headShots",_cash,false];
        
        };

 

Here is the spawn_static.sqf

 

_unit enableAI "TARGET";
        _unit enableAI "AUTOTARGET";
        _unit enableAI "MOVE";
        _unit enableAI "ANIM";
        _unit enableAI "FSM";
                _cash = round(random 5) * 100;
                _unit setVariable["headShots",_cash,false];
        
        removeAllWeapons _unit;
        removeAllItems _unit;

 

Also if I wanted 0 - 5000 coins to randomly be on the dead ai would it be _cash = round(random 5) * 1000; ?  Also this line _unit setVariable["headShots",_cash,false]; I did have set to true and it did not work.  I changed it to false thinking maybe that being true only allows random coins to spawn if the AI was killed by headshot only.

 

 

Edited by sampson42002
Link to comment
Share on other sites

 

I have make it another way then Hux.

 

I have changed my "compile/find_position.sqf"

 

Search:

markerready = false;

Add below:

if(wai_static_mission_locs) exitWith {
  _position = wai_mission_locations call BIS_fnc_selectRandom;
  _position set [2, 0];
  _position
};

And open "config.sqf"

Search for:

/* STATIC MISSIONS CONFIG */

Add before:

wai_static_mission_locs  = true;
wai_mission_locations  = [
  [856.919,9370.11,0.001],[3468.97,9430.79,0.001],[4721.69,1951.64,0.001],
  [8586.69,7174.76,0.001],[869.732,5158.03,0.001]
];

in the wai_mission_locations array you can add as many locations you want.

 

Greets

Rotzloch

Hi Rotzloch,

Did you make some tests with this? In my case two missions spawn, after complete each new mission spawns exactly on the same position. Looks like only the first pass is random.....

Link to comment
Share on other sites

Hi Rotzloch,

Did you make some tests with this? In my case two missions spawn, after complete each new mission spawns exactly on the same position. Looks like only the first pass is random.....

Yes this was on our live server.

But i had a very long list of locations, and save the last 4 positions, so at these last 4 positions no mission spawns.

Link to comment
Share on other sites

Hi Guys,

Hi Rotzloch,

Since I've installed Rotzloch's method for configure manual spawn locations for missions, no new mission spawns. The locations changed perfect. If no one clears the mission, they despawn. But when a player clears a mission no new missions spawn.

Has someone an idea?

many thx in advance

Link to comment
Share on other sites

Hi Guys,

Hi Rotzloch,

Since I've installed Rotzloch's method for configure manual spawn locations for missions, no new mission spawns. The locations changed perfect. If no one clears the mission, they despawn. But when a player clears a mission no new missions spawn.

Has someone an idea?

many thx in advance

Can you post your "compile/find_position.sqf"?

Link to comment
Share on other sites

if(isServer) then {
    
    private ["_i","_traders","_safepos","_validspot","_position"];

    markerready = false;
    
    if(wai_static_mission_locs) exitWith {
        _position = wai_mission_locations call BIS_fnc_selectRandom;
        _position set [2, 0];
        _position
    };

    if(use_blacklist) then {
        _safepos        = [getMarkerPos "center",0,8500,(_this select 0),0,0.5,0,blacklist];
    } else {
        _safepos        = [getMarkerPos "center",0,8500,(_this select 0),0,0.5,0];
    };

    _validspot     = false;
    _i             = 1;

    while{!_validspot} do {
    
        sleep 1;

        _position     = _safepos call BIS_fnc_findSafePos;
        _i             = _i + 1;
        _validspot    = true;

        if (_position call inDebug) then { if(debug_mode) then {diag_log("WAI: Invalid Position (Debug)");}; _validspot = false; };

        if(_validspot && wai_avoid_water != 0) then {
            if ([_position,wai_avoid_water] call isNearWater) then { if(debug_mode) then {diag_log("WAI: Invalid Position (Water)");}; _validspot = false; };
        };

        if (_validspot && isNil "infiSTAR_LoadStatus1" && wai_avoid_town != 0) then {
            if ([_position,wai_avoid_town] call isNearTown) then {  if(debug_mode) then {diag_log("WAI: Invalid Position (Town)");}; _validspot = false; };
        }; // ELSE infoSTAR is enabled, need to find another method of finding near towns

        if(_validspot && wai_avoid_road != 0) then {
            if ([_position,wai_avoid_road] call isNearRoad) then { if(debug_mode) then {diag_log("WAI: Invalid Position (Road)");}; _validspot = false; };
        };

        if (_validspot && wai_avoid_missions != 0) then {
            if(debug_mode) then { diag_log("WAI DEBUG: FINDPOS: Checking nearby mission markers: " + str(wai_mission_markers)); };
            {
                if (getMarkerColor _x != "" && (_position distance (getMarkerPos _x) < wai_avoid_missions)) exitWith { if(debug_mode) then {diag_log("WAI: Invalid Position (Marker: " + str(_x) + ")");}; _validspot = false; };
            } count wai_mission_markers;
        };

        if (_validspot && wai_avoid_traders != 0) then {
            if(debug_mode) then { diag_log("WAI DEBUG: FINDPOS: Checking nearby trader markers: " + str(trader_markers)); };
            {
                if (getMarkerColor _x != "" && (_position distance (getMarkerPos _x) < wai_avoid_traders)) exitWith { if(debug_mode) then {diag_log("WAI: Invalid Position (Marker: " + str(_x) + ")");}; _validspot = false; };
            } count trader_markers;
        };

        if(_validspot) then {

            if(debug_mode) then { diag_log("Loop complete, valid position " +str(_position) + " in " + str(_i) + " attempts"); };
    
        };

    };
    _position set [2, 0];
    _position
};

Link to comment
Share on other sites

Only config settings and all missions scripts. Weapon Cache for example:

if(isServer) then {

    private         ["_complete","_crate_type","_mission","_position","_crate","_playerPresent","_rndnum","_rndgro","_num_guns","_num_tools","_num_items"];

    // Get mission number, important we do this early
    _mission         = count wai_mission_data -1;

    _position        = [10] call find_position;
    [_mission,_position,"Medium","Weapon Cache","MainBandit",true] call mission_init;
    
    diag_log         format["WAI: [Mission:[Bandit] Weapons Cache]: Starting... %1",_position];

    //Setup the crate
    _crate_type     = crates_small call BIS_fnc_selectRandom;
    _crate             = createVehicle [_crate_type,[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];
    
    //Troops
    _rndnum     = (1 + round(random 7));
    _rndgro     = (1 + round(random 2));
    [[_position select 0,_position select 1,0],4,"medium",0,4,"Random","Hero","Random","Hero",_mission] call spawn_group;
    [[_position select 0,_position select 1,0],4,"medium",1,4,"Random","Hero","Random","Hero",_mission] call spawn_group;
    [[_position select 0,_position select 1,0],4,"medium",2,4,"Random","Hero","Random","Hero",_mission] call spawn_group;


    //Static Guns
    [[
        [(_position select 0) + 10, (_position select 1) + 10, 0],
        [(_position select 0) + 10, (_position select 1) - 10, 0]
    ],"M2StaticMG","medium","Hero","Hero",0,2,"Random","Random",_mission] call spawn_static;

    //Condition
    _complete = [
        [_mission,_crate],    // mission number and crate
        ["crate"],             // ["crate"], or ["kill"], or ["assassinate", _unitGroup],
        [],                 // cleanup objects
        "Heroes have obtained a weapon crate. Check your map for the location!",    // mission announcement
        "Bandits have secured the weapon cache!",                                    // mission success
        "Bandits did not secure the weapon cache in time"                            // mission fail
    ] call mission_winorfail;

    if(_complete) then {
        [_crate,8,4,0,2] call dynamic_crate;
    };

    diag_log format["WAI: [Bandit] weapon_cache ended at %1",_position];
    
    b_missionsrunning = b_missionsrunning - 1;
};

Link to comment
Share on other sites

Never mind!

The problem wasn't your settings.

I've found a general issue in the code of the mission_winorfail.sqf. So now the missions runs smooth.

I also found another issue in that sqf which prevents wai to cleanup buildings after mission was complete --> Fixed.

Many thanks for your help Rotzloch and your nice addon :-)

Link to comment
Share on other sites

Never mind!

The problem wasn't your settings.

I've found a general issue in the code of the mission_winorfail.sqf. So now the missions runs smooth.

I also found another issue in that sqf which prevents wai to cleanup buildings after mission was complete --> Fixed.

Many thanks for your help Rotzloch and your nice addon :-)

Youre welcome!

Link to comment
Share on other sites

Does anyone know why there are no static mg's on my missions?

My server.rpt shows this message:
18:45:34 "WAI: [Mission:[Hero] Disabled Convoy]: Starting... [2248.69,4770.86,0]"
18:45:35 "WAI: Spawned a group of 7 AI (Bandit) at [2248.69,4770.86,0]"
18:45:35 "WAI: Spawned a group of 4 AI (Bandit) at [2248.69,4770.86,0]"
18:45:35 "WAI: Spawned a group of 4 AI (Bandit) at [2248.69,4770.86,0]"
18:45:35 "WAI: Spawned a group of 4 AI (Bandit) at [2248.69,4770.86,0]"
18:45:35 Cannot create entity with abstract type M2StaticMG (scope = private?)
18:45:35 Cannot create non-ai vehicle M2StaticMG,
18:45:35 Cannot create entity with abstract type M2StaticMG (scope = private?)
18:45:35 Cannot create non-ai vehicle M2StaticMG,
18:45:35 Cannot create entity with abstract type M2StaticMG (scope = private?)
18:45:35 Cannot create non-ai vehicle M2StaticMG,
18:45:36 "WAI: Spawned in 3 M2StaticMG"

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Advertisement
×
×
  • Create New...