Extra Vehicle Actions Addon

  • Offline micovery
  • Moderator
  • Hardened
  • ******
  • Posts: 159

Extra Vehicle Actions Addon

« posted: Jan 02, 2015, 05:12 PM »
This addon enables extra actions on vehicles.


* Lock/Unlock (from outside by vehicle owner)
* Lock/Unlock (from inside by anyone)
* Unflip vehicle (if vehicle is flipped)
* Pull occupant (from outside by vehicle owner)
* Vehicle information


The addon is highly configurable (config.sqf), allowing server admins to specify which actions they want enabled/disabled.

You could also extend this addon to put your own/extra vehicle actions, without needing to modify the A3Wasteland vanilla files.


Here is the config for the addon:

Code: [Select]
//display the "Vehicle Information" action
cfg_va_info_action_on = true;

//display "Unflip vehicle" action (when vehicle is flipped)
cfg_va_unflip_action_on = true; 

//How much time (in seconds) to make the player wait before the vehicle is unflipped
cfg_va_unflip_wait_time = 10;

//Minimum distance (in meters) the player must stay from the vehicle for the unflup action to complete
cfg_va_unflip_wait_distance = 10;

//display the "Pull {PlayerName}" action
cfg_va_pull_player_action_on = true;

//display lock/unlock actions
cfg_va_lock_action_on = true;

//Only the player with UID that matches "ownerUID" variable can lock/unlock the vehicle
cfg_va_lock_owner_only = true;

//Playe lock/unlock sound
cfg_va_lock_sound_play = true;

//Any player can lock/unlock the vehicle from the inside
cfg_va_lock_from_inside = true;

//List of classes for vehicles that can locked/unlocked (empty means all)
cfg_va_lock_actions_classes_list = [];


See source over at: https://github.com/micovery/ArmA3_Wasteland.Altis/pull/32

Screenshots:



Demo video
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2494

Re: Extra Vehicle Actions Addon

« Reply #1 posted: Jan 02, 2015, 09:19 PM »
I peacefully oppose to permanent vehicle locking on the grounds that it further widens the gap between rich and poor by eliminating stealing as a risk factor. The ability to steal is of utmost importance when it comes to Wasteland.
  • Offline micovery
  • Moderator
  • Hardened
  • ******
  • Posts: 159

Re: Extra Vehicle Actions Addon

« Reply #2 posted: Jan 02, 2015, 09:23 PM »
I peacefully oppose to permanent vehicle locking on the grounds that it further widens the gap between rich and poor by eliminating stealing as a risk factor. The ability to steal is of utmost importance when it comes to Wasteland.

I tend to not be as prescriptive about these kind of things :-) That's why i made it on/off in the config. If admin wants to enable it, it's up to him.

But I agree, for every feature, there has to be something else to balance it. You can't just have locking, without also having a way to Lock-pick vehicles. I should probably add a lock-pick action as well ... I did not do it through here, because I wanted to make the lock-picks be a Wasteland item, that you use ... and has a % chance of success, and % chance of breaking.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2494

Re: Extra Vehicle Actions Addon

« Reply #3 posted: Jan 02, 2015, 09:26 PM »
If admin wants to enable it, it's up to him.

Always remember: players > admins

Re: Extra Vehicle Actions Addon

« Reply #4 posted: Jan 02, 2015, 10:46 PM »
I have the problem that... If someone buy a car, they are not marked as owner of the car....
Or at least I have it, maybe because I'm admin it won't work but....? ):
  • Offline micovery
  • Moderator
  • Hardened
  • ******
  • Posts: 159

Re: Extra Vehicle Actions Addon

« Reply #5 posted: Jan 02, 2015, 11:20 PM »
I have the problem that... If someone buy a car, they are not marked as owner of the car....
Or at least I have it, maybe because I'm admin it won't work but....? ):

There is a function for determining if a player owns a car:

https://github.com/micovery/ArmA3_Wasteland.Altis/blob/abb23bdb75ad7f08bf9ebd0b21637ebbf1df2016/addons/vactions/va_functions.sqf#L55

It relies on a variable called "ownerUID" ... to check who is the vehicle owner. I believe that the vanilla mission files use the same variable as well:

https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/commit/648cef1d78ba8869a5c8a1d5fe7ac396978a78f8


However, by default it's not broadcast, so you'd have to change that line to:

Code: [Select]
_object setVariable ["ownerUID", getPlayerUID _player, true];

You will also need to modify the vehicle restoring:

https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/63b097738a8c37f155a49903dbd43a1a26012565/persistence/world/vLoad.sqf#L83

So that the ownerUID variable is broadcast. Add this right after that line:

Code: [Select]
_veh setVariable ["ownerUID", (_veh getVariable "ownerUID"), true];

Re: Extra Vehicle Actions Addon

« Reply #6 posted: Jan 03, 2015, 03:21 PM »
I do this, having an action that depends on you having an toolkit in your inventory and in this case havin a 25% of breaking your toolkit. I did at one time make a "wasteland item" to be used in an earlier version but i found it to be more of a hassle when i came to keeping up with updates. Also this makes the player having making the choice of hulking around on it or not.

