Super Jerome

[GVS] Generic Vehicle Service [Exile 1.0.4]

41 posts in this topic

This is a modification of the Generic Vehicle Service created by Jacmac for use on the Exile Mod. I am still fiddling with the code as some of the features need tweaking for Exile (mainly repairing). Currently it does not cost poptabs or respect. If anyone wants to help me with this go right ahead. There is a standard 200 second cooldown between each service. I have tested this with Exile & CUP vehicles. It should work with RHS or any other mods as well. For a full list of features see original post below. 

DOWNLOAD

Original Post

Steps are provided in the "READ ME" file within download. Follow them to the "T" because the steps in original post does not take into account use on Exile. Again, this script was originally made my Jacmac for use on standard ARMA 3. All I have done is make changes to get it to function on Exile 1.0.4 properly. 

20180325204448_1.jpg

20180326085018_1.jpg

  • Like 7

Share this post


Link to post
Share on other sites
Advertisement

So, i dug a lil, made it so you dont have to place any markers.

Following the readme provided by Jerome, ignore steps 1 to 8.
Do steps 8 till the final step.
Overwrite the file "gvs_triggers.sqf" inside the *missionfile* \ gvs \ with the pastebin from below.
https://pastebin.com/LZVW4aE7

Will look into the cooldown bug inside the "generic_vehicle_service.sqf" and look into creating according exile overwrites to let it function.

 

Spoiler

mwehhh1.png


mwehhh2.png

 

Edited by flyingdutchmen
  • Like 1

Share this post


Link to post
Share on other sites

@flyingdutchmen You would be probably looking at changing gvs_triggers.sqf to include service stations.

it looks like the trigger is called currently by the markers "gvs_veh", "gvs_hel", "gvs_pla", "gvs_uav".

You could add fuel stations to be included in the trigger, below each of those marker calls.

Like service point rearm for exile mod does (see the _servicePointClasses mentions):

Spoiler
// Vehicle Service Point by Axe Cop +fix to rearm all weapons from driver+only delete ammo in rearmed weapon only (not entire turret) by HALV
//reworked for a3 epoch by Halv
//reworked for a3 exile by Dodo
 
private ["_curturret","_folder","_servicePointClasses","_maxDistance","_costsFree","_message","_messageShown","_repair_enable","_repair_costs","_repair_repairTime","_rearm_enable","_rearm_costs","_lastVehicle","_lastRole","_fnc_removeActions","_fnc_getCosts","_fnc_actionTitle","_fnc_getWeapons"];
 
//====================== general settings
_folder = "Custom\rearm\"; // folder where the service point scripts are saved, relative to the mission file
_servicePointClasses = ["StorageBladder_02_water_sand_F"]; // service point classes (can be house, vehicle and unit classes)
_maxDistance = 50; // maximum distance from a service point for the options to be shown
_costsFree = "free"; // text for no costs
_message = "-- Vehicle Service Point --"; // message to be shown when in range of a service point (set to "" to disable)
_actionColour = "#0096ff"; //the colour of the scroll action Blue: "#0096ff"
 
//====================== repair settings
_repair_enable = true; // enable or disable the repair option
_repair_repairTime = 2; // time needed to repair each damaged part (in seconds)
 
_repair_costs = [ //Need Money
["Air",1000],
["AllVehicles",800]
];
 
//====================== rearm settings
_rearm_enable = true; // enable or disable the rearm option
 
//deny re-arm if more than this amount of current weapons magazines already in the vehicle
_deny_already_armed_with = 4;
//deny re-arm if more than this amount of magazines already in the vehicle
_GlobalMagazineMAX = 4;
 
//weapon classes disabled from re-arming
_NoGoWeapCName = [
//irrelevant ones
"Horn","SmokeLauncher","MiniCarHorn","SportCarHorn","TruckHorn2","TruckHorn","BikeHorn","CarHorn","TruckHorn3",
//PAWNEE Missiles
"missiles_DAR","missiles_DAGR"
];
 
