Jump to content
  • 0

DZAI or WAI ?


Blerp

Question

Hi,

I am used to make the missions myself in the editor , now i run WAI an DZAI    and if i try to add a custom mission outside those AI tools i get a few conflicts with the units and their waypoints .

I have looked online but cant find anything about this  . not even a good tutor  for WAI and DZAI    ok they comments in the scripts also explain a lot but still .

Now i tried to put in a  Air bus    a  MV22 with one pilot that go from one airport to a other . just wait there and cycle between that ,  as normal this is peanuts in the editor and works as it should but not in game on the dedicated server .

So if anyone can point me in the right direction about what better to use  WAI or DZAI for this and how to go from there then that would be great :).Or how to mix the custom selfmade things in edtior with WAI and DZAI without any general conflicts .

You dont have to make a tutor if you do not have the time but any help would be welcome.

Gr

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

I made tons of missions for OFP and arma etc  and it works in the editor like it should but if i upload the script to my dedicated server it gives me a lot of errors .

So i made some mistakes here i guess  i removed the top lines from my mission file like the center ,groups and my players unit .

so the file look like this now

if (isServer) then {
_unit_0 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["Ins_Soldier_Pilot", [15136.102, 16380.789], [], 0, "CAN_COLLIDE"];
  _unit_0 = _this;
  _this setVehicleInit "This MoveInDriver  AT1";
  _this setUnitRank "CAPTAIN";
  _this setUnitAbility 0.94274074;
  if (true) then {_group_0 selectLeader _this;};
};

_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["MV22", [15135.68, 16376.838], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setVehicleVarName "AT1";
  AT1 = _this;
  _this setVehicleLock "UNLOCKED";
  _this setPos [15135.68, 16376.838];
};

_this = _group_0 addWaypoint [[15132.827, 16379.379], 0];
_this setWaypointCombatMode "BLUE";
_this setWaypointSpeed "FULL";
_this setWaypointBehaviour "SAFE";
_waypoint_0 = _this;

_this = _group_0 addWaypoint [[5139.9072, 4828.5054], 0];
_this setWaypointType "GETOUT";
_this setWaypointCombatMode "BLUE";
_this setWaypointSpeed "FULL";
_this setWaypointBehaviour "SAFE";
_waypoint_1 = _this;

_this = _group_0 addWaypoint [[5102.2231, 4847.7114], 0];
_this setWaypointCombatMode "BLUE";
_this setWaypointSpeed "NORMAL";
_this setWaypointBehaviour "SAFE";
_waypoint_2 = _this;

_this = _group_0 addWaypoint [[5139.9209, 4828.5313], 0];
_this setWaypointType "GETIN";
_waypoint_3 = _this;

_this = _group_0 addWaypoint [[15161.271, 16339.514, 0], 0];
_waypoint_4 = _this;

_this = _group_0 addWaypoint [[15141.047, 16387.672, 0], 0];
_this setWaypointType "GETOUT";
_waypoint_5 = _this;

_this = _group_0 addWaypoint [[15116.04, 16413.898], 0];
_waypoint_6 = _this;

_this = _group_0 addWaypoint [[15132.768, 16379.325], 0];
_this setWaypointType "GETIN";
_this setWaypointSpeed "NORMAL";
_this setWaypointBehaviour "SAFE";
_waypoint_7 = _this;

_this = _group_0 addWaypoint [[5140.0605, 4828.1602], 0];
_this setWaypointType "CYCLE";
_this synchronizeWaypoint [_waypoint_1];
_waypoint_8 = _this;

};
};

end of file ///////////////////////////

any suggestions ?

Gr

 

Link to comment
Share on other sites

  • 0

structure is fine, but i think u need add again center east and his friendly or not with blufor at top. what kind of errors you got?

here ther a part of code of my su34

Spoiler

if (isServer) then {

_this = createCenter east;
_center_1 = _this;

_group_1 = createGroup _center_1;


//PILOT 1/// can`t be killed

_unit_1 = objNull;
if (true) then
{
  _this = _group_1 createUnit ["Ins_Soldier_Pilot", [12533.064, 12569.429], [], 0, "CAN_COLLIDE"];
  _unit_1 = _this;
  _this setDir -105.85972;
  _this setVehicleVarName "pilot1";
  pilot1 = _this;
  _this addEventHandler ["handleDamage", {false}];
  _this setUnitAbility 0.60000002;
  if (true) then {_group_1 selectLeader _this;};
};

//PILOT 2// can`t be killed

_unit_2 = objNull;
if (true) then
{
  _this = _group_1 createUnit ["Ins_Soldier_Pilot", [12525.443, 12538.768], [], 0, "CAN_COLLIDE"];
  _unit_2 = _this;
  _this setVehicleVarName "pilot2";
  pilot2 = _this;
  _this addEventHandler ["handleDamage", {false}];
  _this setUnitAbility 0.60000002;
  if (false) then {_group_1 selectLeader _this;};
};

//su34// can´t be destroyed

_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["Su34", [12538.105, 12574.021], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setDir -69.253487;
  _this setVehicleVarName "bomber";
  bomber = _this;
  _this addEventHandler ["handleDamage", {false}];
  _this setVehicleAmmo 0;
  _this setVehicleLock "LOCKED";
  _this setPos [12538.105, 12574.021];
};

//Pilots get in jet!!!

_this = _group_1 addWaypoint [[12527.354, 12569.374, -0.00010681152], 0];
_this setWaypointType "GETIN NEAREST";
_waypoint_0 = _this;

_this = _group_1 addWaypoint [[12247.22, 9480.1494], 0];
_waypoint_1 = _this;

///////LETS TO DROPS SOME BOMBS////

//BEREZINO tar0//

_this = createMarker ["tar0", [12246.701, 9482.5576]];
_this setMarkerText "tar0";
_this setMarkerShape "ELLIPSE";
_this setMarkerType "Move";
_this setMarkerColor "ColorRedFaded25";
_this setMarkerBrush "Solid";
_marker_0 = _this;

_this = createTrigger ["EmptyDetector", [12248.406, 9482.3203]];
_this setTriggerActivation ["EAST", "PRESENT", true];
_this setTriggerTimeout [2, 2, 2, false];
_this setTriggerStatements ["this", "bomb = ""Bo_GBU12_LGB"" createVehicle getmarkerPos ""tar0""", ""];
_trigger_0 = _this;

};

