Announcement

Collapse
No announcement yet.

UAV board

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [GUIDE] UAV board

    As a documentation for myself as well as for sharing spirit I present to you a simple UAV board. UAVs are quite tricky as they need some identity within them to be able to connect and control them. Simply linking them to a respawn module does not work. So I was digging through Virtual Vehicle Spawner (VVS) and extracted the following simplified script. Original script and credit goes to Tonic. To see this in action: Server 1 Enemy Assault v.2.3.tg2 sports this feature for the UAV operator.

    To use it, you need a marker named "veh_pos" in a position with enough space and an object (board, desk) with the following line in its init:
    Code:
    this addAction["<t color='#008db8'>Get UGV armed</t>", "spawnUGV.sqf"];
    this addAction["<t color='#008db8'>Get UGV unarmed with ammo</t>", "spawnUGV_ammo.sqf"]
    this addAction["<t color='#008db8'>Get UAV</t>", "spawnUAV.sqf"]
    this addAction["<t color='#008db8'>Get UAV CAS</t>", "spawnUAV_CAS.sqf"]

    spawnUAV.sqf - UAV without attack capabilities. fixed wing.

    Code:
    _uavs       = ["B_soldier_UAV_F"]; 
    
    _caller = _this select 1;
    _type = typeOf _caller;
    
    if (_type IN _uavs) then 
    {
        _position = getMarkerPos "veh_pos";
        _direction = 45;
        _className = "B_UAV_02_F"; // Others : 
    
        //Check to make sure the spawn point doesn't have a vehicle on it, if it does then delete it.
        _spCheck = nearestObjects[_position,["landVehicle","Air","Ship"],12] select 0;
        if(!isNil "_spCheck") then {deleteVehicle _spCheck;};
        
        _vehicle = _className createVehicle _position;
        _vehicle allowDamage false;
        _vehicle setPos _position; //Make sure it gets set onto the position.
        _vehicle setDir _direction; //Set the vehicles direction the same as the marker.
    
        createVehicleCrew _vehicle;
    
        clearWeaponCargoGlobal      _vehicle;
        clearMagazineCargoGlobal    _vehicle;
        clearItemCargoGlobal        _vehicle;
    
        _vehicle allowDamage true;
        
        _caller groupChat "Unmanned vehicle is ready.";
    }
    else
    {
        _caller groupChat "Only UAV operators are able to spawn Unmanned vehicles.";
    }
    spawnUAV_CAS.sqf - CAS UAV fixed wing.

    Code:
    _uavs       = ["B_soldier_UAV_F"];
    
    _caller = _this select 1;
    _type = typeOf _caller;
    
    if (_type IN _uavs) then 
    {
        _position = getMarkerPos "veh_pos";
        _direction = 45;
        _className = "B_UAV_02_CAS_F";
    
        //Check to make sure the spawn point doesn't have a vehicle on it, if it does then delete it.
        _spCheck = nearestObjects[_position,["landVehicle","Air","Ship"],12] select 0;
        if(!isNil "_spCheck") then {deleteVehicle _spCheck;};
    
        _vehicle = _className createVehicle _position;
        _vehicle allowDamage false;
        _vehicle setPos _position; //Make sure it gets set onto the position.
        _vehicle setDir _direction; //Set the vehicles direction the same as the marker.
    
        createVehicleCrew _vehicle;
    
        clearWeaponCargoGlobal      _vehicle;
        clearMagazineCargoGlobal    _vehicle;
        clearItemCargoGlobal        _vehicle;
    
        _vehicle allowDamage true;
    
        _caller groupChat "Unmanned vehicle is ready.";
    
    }
    else
    {
        _caller groupChat "Only UAV operators are able to spawn Unmanned vehicles.";
    }
    spawnUGV_ammo.sqf - an unarmed UGV with Inventory of gears.

    Code:
    _uavs       = ["B_soldier_UAV_F"];
    
    _caller = _this select 1;
    _type = typeOf _caller;
    
    if (_type IN _uavs) then 
    {
    
    _position = getMarkerPos "veh_pos";
    _direction = 45;
    _className = "B_UGV_01_F";
    
    //Check to make sure the spawn point doesn't have a vehicle on it, if it does then delete it.
    _spCheck = nearestObjects[_position,["landVehicle","Air","Ship"],12] select 0;
    if(!isNil "_spCheck") then {deleteVehicle _spCheck;};
    
    _vehicle = _className createVehicle _position;
    _vehicle allowDamage false;
    _vehicle setPos _position; //Make sure it gets set onto the position.
    _vehicle setDir _direction; //Set the vehicles direction the same as the marker.
    
    createVehicleCrew _vehicle;
    
    clearWeaponCargoGlobal      _vehicle;
    clearMagazineCargoGlobal    _vehicle;
    clearItemCargoGlobal        _vehicle;
    
    _vehicle addItemCargoGlobal ["FirstAidKit", 10];
    _vehicle addMagazineCargoGlobal["30Rnd_65x39_caseless_mag", 20];
    _vehicle addMagazineCargoGlobal["20Rnd_762x51_Mag", 10];
    _vehicle addMagazineCargoGlobal["DemoCharge_Remote_Mag", 5];
    _vehicle addMagazineCargoGlobal["NLAW_F", 3];
    _vehicle addMagazineCargoGlobal["Titan_AA", 3];
    _vehicle addMagazineCargoGlobal["3Rnd_HE_Grenade_shell", 5];
    _vehicle addMagazineCargoGlobal["Titan_AT", 2];
    _vehicle addMagazineCargoGlobal["200Rnd_65x39_cased_Box", 5];
    _vehicle addMagazineCargoGlobal["100Rnd_65x39_caseless_mag", 5];
    _vehicle addMagazineCargoGlobal["SatchelCharge_Remote_Mag", 1];
    
    _vehicle allowDamage true;
    
        _caller groupChat "Unmanned vehicle is ready.";
    
    }
    else
    {
        _caller groupChat "Only UAV operators are able to spawn Unmanned vehicles.";
    }
    spawnUGV.sqf - an armed UGV

    Code:
    _uavs       = ["B_soldier_UAV_F"];
    
    _caller = _this select 1;
    _type = typeOf _caller;
    
    if (_type IN _uavs) then 
    {
    
        _position = getMarkerPos "veh_pos";
        _direction = 45;
        _className = "B_UGV_01_rcws_F";
    
        //Check to make sure the spawn point doesn't have a vehicle on it, if it does then delete it.
        _spCheck = nearestObjects[_position,["landVehicle","Air","Ship"],12] select 0;
        if(!isNil "_spCheck") then {deleteVehicle _spCheck;};
    
        _vehicle = _className createVehicle _position;
        _vehicle allowDamage false;
        _vehicle setPos _position; //Make sure it gets set onto the position.
        _vehicle setDir _direction; //Set the vehicles direction the same as the marker.
    
        createVehicleCrew _vehicle;
    
        clearWeaponCargoGlobal      _vehicle;
        clearMagazineCargoGlobal    _vehicle;
        clearItemCargoGlobal        _vehicle;
    
        _vehicle allowDamage true;
        _caller groupChat "Unmanned vehicle is ready.";
    
    }
    else
    {
        _caller groupChat "Only UAV operators are able to spawn Unmanned vehicles.";
    }


  • #2
    Re: UAV board

    Code:
    createVehicleCrew _vehicle;
    making lives easier since 2013

    Thanks for the post B
    Yink | Vanilla Pilot | Killer of Stirling | CS GOD | Projects Team

    Comment

    Connect

    Collapse

    TeamSpeak 3 Server

    Collapse

    Advertisement

    Collapse

    Twitter Feed

    Collapse

    Working...
    X