//magazine classnames not allowed to be rearmed
_NoGoAmmoCName = [
//Gunship Missiles
"24Rnd_missiles", "12Rnd_PG_missiles"
];
 
//cost per magazine for individual vehicles
_rearm_costs = [
["B_MRAP_01_hmg_F",500],
["O_MRAP_02_hmg_F",500],
["I_MRAP_03_hmg_F",500],
["B_Heli_Light_01_Armed_F",800],
["O_Heli_Light_02_F",800],
["I_Heli_Light_03_F",800],
["B_Heli_Transport_01_F",800],
["AllVehicles",500],
["Air",800]
];
 
//debug weapons to see classnames in chat/rpt
_debugWeapon = false;
 
 
//=================================== CONFIG END
_lastVehicle = objNull;
_lastRole = [];
 
SP_repair_action = -1;
SP_rearm_actions = [];
 
_messageShown = false;
 
_fnc_removeActions = {
if (isNull _lastVehicle) exitWith {};
_lastVehicle removeAction SP_repair_action;
SP_repair_action = -1;
{
_lastVehicle removeAction _x;
} forEach SP_rearm_actions;
SP_rearm_actions = [];
_lastVehicle = objNull;
_lastRole = [];
};
 
_fnc_getCosts = {
private ["_vehicle","_costs","_cost"];
_vehicle = _this select 0;
_costs = _this select 1;
_cost = [];
{
private "_typeName";
_typeName = _x select 0;
if (_vehicle isKindOf _typeName) exitWith {
_cost = _x select 1;
};
} forEach _costs;
_cost
};
 
_fnc_actionTitle = {
private ["_actionName","_costs","_costsText","_actionTitle"];
_actionName = _this select 0;
_costs = _this select 1;
_costsText = _costsFree;
if (_costs > 0) then {
private ["_itemName","_displayName"];
_costsText = format ["%1 Pop tabs",_costs];
};
_actionTitle = format ["<t color='%3'>%1 (%2)</t>", _actionName, _costsText,_actionColour];
_actionTitle
};
 
_fnc_getWeapons = {
private ["_vehicle","_role","_weapons"];
_vehicle = _this select 0;
//turrets positions to search for weapons
_turrets = [[-1],[0],[1],[2],[0,0],[1,0],[2,0],[0,1],[0,2]];
_weapons = [];
{
_turret = _x;
_weaponsTurret = _vehicle weaponsTurret _turret;
{
_weapon = _x;
if !(_weapon in _NoGoWeapCName) then{
_weaponName = getText (configFile >> "CfgWeapons" >> _weapon >> "displayName");
_weapons pushBack [_weapon, _weaponName, _turret];
};
}forEach _weaponsTurret;
}forEach _turrets;
_weapons
};
 
_fnc_getAmmo = {
private ["_vehicle","_role","_weapons"];
_vehicle = _this select 0;
_weapon = _this select 1;
_allammo = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
_ammoreturn = [];
{
_curammo = _x;
if !(_curammo in _NoGoAmmoCName) then{
_ammoname = getText (configFile >> "Cfgmagazines" >> _curammo >> "displayName");
_ammoreturn pushBack [_curammo, _ammoname];
};
}forEach _allammo;
_ammoreturn
};
 