other way is create units by scripts and maybe use "waituntil" nearest players and execute it by server side.. trough server_monitor.sqf,  server_functions.sqf or in If is server section in init.sqf

 

Link to comment
Share on other sites

  • 0

i use it to generate an area to electrify fences.... buut you can adapt this see:

boats_init.sqf

Spoiler

msg = false;
boats = false;

while {true} do {
    private ["_pos","_allconditions","_inRange","_trigger"];
    
    
    
    _trigger = ["HERE PUT OBJET ID //USE ANY OBJET IN ARMA EDITOR TO USE AS TRIGGER "];
    _pos = getPosATL player;
    _allconditions = (nearestObjects [_pos, _trigger, 150]);
    _inRange = count _allconditions > 0;
    
    
    
    if  (_inRange) then {
        if (!msg) then {
            cutText ['The Navy control this area', 'PLAIN'];
            msg = true;
            [] execVM 'custom\boats\boats_start.sqf';
            
        };
    } else {
    boats = false;
    msg = false;
    };
};

 

boats_start.sqf

Spoiler

boats = true;
 
while {boats} do {

PUTS ALL YOUR AI AND BOATS HERE

    }else{
REMOVE BOATS AND AI HERE USE deleteVehicle
    };
 
 

    };

init.sqf into if is dedicated section.

Spoiler


//SERVER BOATS
[] execVM 'custom\boats\boats_init.sqf';

i dont knw why i was thinking you want boats :S aahah

Link to comment
Share on other sites

  • 0

Well you were thinking right here  about the boats  its a part of my enemy islands :)     but hee Thanks a lot for the time and info you people took for helping me out here.

Iam going back to the editor and have some fun trying to get this going i have so many good ideas for missions  :) 

Ok my pilot can be killed and you can step in the MV22  but after that its Jail time for murder and stealing a vehicle .

The erros are  cant creat  unit   cant create  empty object the MVV even  LOL  well its way more fun if you struggle :)

And about the friendly towards ........   i thought i just made that up for setting the vehicle  SetCaptive true would solve that ..

Again thanks a lot for the help here  :)  

Gr

Link to comment
Share on other sites

  • 0

As soon i try to add the side east and the related objects    i connect to server and i wont let me in .    no id for player   i use to have this but i was able to do everything i guess its related to my admin tools  i might disable that and try to see if things work then ..If the problem are also in database i migh have to delete my character and details from database aswell and login as freshspawn ..

 

 

Link to comment
Share on other sites

  • 0

ok i was seeing your sqf and u have some errors from arma2editor.

first in this line: (read the lines in red)

Spoiler

 _unit_0 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["Ins_Soldier_Pilot", [15136.102, 16380.789], [], 0, "CAN_COLLIDE"];
  _unit_0 = _this;
  _this setVehicleInit "This MoveInDriver  AT1"; // this not work all times into the server you need create a waypoint for it (GET IN NEAREST). Move in works fine with mounted weapons but not so well with vehicles.
  _this setUnitRank "CAPTAIN";
  _this setUnitAbility 0.94274074;
  if (true) then {_group_0 selectLeader _this;};
};

here, see how i do it.

Spoiler

if (isServer) then {

//CREATE VEHICLE
_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["MV22", [15135.68, 16376.838], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setVehicleVarName "AT1";
  AT1 = _this;
  _this addEventHandler ["handleDamage", {false}];//VEHICLE DO NOT HAVE DAMAGE
  _this setVehicleAmmo 0;//PREVENT VEHICLE FIRE AGAINST PLAYERS
  _this setVehicleLock "LOCKED";//VEHICLE IS LOCKED TO PLAYERS TO PREVENT DIES IF THEY GET IN
  _this setPos [15135.68, 16376.838];
};

///CREATE CENTER FOR PILOTS AND UNITS

_this = createCenter east;//opfor is enemy of bluford  (player are blufor, ai from missions like WAI are opfor)
_center_0 = _this;
_this setFriend [west, 0];// 0 means enemy of blufor faction (players)  if u set 1. then opfor will be friendly of blufor
_this setFriend [civilian, 0];//enemy of civil faction (traders)

_group_0 = createGroup _center_0;

 

 

////CREATE PILOT UNIT
_unit_1 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["Ins_Soldier_Pilot", [15136.102, 16380.789], [], 0, "CAN_COLLIDE"];
  _unit_1 = _this;
  _this setUnitRank "CAPTAIN";
  _this setVehicleVarName "pilot1";//give a name for this unit
  pilot1 = _this;
  _this addEventHandler ["handleDamage", {false}];//WITH THIS LINE THE UNIT DO NOT SUFFER DAMAGE
  _this setUnitAbility 0.94274074;
  if (true) then {_group_1 selectLeader _this;};
};

 //Pilot get in mv22 only if the vehicle is near!!!

_this = _group_0 addWaypoint [[15136.102, 16380.789], 0];//group_0 means that this waypoint is only for all units into group_0
_this setWaypointType "GETIN NEAREST";
_waypoint_0 = _this;


};

I know u have experience with editor cuz your doing it bellow... but maybe try it.. remove the move in driver and use only waypoint

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...