Author: Champ-1
Author Website:

Requirements: No addons required

Version: 0.91

Short description: This script modifies certain vehicles for use as a mobile headquarters.

Date: 2015-04-03 10:38


Comments: (2)
Rating:



 

CH Mobile Headquarters

by
Champ-1


Description:
This script modifies certain vehicles for use as a mobile headquarters. In other words it allows to teleport from the object at the base to one of the HQ vehicles deployed on the map. For now it supports these vehicles:
- HEMTT Transport
- Tempest Transport
- Zamak Transport (CSAT)
- Zamak Transport (AAF)
- Truck (FIA)
But you can configure any vehicle for use with this script. (see section "for advanced users")


Features:
- HQ composition for every faction
- any action (Arsenal, VAS) can be attached to any object in composition
- customizable HQ and cargo objects
- immersive HQ deployment
- can work with any custom vehicles and objects
- different map markers for mobile and deployed HQ
- immersive teleport to HQ
- supports multiple HQs at a time


Installation / Usage:
1. Copy "CHHQ.sqf" into your mission folder.
2. Place any object (for example: map or flag) in editor that will be used to teleport to HQ.
3. Add following code in that object init line:
null = [this, SIDE] execVM "CHHQ.sqf"
Where SIDE is the name of the side (west, east or resistance) MHQ belongs to.
4. Place one of the supported vehicles in editor.
5. Add following code to the init line of that vehicle:
null = [this, SIDE (optional)] execVM "CHHQ.sqf"
Where SIDE is the name of the side (west, east or resistance) this MHQ will belong to. If SIDE is left empty, default vehicle side is used.
6. (Optional) Add the following code in your "init.sqf" if you wish enable or disable map markers for HQs:
CHHQ_showMarkers = false; // Set 'true' if you want real time map markers for all HQs on your side. (Default: true)

For advanced users:
You can add your own presets and edit existing ones for any HQ vehicle. Go to the bottom of the "CHHQ.sqf" and find line "switch (toLower typeOf _obj) do {"
Under this line are stored blocks of code with configuration of every supported vehicle. For example:
case ("b_truck_01_transport_f"): { // Type of HQ vehicle this configuration is used for. Make sure you use only lower case letters! 
    _composition = [["Land_Cargo20_grey_F",[4.11963,-0.677246,0.0971179],271.612]]; // Array of arrays that contains object composition for deployed HQ in format [String: type of object, Array: offset from HQ, Scalar: relative direction from HQ] 
    _cargoInfo = ["Land_Cargo20_grey_F",[0.045,-2.31,1.15],270]; // Array that contains information about cargo attached to HQ in format [String: type of object, Array: offset from HQ, Scalar: relative direction from HQ] 
    [_obj, _side, _cargoInfo, _composition] call CHHQ_fnc_startingSetup; // Functions that starts this script 
};
To create your own object composition you can use my function below.
Place in editor (preferably on an empty VR map) vehicle you would like to create composition for. Add some objects around it (you can use Zeus for that). Get in that vehicle and run this function:
CHHQ_fnc_getOffset = { 
    _veh = if (vehicle player isEqualTo player) then {nearestObject [player, "allVehicles"]} else {vehicle player}; 
    _objArray = []; 
    _vehPos = getPos _veh; 
    _vehDir = getDir _veh; 
    { 
        if !(_x isEqualTo _veh && _x isEqualTo player) then { 
            _pos = getPos _x; 
            _dir = getDir _x; 
            _type = typeOf _x; 
            _offset = [(_pos select 0) - (_vehPos select 0),(_pos select 1) - (_vehPos select 1),(_pos select 2) - (_vehPos select 2)]; 
            _diroffset = (_dir + 360 - _vehDir) % 360; 
            _objArray pushBack [_type,_offset,_diroffset];     
        }; 
    } forEach nearestObjects [player, [], 15]; 
    copyToClipboard str _objArray; 
};  
Object composition will be copied in your clipboard.


Media:



Armaholic.com has its own Youtube channel where we will cover the Community made releases.
Subscribe to the Armaholic.com Youtube channel


Changelog:
v0.91
- added: ability to execute code for every object in composition (for more information read section "for advanced users")
- added: algorithm to measure object composition size and check for suitable conditions only in that radius
- changed: removed dummy unit inside deployed HQ until (forever?) I learn how to make him invisible and stop from getting out of the vehicle
- fixed: marker names not having a proper ID
- fixed: disabled simulation for some objects in composition

v0.9
- beta release


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Headquarters,   Hq,   Mobile,   Teleport