while {true} do {
private ["_vehicle","_inVehicle"];
_vehicle = vehicle player;
_inVehicle = _vehicle != player;
if (local _vehicle && _inVehicle) then {
private ["_pos","_servicePoints","_inRange"];
_pos = getPosATL _vehicle;
_servicePoints = (nearestObjects [_pos, _servicePointClasses, _maxDistance]) - [_vehicle];
_inRange = count _servicePoints > 0;
if (_inRange && (speed (_vehicle) < 1) && (speed (_vehicle) > -1)) then {
private ["_servicePoint","_role","_actionCondition","_costs","_actionTitle"];
_servicePoint = _servicePoints select 0;
_role = assignedVehicleRole player;
if (((str _role) != (str _lastRole)) || (_vehicle != _lastVehicle)) then {
// vehicle or seat changed
call _fnc_removeActions;
};
_lastVehicle = _vehicle;
_lastRole = _role;
_actionCondition = "vehicle _this == _target && local _target";
if (SP_repair_action < 0 && _repair_enable) then {
_costs = [_vehicle, _repair_costs] call _fnc_getCosts;
_actionTitle = [format["Repair %1",getText (configFile >> "Cfgvehicles" >> typeOf _vehicle >> "displayName")], _costs] call _fnc_actionTitle;
SP_repair_action = _vehicle addAction [format["<img size='1.5'image='\a3\Ui_f\data\IGUI\Cfg\Cursors\iconrepairvehicle_ca.paa'/> %1",_actionTitle], _folder + "service_point_repair.sqf", [_servicePoint, _costs, _repair_repairTime], -1, false, true, "", _actionCondition];
};
if ((count SP_rearm_actions == 0) && _rearm_enable) then {
private ["_weapons"];
_costs = [_vehicle, _rearm_costs] call _fnc_getCosts;
_weapons = [_vehicle, _role] call _fnc_getWeapons;
{
private "_weaponName";
_curweapon = _x select 0;
_weaponName = _x select 1;
_curturret = _x select 2;
if(_debugWeapon)then{_msg = format["WEAPONS DEBUG: %1",_x];diag_log _msg;systemChat _msg;};
_ammo = [_vehicle,_curweapon] call _fnc_getAmmo;
{
_ammoclass = _x select 0;
_ammoname = _x select 1;
_actionTitle = [format["Rearm %1 %2 with %3", _weaponName,_curturret,_ammoname], _costs] call _fnc_actionTitle;
SP_rearm_action = _vehicle addAction [format["<img size='1.5'image='\a3\Ui_f\data\IGUI\Cfg\WeaponIcons\mg_ca.paa'/> %1",_actionTitle], _folder + "service_point_rearm.sqf", [_servicePoint, _costs, [_weaponName,_ammoclass,_ammoname,_GlobalMagazineMAX,_deny_already_armed_with,_curturret]], -1, false, true, "", _actionCondition];
SP_rearm_actions set [count SP_rearm_actions, SP_rearm_action];
}forEach _ammo;
 
} forEach _weapons;
};
if (!_messageShown && _message != "") then {
_messageShown = true;
_vehicle vehicleChat _message;
};
} else {
call _fnc_removeActions;
_messageShown = false;
};
} else {
call _fnc_removeActions;
_messageShown = false;
};
sleep 2;

};


 

  • Like 1

Share this post


Link to post
Share on other sites
10 minutes ago, aussie battler said:

@flyingdutchmen You would be probably looking at changing gvs_triggers.sqf to include service stations.

it looks like the trigger is called currently by the markers "gvs_veh", "gvs_hel", "gvs_pla", "gvs_uav".

You could add fuel stations to be included in the trigger, below each of those marker calls.

Like service point rearm for exile mod does (see the _servicePointClasses mentions):

  Reveal hidden contents
// Vehicle Service Point by Axe Cop +fix to rearm all weapons from driver+only delete ammo in rearmed weapon only (not entire turret) by HALV
//reworked for a3 epoch by Halv
//reworked for a3 exile by Dodo
 
private ["_curturret","_folder","_servicePointClasses","_maxDistance","_costsFree","_message","_messageShown","_repair_enable","_repair_costs","_repair_repairTime","_rearm_enable","_rearm_costs","_lastVehicle","_lastRole","_fnc_removeActions","_fnc_getCosts","_fnc_actionTitle","_fnc_getWeapons"];
 