Code: [Select]
private ["_vehicle","_nearvehicle", "_break"];
_nearvehicle = nearestObjects [player, ["LandVehicle", "Ship", "Air"], 7];
_vehicle = _nearvehicle select 0;
_break = floor (random 100);

if (_break < 25) exitWith {
hint "Your ToolKit broke";
player removeItem "ToolKit";
};

 for "_i" from 120 to 0 step -1 do
 {
    hint str _i;
player action ["lightOn", _vehicle];
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_soundToPlay = _soundPath + "addons\snafu\vehicleActions\sounds\carhorn.ogg";
playSound3D [_soundToPlay, _vehicle, false, getPosASL _vehicle, 1, 1, 0];
    sleep 0.5;
player action ["lightOff", _vehicle];
sleep 0.5;

if (player distance _vehicle >6 ) then
{
hint "Attempt aborted. You need to stay close to the vehicle in order to break in.";
breakOut "_i";
};
};

if (local _vehicle) then
{
_vehicle lock 1;
//hint "local";
}
else
{
[[netId _vehicle, 1], "A3W_fnc_setLockState", _vehicle] call A3W_fnc_MP; // Unlock
//hint "not local";
};

_vehicle setVariable ["objectLocked", false, true];
_vehicle setVariable ["R3F_LOG_disabled",false,true];
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_soundToPlay = _soundPath + "addons\snafu\vehicleActions\sounds\carlock.ogg";
playSound3D [_soundToPlay, _vehicle, false, getPosASL _vehicle, 1, 1, 15];
player action ["lightOn", _vehicle];
sleep 0.5;
player action ["lightOff", _vehicle];
titleText ["You broke in to the vehicle!","PLAIN DOWN"]; titleFadeOut 2;

called with
Code: [Select]
["<img image='client\icons\r3f_unlock.paa'/>Break in and hotwire", "addons\snafu\vehicleActions\breakLock.sqf", [cursorTarget], 1,false,false,"","!isNull cursorTarget && vehicle player == player && {{ cursorTarget isKindOf _x } count ['LandVehicle', 'Ship', 'Air'] > 0 ;} && cursorTarget getVariable ['ownerUID',''] != getPlayerUID player && locked cursorTarget >= 2 && cursorTarget distance player < 7 && ('ToolKit' in (items player))"],

I would like to see to option of micoverys locking system having a lockpick function in the addon using some kind of "ArmA" item rather than a special "wastland item", but maybe its just me liken the "plug n play" functionality of things =).

Anyway micoverys addon works really nice, thanks again.

Re: Extra Vehicle Actions Addon

« Reply #7 posted: Jan 04, 2015, 10:29 PM »
Lock/unlock from outside with plane/chopper doesn't work (works fine inside)
  • Offline micovery
  • Moderator
  • Hardened
  • ******
  • Posts: 159

Re: Extra Vehicle Actions Addon

« Reply #8 posted: Jan 05, 2015, 07:15 AM »
Lock/unlock from outside with plane/chopper doesn't work (works fine inside)

Thanks, I'll check it out. Is it all helos and planes? Which helo/plane did you test it with?

Re: Extra Vehicle Actions Addon

« Reply #9 posted: Jan 05, 2015, 10:09 AM »
I try with vanillia and addons (rhs) choppers and plane. No interaction to lock/unlock from outside (everything OK from inside)

Re: Extra Vehicle Actions Addon

« Reply #10 posted: Jan 05, 2015, 05:44 PM »
I can confirm some of those,
Tried with hummingbird and speedboat and buzzard.
Vehicle info isn't available on those either.
  • Offline micovery
  • Moderator
  • Hardened
  • ******
  • Posts: 159

Re: Extra Vehicle Actions Addon

« Reply #11 posted: Jan 05, 2015, 06:23 PM »

Re: Extra Vehicle Actions Addon

« Reply #12 posted: Jan 05, 2015, 07:38 PM »
Thanks!!

Re: Extra Vehicle Actions Addon

« Reply #13 posted: Jan 05, 2015, 09:02 PM »
Fixed now:

https://github.com/micovery/ArmA3_Wasteland.Altis/issues/34

hey,

Im new to Wasteland and do not want to sound rude or anything, but what is the actual fix?

I noticed you identified the following in addons/vactions/va_functions.sqf:

Code: [Select]
if (not(_target isKindOf "LandVehicle")) exitWith {nil};
Do we remove it?

  • Offline micovery
  • Moderator
  • Hardened
  • ******
  • Posts: 159

Re: Extra Vehicle Actions Addon

« Reply #14 posted: Jan 05, 2015, 10:22 PM »
hey,

Im new to Wasteland and do not want to sound rude or anything, but what is the actual fix?

I noticed you identified the following in addons/vactions/va_functions.sqf:

Code: [Select]
if (not(_target isKindOf "LandVehicle")) exitWith {nil};
Do we remove it?

That's okay,  this is the actual change:

https://github.com/micovery/ArmA3_Wasteland.Altis/commit/dc4f89de9c3b7ccf73da0ca6a5aa8b3132ad6d14?diff=split