Jump to content

[Release] Wicked AI 2.2.3 [1.0.6+]


JasonTM

Recommended Posts

1 minute ago, DAmNRelentless said:

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.

Spoiler

if(isServer) then {
    
    private ["_mines","_difficulty","_mission","_type","_color","_dot","_position","_marker","_name","_show_marker","_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;
    _aiCount    = _this select 6;
    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) + "(AI left: " + 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)); };
    
};

Spoiler

if(isServer) then {

    private         ["_complete","_crate_type","_mission","_position","_crate","_baserunover"];

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

    _position        = [30] call find_position;
    [_mission,_position,"Medium","Abandoned Trader","MainBandit",true,12] call mission_init;    
    
    diag_log         format["WAI: [Mission:[Bandit] Abandoned Trader]: Starting... %1",_position];

    //Setup the crate
    _crate_type     = crates_medium call BIS_fnc_selectRandom;
    _crate             = createVehicle [_crate_type,[(_position select 0) + 0.3,(_position select 1),0],[],0,"CAN_COLLIDE"];

    // Create some Buildings
//Buildings
_baserunover0 = createVehicle ["Land_Misc_Garb_Heap_EP1",[(_position select 0) - 0.9, (_position select 1) + 4.2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover1 = createVehicle ["Land_Misc_Garb_Heap_EP1",[(_position select 0) - 18, (_position select 1) + 1.5,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover2 = createVehicle ["Land_Shed_W03_EP1",[(_position select 0) - 4, (_position select 1) + 4.7,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover3 = createVehicle ["Land_Shed_M01_EP1", [(_position select 0) - 10, (_position select 1) + 5,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover4 = createVehicle ["Land_Market_shelter_EP1", [(_position select 0) - 10, (_position select 1) - 0.4,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover5 = createVehicle ["Land_Market_stalls_02_EP1", [(_position select 0) - 10, (_position select 1) - 5.8,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover6 = createVehicle ["Land_Market_stalls_01_EP1",[(_position select 0) + 11, (_position select 1) + 5,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover7 = createVehicle ["Land_Market_stalls_02_EP1",[(_position select 0) + 10, (_position select 1) - 5.8,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover8 = createVehicle ["Land_Market_shelter_EP1",[(_position select 0) + 10, (_position select 1) - 0.4,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover9 = createVehicle ["Land_transport_crates_EP1", [(_position select 0) + 22, (_position select 1) + 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover10 = createVehicle ["Fort_Crate_wood", [(_position select 0) + 18, (_position select 1) - 1,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover11 = createVehicle ["UralWreck", [(_position select 0) + 27, (_position select 1) - 3,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover12 = createVehicle ["Land_Canister_EP1",[(_position select 0) + 18, (_position select 1) + 1.4,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover13 = createVehicle ["MAP_ground_garbage_square5",[(_position select 0) + 13.6, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover14 = createVehicle ["MAP_ground_garbage_square5",[(_position select 0) - 16, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover15 = createVehicle ["MAP_ground_garbage_long", [(_position select 0) - 0.4, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover16 = createVehicle ["MAP_garbage_misc", [(_position select 0) - 8, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];


    // Adding buildings to one variable just for tidiness
    _baserunover = [_baserunover0,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5,_baserunover6,_baserunover7,_baserunover8,_baserunover9,_baserunover10,_baserunover11,_baserunover12,_baserunover13,_baserunover14,_baserunover15,_baserunover16];
    
    // Set some directions for our buildings
    _directions = [0,0,0,0,0,-2.5,-0.34,0,2.32,-43.88,0,-67.9033,28.73,0,0,0,0];
    { _x setDir (_directions select _forEachIndex) } forEach _baserunover;

    // Make buildings flat on terrain surface
    { _x setVectorUp surfaceNormal position _x; } count _baserunover;

    //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;

    //Static Guns
    [[
        [(_position select 0) + 0.1, (_position select 1) + 20, 0],
        [(_position select 0) + 0.1, (_position select 1) - 20, 0]
    ],"M2StaticMG","Easy","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],
        [_baserunover],     // cleanup objects
        "A trader city was abandoned after a bandit raid....Go secure the loot",    // mission announcement
        "Survivors have secured the abandoned trader",                                                                    // mission success
        "Survivors did not secure the abandoned trader in time"                                                            // mission fail
    ] call mission_winorfail;

    diag_log format["WAI: [Mission:[Bandit] Abandoned Trader]: Ended at %1",_position];

    if(_complete) then {
        [_crate,8,5,15,3,2] call dynamic_crate;
    };

    b_missionsrunning = b_missionsrunning - 1;
};

Spoiler

if(isServer) then {

    private         ["_complete","_crate_type","_mission","_position","_crate","_baserunover"];

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

    _position        = [30] call find_position;
    [_mission,_position,"Medium","Abandoned Trader","MainHero",true,12] call mission_init;    
    
    diag_log         format["WAI: [Mission:[Hero] Abandoned Trader]: Starting... %1",_position];

    //Setup the crate
    _crate_type     = crates_medium call BIS_fnc_selectRandom;
    _crate             = createVehicle [_crate_type,[(_position select 0) + 0.3,(_position select 1),0],[],0,"CAN_COLLIDE"];

    // Create some Buildings
//Buildings
_baserunover0 = createVehicle ["Land_Misc_Garb_Heap_EP1",[(_position select 0) - 0.9, (_position select 1) + 4.2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover1 = createVehicle ["Land_Misc_Garb_Heap_EP1",[(_position select 0) - 18, (_position select 1) + 1.5,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover2 = createVehicle ["Land_Shed_W03_EP1",[(_position select 0) - 4, (_position select 1) + 4.7,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover3 = createVehicle ["Land_Shed_M01_EP1", [(_position select 0) - 10, (_position select 1) + 5,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover4 = createVehicle ["Land_Market_shelter_EP1", [(_position select 0) - 10, (_position select 1) - 0.4,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover5 = createVehicle ["Land_Market_stalls_02_EP1", [(_position select 0) - 10, (_position select 1) - 5.8,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover6 = createVehicle ["Land_Market_stalls_01_EP1",[(_position select 0) + 11, (_position select 1) + 5,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover7 = createVehicle ["Land_Market_stalls_02_EP1",[(_position select 0) + 10, (_position select 1) - 5.8,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover8 = createVehicle ["Land_Market_shelter_EP1",[(_position select 0) + 10, (_position select 1) - 0.4,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover9 = createVehicle ["Land_transport_crates_EP1", [(_position select 0) + 22, (_position select 1) + 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover10 = createVehicle ["Fort_Crate_wood", [(_position select 0) + 18, (_position select 1) - 1,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover11 = createVehicle ["UralWreck", [(_position select 0) + 27, (_position select 1) - 3,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover12 = createVehicle ["Land_Canister_EP1",[(_position select 0) + 18, (_position select 1) + 1.4,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover13 = createVehicle ["MAP_ground_garbage_square5",[(_position select 0) + 13.6, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover14 = createVehicle ["MAP_ground_garbage_square5",[(_position select 0) - 16, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover15 = createVehicle ["MAP_ground_garbage_long", [(_position select 0) - 0.4, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover16 = createVehicle ["MAP_garbage_misc", [(_position select 0) - 8, (_position select 1) - 2,-0.01],[], 0, "CAN_COLLIDE"];


    // Adding buildings to one variable just for tidiness
    _baserunover = [_baserunover0,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5,_baserunover6,_baserunover7,_baserunover8,_baserunover9,_baserunover10,_baserunover11,_baserunover12,_baserunover13,_baserunover14,_baserunover15,_baserunover16];
    
    // Set some directions for our buildings
    _directions = [0,0,0,0,0,-2.5,-0.34,0,2.32,-43.88,0,-67.9033,28.73,0,0,0,0];
    { _x setDir (_directions select _forEachIndex) } forEach _baserunover;

    // Make buildings flat on terrain surface
    { _x setVectorUp surfaceNormal position _x; } count _baserunover;

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

    //Static Guns
    [[
        [(_position select 0) + 0.1, (_position select 1) + 20, 0],
        [(_position select 0) + 0.1, (_position select 1) - 20, 0]
    ],"M2StaticMG","Easy","Bandit","Bandit",0,2,"Random","Random",_mission] call spawn_static;

    //Condition
    _complete = [
        [_mission,_crate],    // mission number and crate
        ["crate"],             // ["crate"], or ["kill"], or ["assassinate", _unitGroup],
        [_baserunover],     // cleanup objects
        "A trader city was abandoned after a bandit raid....Go secure the loot",    // mission announcement
        "Survivors have secured the abandoned trader",                                                                    // mission success
        "Survivors did not secure the abandoned trader in time"                                                            // mission fail
    ] call mission_winorfail;

    diag_log format["WAI: [Mission:[Hero] Abandoned Trader]: Ended at %1",_position];

    if(_complete) then {
        [_crate,8,5,15,3,2] call dynamic_crate;
    };

    h_missionsrunning = h_missionsrunning - 1;
};

 

 

 

Link to comment
Share on other sites

Yep that's the problem I mentioned. _this is now larger than the previous one because we added another element to the array.

Go to your mission_init.sqf and change

    _mission    = _this select 0;
    _position     = _this select 1;
    _difficulty = _this select 2;
    _name        = _this select 3;
    _type        = _this select 4;
    _mines        = _this select 5;
    _aiCount    = _this select 6;
    if(count _this > 6) then {
        _show_marker = _this select 6;
    } else {
        _show_marker = true;
    };

to

    _mission    = _this select 0;
    _position     = _this select 1;
    _difficulty = _this select 2;
    _name        = _this select 3;
    _type        = _this select 4;
    _mines        = _this select 5;
    if(count _this > 7) then {
        _show_marker = _this select 6;
		_aiCount    = _this select 7;
    } else {
        _show_marker = true;
		_aiCount    = _this select 6;
    };

 

Link to comment
Share on other sites

stil error :(

15:03:52   Error position: <_aiCount) + ")", _position];
_marker 		s>
15:03:52   Error Undefined variable in expression: _aicount
15:03:52 File z\addons\dayz_server\WAI\compile\mission_init.sqf, line 67
15:03:53 Error in expression <pe + str(_mission) + "(AI left: " + str(_aiCount) + ")", _position];
_marker 		s>
Link to comment
Share on other sites

Spoiler

15:33:04 Error in expression <pe + str(_mission) + "(AI left: " + str(_aiCount) + ")", _position];
_marker         s>

15:33:04   Error position: <_aiCount) + ")", _position];
_marker         s>
15:33:04   Error Undefined variable in expression: _aicount
15:33:04 File z\addons\dayz_server\WAI\compile\mission_init.sqf, line 67
15:33:04 [DZMS]: Starting DayZ Mission System.
15:33:04 [DZMS]: WickedAI Found! Using WickedAI's Relations!
15:33:04 [DZMS]: Currently Running Version: 1.1FIN
15:33:04 [DZMS]: Mission and Extended Configuration Loaded!
15:33:04 [DZMS]: chernarus Detected. Map Specific Settings Adjusted!
15:33:04 [DZMS]: DayZ Epoch Detected! Some Scripts Adjusted!
15:33:04 [DZMS]: Loading ExecVM Functions.
15:33:04 [DZMS]: Loading Compiled Functions.
15:33:04 [DZMS]: Loading All Other Functions.
15:33:04 [DZMS]: Mission Functions Script Loaded!
15:33:05 [DZMS]: Mission Marker Loop for JIPs Starting!
15:33:05 [DZMS]: Minor Mission Clock Starting!
15:33:05 [DZMS]: Major Mission Clock Starting!
15:33:05 "WAI: Spawned a group of 3 AI (Bandit) at [8422.7,6350.48,0]"
15:33:05 "WAI: Spawned a group of 3 AI (Bandit) at [8422.7,6350.48,0]"
15:33:05 No owner
15:33:05 No owner
15:33:05 No owner
15:33:05 No owner
15:33:05 "WAI: Spawned a group of 3 AI (Bandit) at [8422.7,6350.48,0]"
15:33:05 "WAI: Spawned in 2 M2StaticMG"
15:33:05 Error in expression <pe + str(_mission) + "(AI left: " + str(_aiCount) + ")", _position];
_marker         s>
15:33:05   Error position: <_aiCount) + ")", _position];
_marker         s>
15:33:05   Error Undefined variable in expression: _aicount
15:33:05 File z\addons\dayz_server\WAI\compile\mission_init.sqf, line 67
15:33:06 Error in expression <pe + str(_mission) + "(AI left: " + str(_aiCount) + ")", _position];
_marker         s>

i'm give up. Still have error, but the for try help:)

Link to comment
Share on other sites

I guess the problem is that _aiCount is outter scope so you need to define the variable before the if condition.

so

    _mission    = _this select 0;
    _position     = _this select 1;
    _difficulty = _this select 2;
    _name        = _this select 3;
    _type        = _this select 4;
    _mines        = _this select 5;
	_aiCount	= 0;
    if(count _this > 7) then {
        _show_marker = _this select 6;
		_aiCount    = _this select 7;
    } else {
        _show_marker = true;
		_aiCount    = _this select 6;
    };

 

Link to comment
Share on other sites

21 minutes ago, kheldar125 said:

Not sure if this will be of any help but I remember WAI having a config to set % of AI killed to spawn the loot. 

 

So I'm assuming its keeping track of the total AI alive from the mission somewhere right? 

I'm no expert though, I leave that job for you guys. 

 

hello you know how add counter to WAI minniosns?

Link to comment
Share on other sites

51 minutes ago, kheldar125 said:

Not sure if this will be of any help but I remember WAI having a config to set % of AI killed to spawn the loot. 

 

So I'm assuming its keeping track of the total AI alive from the mission somewhere right? 

I'm no expert though, I leave that job for you guys. 

 

Oh you are right, that's a good idea to look at. I will take a look at it, when I have more time. Nice spot though.

Link to comment
Share on other sites

Have experimented a little getting this working but having issues, no doubt someone with more experience than me might be able to add further insight. 

 

What iv found so far, 

1) the function that check for AI killed % is in mission_winorfail.sqf 

if(((wai_mission_data select _mission) select 0) <= _killpercent) then {
						{
							if((isPlayer _x) && (_x distance _position <= 20)) then {
								_complete = true;
							};
						} count playableUnits;

Iv tried this in the files where the missions are setup (example from armed_vehicle.sqf)

_ai = ((wai_mission_data select _mission) select 0);

[_mission,_position,"Medium",format["Disabled %1,%2 Ai Remaining",_vehname,_ai],"MainHero",true] call mission_init;

 "_ai" also added to private variable declaration.

Unfortunately doesn't work. 

 

If anyone can point out exactly where wai_mission_data gets its variables from I will try further. 

 

I could be completely wrong with the way I'm trying this, So please correct me if i'm wrong. new to scripting, but wanting to learn :D

Link to comment
Share on other sites

every time I try to load this I get this error.  The game will allow me to load into the lobby. Shows the cut screen with loading bar at bottom of page but counts to 119 and bounces me back to the lobby. The only mod I have installed is Dayz Epoch Deployable Bike. I have checked to see if those files were on my server and they are.

 

Spoiler

22:42:49 Warning Message: Script z\addons\dayz_server\init\server_functions.sqf not found
22:42:49 Warning Message: Script z\addons\dayz_server\compile\server_spawnTraders.sqf not found
22:42:55 Warning Message: Script z\addons\dayz_server\system\dynamic_vehicle.sqf not found
22:42:55 Warning Message: Script z\addons\dayz_server\system\server_monitor.sqf not found
22:42:55 Warning Message: Script z\addons\dayz_server\traders\chernarus11.sqf not found
22:42:55 Error in expression <;
_recompile = (count _this) > 0;


if (BIS_fnc_init && !_recompile) exitwith {t>
22:42:55   Error position: <BIS_fnc_init && !_recompile) exitwith {t>
22:42:55   Error Undefined variable in expression: bis_fnc_init
22:42:55 File ca\Modules\Functions\init.sqf, line 28
22:45:34 Client: Remote object 2:10 not found
22:45:34 Client: Remote object 2:11 not found
22:45:34 Client: Remote object 2:12 not found

 
 

 

Link to comment
Share on other sites

4 hours ago, LuckBeWitYa said:

every time I try to load this I get this error.  The game will allow me to load into the lobby. Shows the cut screen with loading bar at bottom of page but counts to 119 and bounces me back to the lobby. The only mod I have installed is Dayz Epoch Deployable Bike. I have checked to see if those files were on my server and they are.

 

  Reveal hidden contents

22:42:49 Warning Message: Script z\addons\dayz_server\init\server_functions.sqf not found
22:42:49 Warning Message: Script z\addons\dayz_server\compile\server_spawnTraders.sqf not found
22:42:55 Warning Message: Script z\addons\dayz_server\system\dynamic_vehicle.sqf not found
22:42:55 Warning Message: Script z\addons\dayz_server\system\server_monitor.sqf not found
22:42:55 Warning Message: Script z\addons\dayz_server\traders\chernarus11.sqf not found
22:42:55 Error in expression <;
_recompile = (count _this) > 0;


if (BIS_fnc_init && !_recompile) exitwith {t>
22:42:55   Error position: <BIS_fnc_init && !_recompile) exitwith {t>
22:42:55   Error Undefined variable in expression: bis_fnc_init
22:42:55 File ca\Modules\Functions\init.sqf, line 28
22:45:34 Client: Remote object 2:10 not found
22:45:34 Client: Remote object 2:11 not found
22:45:34 Client: Remote object 2:12 not found

 
 

 

@LuckBeWitYa, Hi,

check your server_monitor.sqf using diffmerge and compare with this file, eventually your init file, compare with this file. I guess you'll find something wrong....

Link to comment
Share on other sites

1 minute ago, iben said:

I mean init.sqf in root of you mission folder (see link above)

ok well, I found one issue in server_monitor, but as for the init ..I have a server on survival servers so as the set up is different...some of the init are in init.sql and some are in an EpochConfig.sql..... I do not see some things in there as in the Hotfix....rest seems fine just in different locations...thanks for the help....guess I will just have to go code by code and see what's missing and what's changed.

Link to comment
Share on other sites

1 minute ago, LuckBeWitYa said:

ok well, I found one issue in server_monitor, but as for the init ..I have a server on survival servers so as the set up is different...some of the init are in init.sql and some are in an EpochConfig.sql..... I do not see some things in there as in the Hotfix....rest seems fine just in different locations...thanks for the help....guess I will just have to go code by code and see what's missing and what's changed.

ok, I think it's in your serverside files anyway... check RPT (mainly server rpt) if there is another warning or error ... good luck!

Link to comment
Share on other sites

  • 2 weeks later...

Hello, ive installed this on both fresh installs, and modded installs. It refuses to work! Theres been 0 errors in my client or server side .rpts and nothing produces ingame. Not even the debug works! I love wai too much to just cast it away so if anyone has any suggestions, please let me know. Followed all instructions to the T and repeatedly made sure of that. Thanks in advance!

Link to comment
Share on other sites

57 minutes ago, ViktorReznov said:

Hello, ive installed this on both fresh installs, and modded installs. It refuses to work! Theres been 0 errors in my client or server side .rpts and nothing produces ingame. Not even the debug works! I love wai too much to just cast it away so if anyone has any suggestions, please let me know. Followed all instructions to the T and repeatedly made sure of that. Thanks in advance!

I will pm you for you to send me your dayz_server pbo.

Link to comment
Share on other sites

  • 2 weeks later...

So, with @salival help, I have this working near flawlessly! However, no matter what I try and do, I cannot get the radio on client side to do what I want it to. I get no option to right click on it and select anything. I have tried: extra_rc, deploy anything click actions and even @salival's update to click actions. Im trying to figure where the problem is because all those right click mods work on everything else and seeing as its because of wai that I want this to work, I seek the advice of the pros. It is very well indeed unnecessary but desired. Any help is much appreciated!

Link to comment
Share on other sites

22 hours ago, ViktorReznov said:

all those right click mods work on everything else

If you say that it's working on everything else, there is maybe just a small mistake that is not obviously visible to you in the itemRadio line. Many people say that click actions is the best way to do it but I still prefer extraRC. Would be good if you decide for a method now and tell us how you did it. Just as an example. My extraRC looks like this:

Spoiler



class ExtraRc {
	class ItemMap {
		class LocateVehicle {
			text = "Locate Vehicles";
			script = "execVM 'path\locateVehicle.sqf'";
		};
	};
	class ItemToolbox {
		class BuildBike {
			text = "Deploy Bike";
			script = "execVM 'path\deploybike.sqf'";
		};
	};
	class ItemKnife {
		class FarmHemp1 {
			text = "Harvest Hemp";
			script = "execVM 'path\cuthemp.sqf'";
		};
	};
	class ItemMachete {
		class FarmHemp2 {
			text = "Harvest Hemp";
			script = "execVM 'path\cuthemp.sqf'";
		};
	};
	class ItemKiloHemp {
		class SmokeHemp {
			text = "Smoke dat Haze";
			script = "execVM 'path\smokehemp.sqf'";
		};
	};
	class ItemBriefcase_Base {
		class OpenMysteryBriefcase {
			text = "Open Briefcase";
			script = "execVM 'path\open_brief.sqf'";
		};
	};
};


 

The most common mistake is the syntax. Often happens in the script line. Make sure to follow the syntax which is like:

script = "execVM 'path\file.sqf'";

 

Link to comment
Share on other sites

2 hours ago, DAmNRelentless said:

If you say that it's working on everything else, there is maybe just a small mistake that is not obviously visible to you in the itemRadio line. Many people say that click actions is the best way to do it but I still prefer extraRC. Would be good if you decide for a method now and tell us how you did it. Just as an example. My extraRC looks like this:

  Hide contents

 



class ExtraRc {
	class ItemMap {
		class LocateVehicle {
			text = "Locate Vehicles";
			script = "execVM 'path\locateVehicle.sqf'";
		};
	};
	class ItemToolbox {
		class BuildBike {
			text = "Deploy Bike";
			script = "execVM 'path\deploybike.sqf'";
		};
	};
	class ItemKnife {
		class FarmHemp1 {
			text = "Harvest Hemp";
			script = "execVM 'path\cuthemp.sqf'";
		};
	};
	class ItemMachete {
		class FarmHemp2 {
			text = "Harvest Hemp";
			script = "execVM 'path\cuthemp.sqf'";
		};
	};
	class ItemKiloHemp {
		class SmokeHemp {
			text = "Smoke dat Haze";
			script = "execVM 'path\smokehemp.sqf'";
		};
	};
	class ItemBriefcase_Base {
		class OpenMysteryBriefcase {
			text = "Open Briefcase";
			script = "execVM 'path\open_brief.sqf'";
		};
	};
};

 

 

 

 

The most common mistake is the syntax. Often happens in the script line. Make sure to follow the syntax which is like:


script = "execVM 'path\file.sqf'";

 

in init.sqf

[] execVM "dayz_code\compile\remote_message.sqf"; (from zsc)

or

_nil = [] execVM "scripts\radio\remote.sqf"; //wai radio toggle

but never at the same time

 

in click actions

["ItemRadio","Toggle Power","execVM 'scripts\radio\switch_on_off.sqf';","true"],

my entire Extra_rc

class ExtraRc {
  class ItemRadio {
        class switchOnOff {
            text = "Power ON/OFF";
            script = "execVM 'scripts\radio\switch_on_off.sqf'";
        };
    };
};

 

ui_selectSlot.sqf with both click actions and extra rc and @salival's click_actions update

Spoiler

//private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];

disableSerialization;

_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;

if (carryClick) then {carryClick = false;};

if (_button == 1) then {
	private ["_conf","_name","_compile","_height","_item","_isKey"];
	_group = _parent displayCtrl 6902;

	_pos = ctrlPosition _group;

	_item = gearSlotData _control;	
	if ( //No right click action
		(!DZE_SelfTransfuse && _item in ["ItemBloodbag","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]) or
		(!dayz_groupSystem && _item == "ItemRadio")
	) exitWith {};
	if (mouseOverCarry) then {
		_item = DayZ_onBack;
		carryClick = true;
	};

	_pos set [0,((_this select 2) + 0.46)];
	_pos set [1,((_this select 3) + 0.07)];

	_conf = configFile >> "cfgMagazines" >> _item;
	if (!isClass _conf) then {
		_conf = configFile >> "cfgWeapons" >> _item;
	};
	_name = getText(_conf >> "displayName");

	_cfgActions = _conf >> "ItemActions";
	_numActions = (count _cfgActions);
	_height = 0;

	//Populate Menu
	for "_i" from 0 to (_numActions - 1) do
	{
		_menu = _parent displayCtrl (1600 + _i);
		_menu ctrlShow true;
		_config = (_cfgActions select _i);
		_type = getText (_config >> "text");
		_script = getText (_config >> "script");
		_outputOriented = getNumber (_config >> "outputOriented") == 1;
		_height = _height + (0.025 * safezoneH);
		_compile = format["_id = '%2' %1;",_script,_item];
		uiNamespace setVariable ['uiControl', _control];
		if (_outputOriented) then {
			/*
				This flag means that the action is output oriented
				the output class will then be transferred to the script
				and the type used for the name
			*/
			_array = getArray (_config >> "output");
			_outputClass = _array select 0;
			_outputType = _array select 1;
			_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
			_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
		};

		_menu ctrlSetText format[_type,_name];
		_menu ctrlSetEventHandler ["ButtonClick",_compile];
	};
	//click actions
	_isKey = ((["ItemKey",_item] call fnc_inString) && (_item != "ItemKeyKit"));

	{
		private["_classname","_text","_execute","_condition","_option"];
		_classname   = _x select 0;
		_text        = _x select 1;
		_execute     = _x select 2;
		_condition   = _x select 3;
		if (count _this > 4) then {_option = _x select 4};

		if ((_item == _classname || (_isKey && (_className == "ItemKey"))) && (call compile _condition)) then {
			_menu = _parent displayCtrl (1600 + _numActions);
			_menu ctrlShow true;
			_height = _height + (0.025 * safezoneH);
			uiNamespace setVariable ['uiControl', _control];
			_menu ctrlSetText _text;
			if (_isKey && (_className == "ItemKey")) then {
				_menu ctrlSetEventHandler ["ButtonClick",format ["[%1,%2] %3",str _item,_option,_execute]];
			} else {
				_menu ctrlSetEventHandler ["ButtonClick",_execute];
			};
			_numActions = _numActions + 1;
		};
    } forEach DZE_CLICK_ACTIONS;
	
	//EXTRA_RC
    
    _erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
    _erc_numActions = (count _erc_cfgActions);
    if (isClass _erc_cfgActions) then {
     for "_j" from 0 to (_erc_numActions - 1) do
     {
       _menu =  _parent displayCtrl (1600 + _j + _numActions);
       _menu ctrlShow true;
       _config =  (_erc_cfgActions select _j);
       _text =  getText (_config >> "text");
       _script =  getText (_config >> "script");
       _height = _height + (0.025 * safezoneH);
       uiNamespace setVariable ['uiControl', _control];
       _menu ctrlSetText _text;
       _menu ctrlSetEventHandler ["ButtonClick",_script];
      };
   };
    //EXTRA_RC

	_pos set [3,_height];

	//systemChat format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_pos];

	_group ctrlShow true;
	ctrlSetFocus _group;
	_group ctrlSetPosition _pos;
	_group ctrlCommit 0;
};

 

and unaltered files to either of those init.sqf calls

Link to comment
Share on other sites

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