//====================== general settings
_folder = "Custom\rearm\"; // folder where the service point scripts are saved, relative to the mission file
_servicePointClasses = ["StorageBladder_02_water_sand_F"]; // service point classes (can be house, vehicle and unit classes)
_maxDistance = 50; // maximum distance from a service point for the options to be shown
_costsFree = "free"; // text for no costs
_message = "-- Vehicle Service Point --"; // message to be shown when in range of a service point (set to "" to disable)
_actionColour = "#0096ff"; //the colour of the scroll action Blue: "#0096ff"
 
//====================== repair settings
_repair_enable = true; // enable or disable the repair option
_repair_repairTime = 2; // time needed to repair each damaged part (in seconds)
 
_repair_costs = [ //Need Money
["Air",1000],
["AllVehicles",800]
];
 
//====================== rearm settings
_rearm_enable = true; // enable or disable the rearm option
 
//deny re-arm if more than this amount of current weapons magazines already in the vehicle
_deny_already_armed_with = 4;
//deny re-arm if more than this amount of magazines already in the vehicle
_GlobalMagazineMAX = 4;
 
//weapon classes disabled from re-arming
_NoGoWeapCName = [
//irrelevant ones
"Horn","SmokeLauncher","MiniCarHorn","SportCarHorn","TruckHorn2","TruckHorn","BikeHorn","CarHorn","TruckHorn3",
//PAWNEE Missiles
"missiles_DAR","missiles_DAGR"
];
 
//magazine classnames not allowed to be rearmed
_NoGoAmmoCName = [
//Gunship Missiles
"24Rnd_missiles", "12Rnd_PG_missiles"
];
 
//cost per magazine for individual vehicles
_rearm_costs = [
["B_MRAP_01_hmg_F",500],
["O_MRAP_02_hmg_F",500],
["I_MRAP_03_hmg_F",500],
["B_Heli_Light_01_Armed_F",800],
["O_Heli_Light_02_F",800],
["I_Heli_Light_03_F",800],
["B_Heli_Transport_01_F",800],
["AllVehicles",500],
["Air",800]
];
 
//debug weapons to see classnames in chat/rpt
_debugWeapon = false;
 
 
//=================================== CONFIG END
_lastVehicle = objNull;
_lastRole = [];
 
SP_repair_action = -1;
SP_rearm_actions = [];
 
_messageShown = false;
 
_fnc_removeActions = {
if (isNull _lastVehicle) exitWith {};
_lastVehicle removeAction SP_repair_action;
SP_repair_action = -1;
{
_lastVehicle removeAction _x;
} forEach SP_rearm_actions;
SP_rearm_actions = [];
_lastVehicle = objNull;
_lastRole = [];
};
 
_fnc_getCosts = {
private ["_vehicle","_costs","_cost"];
_vehicle = _this select 0;
_costs = _this select 1;
_cost = [];
{
private "_typeName";
_typeName = _x select 0;
if (_vehicle isKindOf _typeName) exitWith {
_cost = _x select 1;
};
} forEach _costs;
_cost
};
 
_fnc_actionTitle = {
private ["_actionName","_costs","_costsText","_actionTitle"];
_actionName = _this select 0;
_costs = _this select 1;
_costsText = _costsFree;
if (_costs > 0) then {
private ["_itemName","_displayName"];
_costsText = format ["%1 Pop tabs",_costs];
};
_actionTitle = format ["<t color='%3'>%1 (%2)</t>", _actionName, _costsText,_actionColour];
_actionTitle
};
 
_fnc_getWeapons = {
private ["_vehicle","_role","_weapons"];
_vehicle = _this select 0;
//turrets positions to search for weapons
_turrets = [[-1],[0],[1],[2],[0,0],[1,0],[2,0],[0,1],[0,2]];
_weapons = [];
{
_turret = _x;
_weaponsTurret = _vehicle weaponsTurret _turret;
{
_weapon = _x;
if !(_weapon in _NoGoWeapCName) then{
_weaponName = getText (configFile >> "CfgWeapons" >> _weapon >> "displayName");
_weapons pushBack [_weapon, _weaponName, _turret];
};
}forEach _weaponsTurret;
}forEach _turrets;
_weapons
};
 
