Jump to content

[Release] Wicked AI 2.2.3 [1.0.6+]


JasonTM

Recommended Posts

i have this error:

Spoiler

12:02:49 "WAI: AI Monitor Started"
12:02:49 Error in expression <aigear select 0;
_geartools         = _aigear select 1;

call {
if(_skin == "random") >
12:02:49   Error position: <select 1;

call {
if(_skin == "random") >
12:02:49   Error Divisor cero
12:02:49 File z\addons\dayz_server\WAI\compile\spawn_group.sqf, line 91

 

this line 91:

90.        _gearmagazines     = _aigear select 0;
91.        _geartools         = _aigear select 1;

 

 

Link to comment
Share on other sites

@S4M

I bet this error occurs when a mission is spawning, isn't it? Do you have the newest files because there isn't an error like that in my rpt although I am using this system everday.
Also I want to know if you edited any files of WAI and whether you also got errors in client rpt.

Link to comment
Share on other sites

hi all, Because the bandits do not attack me with -10000 humanity ?

This is supposed to be okay, right?

Spoiler

        ai_friendly_behaviour        = false;        // make ai friendly towards comrades

        player_bandit                = -5000;        // this is the amount you declare someone to be a bandit on your server, bandit AI  will not attack you if ai_friendly_behaviour is true
        player_hero                    = 5000;            // this is the amount you declare someone to be a hero on your server, hero AI will not attack you if ai_friendly_behaviour is true

 

Link to comment
Share on other sites

  • 2 weeks later...

Does anyone know if it is possible to call a mission specifically? Using another script like Juandayz's epoch admin events or infistars tools for example

 

 I have a large custom AI base but ideally don't want it active all the time. If it could be set up as an admin spawned mission it would be perfect. 

Link to comment
Share on other sites

27 minutes ago, kheldar125 said:

Does anyone know if it is possible to call a mission specifically? Using another script like Juandayz's epoch admin events or infistars tools for example

 

 I have a large custom AI base but ideally don't want it active all the time. If it could be set up as an admin spawned mission it would be perfect. 

This would be quite hard work to make this possible. The WAI mission system is split up in functions that do all the tasks. As Juans admin event script spawns mission via scroll menu you need an own script to spawn this custom mission. Doesn't mean that this is not possible but would take some time to make it all working with all the functions and tasks.

Link to comment
Share on other sites

8 hours ago, kheldar125 said:

Does anyone know if it is possible to call a mission specifically? Using another script like Juandayz's epoch admin events or infistars tools for example

 

 I have a large custom AI base but ideally don't want it active all the time. If it could be set up as an admin spawned mission it would be perfect. 

This is how i'm doing it serverside via infistar:

_mtype = _array select 2;
_mname = _array select 3;
if (_mtype == "hero" || {_mtype == "bandit"}) then {
  wai_mission_markers set [(count wai_mission_markers), format ["Main%1%2",_mtype,count(wai_mission_data)]];
  wai_mission_data = wai_mission_data + [[0,"",[],[0,0,0]]];
  execVM format ["\z\addons\dayz_server\WAI\missions\%1\%2.sqf",_mtype,_mname];
};

This will not work straight out of the box but will give you an idea

Link to comment
Share on other sites

5 hours ago, Ghostman said:

Hey. Guys how to add a bot counter in missions?

Depends on the method how you want to display it?
Tell us your idea. Do you want to draw a number in the left upper corner when you are in 1km distance to the mission? Or do you want to display it in the debug monitor? To add that you first have to tell us how you want it :)

Edit: In any case you have to make a client function for that as the mission systems are server sided only except DZAI.

Link to comment
Share on other sites

2 hours ago, DAmNRelentless said:

@Ghostman

Okay then the client side function is not necessary. That's only an addon to the map marker. This is a bit difficult, make sure you follow each step!

Go to WAI\compile\mission_init.sqf and add _missionData and _aiCount to the private Variable array so it looks like:


private ["_mines","_difficulty","_mission","_type","_color","_dot","_position","_marker","_name","_show_marker","_missionData","_aiCount"];

After that define the variables like this:


	_missionData = (wai_mission_data select _mission);
	_aiCount	= format ["(AI left: %1)",(_missionData select 0)];

Do that underneath the definition of the other variables so it looks like:


	_mission	= _this select 0;
	_position 	= _this select 1;
	_difficulty = _this select 2;
	_name		= _this select 3;
	_type		= _this select 4;
	_mines		= _this select 5;
	_missionData = (wai_mission_data select _mission);
	_aiCount	= format ["(AI left: %1)",(_missionData select 0)];
	if(count _this > 6) then {
		_show_marker = _this select 6;
	} else {
		_show_marker = true;
	};

Now seach this line:


_marker 		= createMarker [_type + str(_mission), _position];

and replace it with:


_marker 		= createMarker [_type + str(_mission) + str(_aiCount), _position];

Now search this line:


_dot 			= createMarker [_type + str(_mission) + "dot", _position];

And replace it with:


_dot 			= createMarker [_type + str(_mission) + str(_aiCount) + "dot", _position];

 

This should be it, you are done. If you have any question, let me know.

12:44:37   Error Undefined variable in expression: _aicount
12:44:37 File z\addons\dayz_server\WAI\compile\mission_init.sqf, line 67
12:44:38 Error in expression <eateMarker [_type + str(_mission) + str(_aiCount), _position];
_marker         setMark>

Link to comment
Share on other sites

2 minutes ago, DAmNRelentless said:

Oh yeah, you are right. That is already a string so the line has to be


_marker 		= createMarker [_type + str(_mission) + _aiCount, _position];

If that doesn't help then you forgot to add


_aiCount	= format ["(AI left: %1)",(_missionData select 0)];

 

can i send you my mission_init because i don't  know where add it:(

Link to comment
Share on other sites

25 minutes ago, DAmNRelentless said:

Yeah, send me a pm. I try to help asap.

Here you have normal msg i dont know how can use pm

 

if(isServer) then {
    
    private ["_mines","_difficulty","_mission","_type","_color","_dot","_position","_marker","_name","_show_marker","_missionData","_aiCount"];

    _mission    = _this select 0;
    _position     = _this select 1;
    _difficulty = _this select 2;
    _name        = _this select 3;
    _type        = _this select 4;
    _mines        = _this select 5;
    _missionData = (wai_mission_data select _mission);
    _aiCount    = format ["(AI left: %1)",(_missionData select 0)];
    if(count _this > 6) then {
        _show_marker = _this select 6;
    } else {
        _show_marker = true;
    };
    
    if(debug_mode) then { diag_log("WAI: Starting Mission number " + str(_mission)); };
    wai_mission_data select _mission set [1, _type];
    wai_mission_data select _mission set [3, _position];
    
    if(wai_enable_minefield && _mines) then {
        call {
            if(_difficulty == "easy")         exitWith {_mines = [_position,20,37,20] call minefield;};
            if(_difficulty == "medium")     exitWith {_mines = [_position,35,52,50] call minefield;};
            if(_difficulty == "hard")         exitWith {_mines = [_position,50,75,100] call minefield;};
            if(_difficulty == "extreme")     exitWith {_mines = [_position,60,90,150] call minefield;};
        };
        wai_mission_data select _mission set [2, _mines];
    };
    
    _marker     = "";
    _dot         = "";
    _color        = "";
    
    call {
        if(_difficulty == "easy")        exitWith {_color = "ColorGreen"};
        if(_difficulty == "medium")        exitWith {_color = "ColorYellow"};
        if(_difficulty == "hard")        exitWith {_color = "ColorRed"};
        if(_difficulty == "extreme")     exitWith {_color = "ColorBlack"};
        _color = _difficulty;
    };
    
    call {
        if(_type == "mainhero")        exitWith { _name = "[Bandits] " + _name; };
        if(_type == "mainbandit")    exitWith { _name = "[Heroes] " + _name; };
        if(_type == "special")        exitWith { _name = "[Special] " + _name; };
    };
    
    if(_show_marker) then {

        [_position, _color, _name, _mission] spawn {

            private["_position","_color","_name","_running","_mission","_type","_marker","_dot"];

            _position    = _this select 0;
            _color         = _this select 1;
            _name         = _this select 2;
            _mission     = _this select 3;
            _running     = true;
            
            while {_running} do {

                _type    = (wai_mission_data select _mission) select 1;
                
                _marker         = createMarker [_type + str(_mission) + str(_aiCount), _position];
                _marker         setMarkerColor _color;
                _marker         setMarkerShape "ELLIPSE";
                _marker         setMarkerBrush "Solid";
                _marker         setMarkerSize [300,300];
                _marker         setMarkerText _name;

                _dot             = createMarker [_type + str(_mission) + str(_aiCount) + "dot", _position];
                _dot             setMarkerColor "ColorBlack";
                _dot             setMarkerType "mil_dot";
                _dot             setMarkerText _name;

                sleep 1;

                deleteMarker     _marker;
                deleteMarker     _dot;

                _running = (typeName (wai_mission_data select _mission) == "ARRAY");

            };
        };
    
    };

    if(debug_mode) then { diag_log("WAI: Mission Data: " + str(wai_mission_data)); };
    
};

Link to comment
Share on other sites

Okay this is more difficult than I thought because the units number is not stored in any variable. You would have to add the unit number yourself to each array in each mission where the function mission_init is called.

Let's take the abandoned_trader.sqf, there's a line like this:

[_mission,_position,"Medium","Abandoned Trader","MainBandit",true] call mission_init;

This line calls the mission_init function with all the arguments given in the array. To add the unit number that has to be sent to the mission_init aswell you would have to add it to this array. So in this example mission there are 9 AIs spawned which you can see here:

	//Troops
	[[_position select 0,_position select 1,0],3,"Medium",["Random","AT"],4,"Random","Hero","Random","Hero",_mission] call spawn_group;
	[[_position select 0,_position select 1,0],3,"Medium","Random",4,"Random","Hero","Random","Hero",_mission] call spawn_group;
	[[_position select 0,_position select 1,0],3,"Medium","Random",4,"Random","Hero","Random","Hero",_mission] call spawn_group;

3+3+3=9 The number of the units is written as the second element in each array.

To send this number to mission_init function, you have to add this number to the array so change the first mentioned line to this:

[_mission,_position,"Medium","Abandoned Trader","MainBandit",true,9] call mission_init;

Now you see, I added a 9 to the array.
Now in the function that is called which is the mission_init you have to change some more lines. This is the mission_init.sqf.

At the top add _aiCount to the private variable array so it looks like:

private ["_mines","_difficulty","_mission","_type","_color","_dot","_position","_marker","_name","_show_marker","_aiCount"];

After that you have to define this variable like this:

_aiCount	= _this select 6;

And now to use that variable in the map marker name you have to change this line

_marker 		= createMarker [_type + str(_mission), _position];

to

_marker 		= createMarker ["" + _type + str(_mission) + " (AI left: " + str(_aiCount) + ")", _position];

I think you could also do that with a format text but I have no time to take a deeper look into that. Also this method could cause some problems if the _this count is higher than 6 because there is another variable that is defined by _this select 6.

Link to comment
Share on other sites

33 minutes ago, DAmNRelentless said:

Okay this is more difficult than I thought because the units number is not stored in any variable. You would have to add the unit number yourself to each array in each mission where the function mission_init is called.

Let's take the abandoned_trader.sqf, there's a line like this:


[_mission,_position,"Medium","Abandoned Trader","MainBandit",true] call mission_init;

This line calls the mission_init function with all the arguments given in the array. To add the unit number that has to be sent to the mission_init aswell you would have to add it to this array. So in this example mission there are 9 AIs spawned which you can see here:


	//Troops
	[[_position select 0,_position select 1,0],3,"Medium",["Random","AT"],4,"Random","Hero","Random","Hero",_mission] call spawn_group;
	[[_position select 0,_position select 1,0],3,"Medium","Random",4,"Random","Hero","Random","Hero",_mission] call spawn_group;
	[[_position select 0,_position select 1,0],3,"Medium","Random",4,"Random","Hero","Random","Hero",_mission] call spawn_group;

3+3+3=9 The number of the units is written as the second element in each array.

To send this number to mission_init function, you have to add this number to the array so change the first mentioned line to this:


[_mission,_position,"Medium","Abandoned Trader","MainBandit",true,9] call mission_init;

Now you see, I added a 9 to the array.
Now in the function that is called which is the mission_init you have to change some more lines. This is the mission_init.sqf.

At the top add _aiCount to the private variable array so it looks like:


private ["_mines","_difficulty","_mission","_type","_color","_dot","_position","_marker","_name","_show_marker","_aiCount"];

After that you have to define this variable like this:


_aiCount	= _this select 6;

And now to use that variable in the map marker name you have to change this line


_marker 		= createMarker [_type + str(_mission), _position];

to


_marker 		= createMarker ["" + _type + str(_mission) + " (AI left: " + str(_aiCount) + ")", _position];

I think you could also do that with a format text but I have no time to take a deeper look into that. Also this method could cause some problems if the _this count is higher than 6 because there is another variable that is defined by _this select 6.

new error :(

4:34:40 Error in expression < { _name = "[Special] " + _name; };
};

 
if(_show_marker) then {

 
[_position, _co>
14:34:40   Error position: <if(_show_marker) then {

 
[_position, _co>
14:34:40   Error if: Type Number, expected Bool
14:34:40 File z\addons\dayz_server\WAI\compile\mission_init.sqf, line 50
Link to comment
Share on other sites

5 minutes ago, Ghostman said:

new error :(


4:34:40 Error in expression < { _name = "[Special] " + _name; };

};


 

if(_show_marker) then {


 

[_position, _co>

14:34:40   Error position: <if(_show_marker) then {


 

[_position, _co>

14:34:40   Error if: Type Number, expected Bool

14:34:40 File z\addons\dayz_server\WAI\compile\mission_init.sqf, line 50

This is not a line I said to edit, you probably messed up something. Send me your mission_init.sqf and the mission you edited so I can take a look at that and please use spoilers on the forum. Simply click on the eye icon when you write a message to prevent huge posts.

Link to comment
Share on other sites

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