_fnc_getAmmo = {
private ["_vehicle","_role","_weapons"];
_vehicle = _this select 0;
_weapon = _this select 1;
_allammo = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
_ammoreturn = [];
{
_curammo = _x;
if !(_curammo in _NoGoAmmoCName) then{
_ammoname = getText (configFile >> "Cfgmagazines" >> _curammo >> "displayName");
_ammoreturn pushBack [_curammo, _ammoname];
};
}forEach _allammo;
_ammoreturn
};
 
while {true} do {
private ["_vehicle","_inVehicle"];
_vehicle = vehicle player;
_inVehicle = _vehicle != player;
if (local _vehicle && _inVehicle) then {
private ["_pos","_servicePoints","_inRange"];
_pos = getPosATL _vehicle;
_servicePoints = (nearestObjects [_pos, _servicePointClasses, _maxDistance]) - [_vehicle];
_inRange = count _servicePoints > 0;
if (_inRange && (speed (_vehicle) < 1) && (speed (_vehicle) > -1)) then {
private ["_servicePoint","_role","_actionCondition","_costs","_actionTitle"];
_servicePoint = _servicePoints select 0;
_role = assignedVehicleRole player;
if (((str _role) != (str _lastRole)) || (_vehicle != _lastVehicle)) then {
// vehicle or seat changed
call _fnc_removeActions;
};
_lastVehicle = _vehicle;
_lastRole = _role;
_actionCondition = "vehicle _this == _target && local _target";
if (SP_repair_action < 0 && _repair_enable) then {
_costs = [_vehicle, _repair_costs] call _fnc_getCosts;
_actionTitle = [format["Repair %1",getText (configFile >> "Cfgvehicles" >> typeOf _vehicle >> "displayName")], _costs] call _fnc_actionTitle;
SP_repair_action = _vehicle addAction [format["<img size='1.5'image='\a3\Ui_f\data\IGUI\Cfg\Cursors\iconrepairvehicle_ca.paa'/> %1",_actionTitle], _folder + "service_point_repair.sqf", [_servicePoint, _costs, _repair_repairTime], -1, false, true, "", _actionCondition];
};
if ((count SP_rearm_actions == 0) && _rearm_enable) then {
private ["_weapons"];
_costs = [_vehicle, _rearm_costs] call _fnc_getCosts;
_weapons = [_vehicle, _role] call _fnc_getWeapons;
{
private "_weaponName";
_curweapon = _x select 0;
_weaponName = _x select 1;
_curturret = _x select 2;
if(_debugWeapon)then{_msg = format["WEAPONS DEBUG: %1",_x];diag_log _msg;systemChat _msg;};
_ammo = [_vehicle,_curweapon] call _fnc_getAmmo;
{
_ammoclass = _x select 0;
_ammoname = _x select 1;
_actionTitle = [format["Rearm %1 %2 with %3", _weaponName,_curturret,_ammoname], _costs] call _fnc_actionTitle;
SP_rearm_action = _vehicle addAction [format["<img size='1.5'image='\a3\Ui_f\data\IGUI\Cfg\WeaponIcons\mg_ca.paa'/> %1",_actionTitle], _folder + "service_point_rearm.sqf", [_servicePoint, _costs, [_weaponName,_ammoclass,_ammoname,_GlobalMagazineMAX,_deny_already_armed_with,_curturret]], -1, false, true, "", _actionCondition];
SP_rearm_actions set [count SP_rearm_actions, SP_rearm_action];
}forEach _ammo;
 
} forEach _weapons;
};
if (!_messageShown && _message != "") then {
_messageShown = true;
_vehicle vehicleChat _message;
};
} else {
call _fnc_removeActions;
_messageShown = false;
};
} else {
call _fnc_removeActions;
_messageShown = false;
};
sleep 2;

};


 

Already into it :P

 

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.