Jump to content
IT07

[UPGRADED DEC2017][scarCODE] Virtual Garage System by IT07

Recommended Posts

Running Epoch on Centos 7, 1.66 0.4.0, does not work properly, problem somewhere in mission part, cant figure it out, as soon as i change something where it should start to work logikaly, it crashes server, with 100% cpu use...

I think i got the problem reason, part with  global.hpp was missing in download

Share this post


Link to post
Share on other sites

I'm getting this error after restarting the server and trying to access the garage

 1:54:05 Error in expression <hen
{
if not isNull _dsp then
{
_vehs = EPOCH_vgsMyGarage;
if not isNil"_vehs" t>
 1:54:05   Error position: <EPOCH_vgsMyGarage;
if not isNil"_vehs" t>
 1:54:05   Error Undefined variable in expression: epoch_vgsmygarage
 1:54:05 File scarCODE\VGS\functions_VGS\fn_vgsTrash.sqf [SC_fnc_vgsTrash], line 20

Then the drop down in the dialog for vehicles in the garage is disabled.

Anyone else bumped into this and managed to fix it?

Thanks in advance.

 

EDIT: Prior to restarting the server, it was working ok. vehicles in, vehicles out. etc

Share this post


Link to post
Share on other sites
On 8.5.2017 at 3:50 PM, ReDBaroN said:

Just to add to my question above, this only happens the first time you log in after a restart. If you relog, then it works ok.

Any ideas anyone?

 

You fixed it? Is VG working without other issues for you?

Share this post


Link to post
Share on other sites

this script looks amazing, now i know there hasnt been any activity on this post since January, However I was wondering if it is still current and if so i noticed a server side and client side, so do my users have to install the client side for this to work for them or do i only have to install the server side?

Share this post


Link to post
Share on other sites

This leaves behind a lot of empty garages in the database. Does anyone know a good way of clearing them out of redis when they're empty? Inventory looks like this:
 

[
  [
    [],
    [],
    [],
    [],
    [],
    [],
    []
  ],
  [
    [],
    [],
    [],
    [],
    [],
    [],
    []
  ]
]

Thanks

Share this post


Link to post
Share on other sites

Not only empty garages. Sadly sometimes vehicles stuck when taking them out of garage and they disappear. So until this is fixed you should think twice if you really want to use it or you may have lot of crying players

Share this post


Link to post
Share on other sites

Here is a start to some work on this system for you guys.

[FIXED]Global.hpp missing and caused hosts issues getting it up and running
[ADDED] Ships are now searched for and listed for storage in the garage
[FIXED] System searched for "Air", but listed only "Helicopters" (now planes and VTOL will show up).

Link to pull merge request:
https://github.com/IT07/Game_code/pull/3

Link to my forked branch:
https://github.com/ravmustang/Game_code/tree/updates/ArmA_3/A3_EPOCH_virtualGarage

Share this post


Link to post
Share on other sites

A little update here, a little tweak here and before I knew it I was reworking the entire script.
Here is a breakdown of whats changed and available on a branch and pull merge request.
 
Server Side
[REMOVED] PublicVariable Event Handler
[REMOVED] Spawn loop for generating keys for each 
[ADDED] 3 new functions to handle the removed PVEH(ReadFrom/WriteTo/TrashFrom)
[ADDED] 2 new functions to spit out client vgs key and client garage on join
[ADDED] Debug config option to log every use/request

Client Side
[FIXED] Global.hpp missing and caused hosts issues getting the script setup and running
[ADDED] Ships are now searched for and listed for storage in the garage
[FIXED] System searched for "Air", but listed only "Helicopters" (now planes and VTOL will show up).
[ADDED] Scroll Wheel config option to disable/enable
[ADDED] Dyna Menu self interaction
[ADDED] Jammer requirement config option along with max distance from jammer entry
[ADDED] Scroll Wheel will follow Jammer Requirements and Max Distance if enabled
[ADDED] Dyna Menu will follow Jammer Requirements and Max Distance if enabled
[ADDED] Debug config option to log each client vgs event
[ADDED] New Function to handle the receipt of data from VGS server
[FIXED] Refreshing of VGS GUI on Move IN and Move OUT was not refreshing both sides properly.

New Configs
// Settings here
debug = 0; // 1 = ON // 0 = OFF
range = 25; // Vehicles within this range of player can be moved into garage
useScrollWheel = 1; // Scroll Wheel VGS Menu
requireJammer = 0; // 1 = ON // 0 = OFF
maxDistanceFromJammer = 300; // meters, only applies if requireJammer = 1

With new readme
Branch here: https://github.com/ravmustang/Game_code/tree/VGS-Overhaul/ArmA_3/A3_EPOCH_virtualGarage

Merge Request here: https://github.com/IT07/Game_code/pull/4

Share this post


Link to post
Share on other sites

Again thx for working on it @DirtySanchez but still same issues as in older versions. Sometimes when eople try to restore the vehicles it stucks at loading vehicle message. When they close window and open up same problem. After reconnecting the vehicle is entirely gone... absolutely not your fault just wanted to let the people know that this still is not fixed

Share this post


Link to post
Share on other sites

This is the main purpose of my thorough rework.

Please look in your rpts for the epoch vgs error messages.

In this case you will want to enable debug on client and server for more info with those error messages.

 

Throughout my rework and testing there were no issues with pulling vehicles out and returning them in.

You can throw me them rpts in discord after the above changes to debug settings. THX

Share this post


Link to post
Share on other sites

@Drokz @natoed
Here is some more work I have just finished and sync'd to the Pull Merge Request #4 VGS Overhaul.
Still am not saying I have fixed your guys issue on MOVE OUT and stuck at "Requesting data from server..."
However there is some really good updates in this batch. 
ENJOY!

[FIXED] Upon MOVE IN, vehicle object was setDamage 1, which could at time blow up the vehicle
[ADDED] Debug config check for remove keys diag_log lines
[FIXED] Hitpoints were not saving / loading properly
[ADDED] usage of params to ReadFromGarage function for MOVE OUT
[ADDED] params for original vehicle data _toSpawn
[ADDED] params for original vehicle gear data _gear
[CHANGED] gear default values in WriteToGarage function
[ADDED] Upon MOVE OUT, find safe position for vehicle based on old save location as center
[ADDED] Upon MOVE OUT, check if vehicle is a "SHIP" and find safe position in water

 

Branch here: https://github.com/ravmustang/Game_code/tree/VGS-Overhaul/ArmA_3/A3_EPOCH_virtualGarage

Merge Request here: https://github.com/IT07/Game_code/pull/4

Share this post


Link to post
Share on other sites

I cant stop!!!!!

This is a big one gentlemen.
This will change the entire database routine and will mean your players will start fresh garages once you update.
However, I feel the benefits outweigh the cons here. COMP your players, they'll get over it!

[CHANGED] Vehicle save / loading now uses EPOCH_cargoFill and _cargoSave
[CHANGED] Database table is now "VirtualGarage" instead of each UID having its own table
[CHANGED] Client DB entry is now their UID only and is found within the "VirtualGarage" table
[ADDED] Virtual Garage DB entry expiration time

[UPGRADED] Saving vehicles as EPOCH saves current vehicles
[ADDED] Textures save / load
[ADDED] Turret Ammo and Mags save / load
[ADDED] Vehicle Upgrade compatibility save / load baseClass variable
[ADDED] Compatibilty with epoch settings for disableVehicleTIE/removevehweapons/removevehmagazinesturret

[CHANGED] Instead of setDamage 1, use Epoch vehicle killed handler
[UPGRADED] Add UID to vehicle killed log on MOVE IN

@natoed

Share this post


Link to post
Share on other sites

Just a question about VG, players are saying they cant sell vehicles once they have been stored in VG.  Is this an error with my database or has anybody else had the same problems?   Apart from this issue its been working well since the recent updates.   Thanks

Share this post


Link to post
Share on other sites

Hey @Razor1977

Yes I saw how that is happening during my upgrade.
The readme does say that if you have a VG vehicle make sure to put it back into the garage before restart as it will be gone after restart.
This statement he makes means that the vehicle is no longer part of the persistent DB system of Epoch and is now a VGS vehicle only.
That also means its no longer a SLOT vehicle and cannot be sold.

I have some ideas moving forward on upgrading EPOCH vehicle DB saving for all vehicle types including vehicle transport with stored vehicles.
Once the new year is settled out I will be starting work on that and testing should begin on my end shortly thereafter.
Chat soon and have a Happy NEW YEAR!!

Share this post


Link to post
Share on other sites

Anyone who is using @DirtySanchez's excellent update to the Virtual Garage who also wants vehicle persistence through a restart added back when a vehicle is removed from a garage can do the following to the server side files.

First add the following line to  a3_epoch_virtualGarage/config.cpp:

	persistentVehicles = 1; // Are vehicles read from the garage made persistent on the server?

Replace a3_epoch_virtualGarage/functions_VGS/fn_vgsReadFromGarage.sqf with this:

Spoiler
/*
	Author: IT07

	Contributor: DirtySanchez from DonkeyPunch.INFO
	
	Description:
	Read from client Garage
	
	Returns:
	remoteExecCall to client garage contents
*/

private["_slots", "_debug", "_playerUID", "_response", "_vehsFriendly", "_vehsRaw", "_toSpawn", "_veh", "_safePOS", "_allHitpoints", "_actualHitpoints", "_dmg", "_response2"];
params [ 
	["_slot", -1, [0]],
	["_playerObj", objNull, [objNull]],
	["_playerKey", "", [""]] 
];
// debug start message
_debug = "debug" call SC_fnc_vgsGetClientSetting;
if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ReadFromGarage _data = %1", [_slot, _playerObj, _playerKey]]};

if isNull _playerObj exitWith	{diag_log format["[EPOCH VGS]: ReadFromGarage Player isNull - data:%1", _playerObj]};

if !([_playerObj, _playerKey] in (uiNamespace getVariable "EPOCH_vgsKeys"))exitWith{diag_log format["[EPOCH VGS]: ReadFromGarage Bad Player and Key - data:%1", [_playerObj, _playerKey]]};

if (_slot isEqualTo -1) exitWith {diag_log format["[EPOCH VGS]: ReadFromGarage Error - slot number is -1 - data:%1", _slot]};

_persistentVics = "persistentVehicles" call VGS_fnc_vgsGetServerSetting;
_slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting;
if !(_slot < _slots) exitWith {diag_log format["[EPOCH VGS]: ReadFromGarage Error - slot not less than max slots - data:%1", [_slot, _slots]]};

_playerUID = getPlayerUID _playerObj;
_response = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE;
if((_response select 1) isEqualTo []) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Client DB entry error - data:%1m", _response]};
if ((_response select 0) isEqualTo 1) then
{
	if (typeName (_response select 1) isEqualTo "ARRAY") then
	{
		_vehsFriendly = _response select 1 select 0;
		_vehsRaw = _response select 1 select 1;
		_toSpawn = _vehsRaw select _slot;
		_toSpawn params ["_vehClass","_position","_damage","_hitPoints","_fuel","_gear","_ammo","_texture","_baseClass"];		
		_position params [
			["_pos", [ [0,0,0],[0,0,0] ] ],
			["_vectorDir", [0,0,0]],
			["_vectorUp", [0,0,0]]
		];
		if (count _toSpawn > 0) then
		{
			_vehsFriendly set [_slot, []]; // Remove the vehicle from garage slot
			_vehsRaw set [_slot, []];
			_expiresVG = "expiresVirtualGarage" call VGS_fnc_vgsGetServerSetting;
			_return = ["VirtualGarage", _playerUID, _expiresVG, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSETEX;
			_veh = createVehicle [_vehClass, _pos select 0, [], 0, "CAN_COLLIDE"];
			//if(_veh isKindOf 'SHIP')then{
			//	_safePOS = [_pos select 0,1,80,10,1,20,1] call BIS_fnc_findSafePos;
			//};
			_veh allowDamage false;
			_veh setvectorDirAndUp [_vectorDir,_vectorUp];
			_veh call EPOCH_server_setVToken;
			_veh setFuel _fuel;
			_veh setVehicleLock "LOCKEDPLAYER";
			clearWeaponCargoGlobal _veh;
			clearMagazineCargoGlobal _veh;
			clearItemCargoGlobal _veh;
			clearBackpackCargoGlobal _veh;
			[_veh,_gear] call EPOCH_server_CargoFill;
			_veh setOwner (owner _playerObj);
			
			if (_persistentVics == 1) then {
				_veh call EPOCH_server_setVToken;
				_epochslot = if(EPOCH_VehicleSlots isEqualTo[])then{ str(count EPOCH_VehicleSlots) } else { EPOCH_VehicleSlots select 0 };
				EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_epochslot];
				missionNamespace setVariable ['EPOCH_VehicleSlotCount', count EPOCH_VehicleSlots, true];
				_veh setVariable['VEHICLE_SLOT',_epochslot,true];
			};
			
			_cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig;
			_availableColorsConfig = (_cfgEpochVehicles >> _vehClass >> "availableColors");
			if (isArray(_availableColorsConfig)) then {
				_colors = getArray(_availableColorsConfig);
				_textureSelectionIndex = (_cfgEpochVehicles >> _vehClass >> "textureSelectionIndex");
				_selections = if (isArray(_textureSelectionIndex)) then { getArray(_textureSelectionIndex) } else { [0] };
				_count = (count _colors) - 1;
				{
					_textures = _colors select 0;
					if (_count >= _forEachIndex) then {
						_textures = _colors select _forEachIndex;
					};
					_veh setObjectTextureGlobal [_x, _textures  select _texture];
				} forEach _selections;
				_veh setVariable ["VEHICLE_TEXTURE", _texture];
			};
			
			if !(_baseClass isequalto "") then {
				_veh setvariable ["VEHICLE_BASECLASS",_baseClass];
			};
			_serverSettingsConfig = configFile >> "CfgEpochServer";
			_disableVehicleTIE = [_serverSettingsConfig, "disableVehicleTIE", true] call EPOCH_fnc_returnConfigEntry;
			// disable thermal imaging equipment
			if (_disableVehicleTIE) then {
				_veh disableTIEquipment true;
			};
			_removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry;
			if !(_removeweapons isequalto []) then {
				{
					_veh removeWeaponGlobal _x;
				} foreach _removeweapons;
			};
			_removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry;
			if !(_removemagazinesturret isequalto []) then {
				{
					_veh removeMagazinesTurret _x;
				} foreach _removemagazinesturret;
			};
			// remove and add back magazines
			if !(_ammo isequalto []) then {
				if ((_ammo select 0) isequaltype true) then {
					{
						_veh removeMagazinesTurret [_x select 0, _x select 1];
					} foreach magazinesAllTurrets _veh;
					{
						if ((_x select 2) > 0) then {
							_veh addMagazineTurret [_x select 0,_x select 1,_x select 2];
						};
					} foreach (_ammo select 1);
				}
				else
				{
					{_veh removeMagazineGlobal _x}count (magazines _veh);
					{_veh addMagazine _x}count _ammo;
				};
			};
			
			_veh allowDamage true;
			_allHitpoints = getAllHitPointsDamage _veh;
			if !(_allHitpoints isEqualTo []) then{
				_actualHitpoints = _allHitpoints select 0;
				if ((count _actualHitpoints) == (count _hitpoints)) then{
					{
						_dmg = _hitpoints param [_forEachIndex,0];
						_veh setHitIndex [_forEachIndex, _dmg];
					} forEach _actualHitpoints;
				};
			};
		
			if (_persistentVics == 1) then {
				_veh call EPOCH_server_save_vehicle;
				_veh call EPOCH_server_vehicleInit;			// apply persistent textures
			};
			
			// Refetch the vehicles from db and send it to Client
			_response2 = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE;
			if ((_response2 select 0) isEqualTo 1) then
			{
				if (typeName (_response2 select 1) isEqualTo "ARRAY") then
				{
					if not(isNull _playerObj) then
					{
						["Garage", _response2 select 1 select 0] remoteExecCall ["SC_fnc_vgsRecvFromServer",owner _playerObj];
						// debug end message
						if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS] Client %1 took his/her %2 from garage", name _playerObj, _toSpawn select 0]};
					};
				};
			};
		};
	};
};

 

RePBO a3_epoch_virtualGarage.pbo and upload back to @epochhive/addons on your server.

Pull request submitted so hopefully this will be in his base repo. 

Share this post


Link to post
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


  • Similar Content

    • By IT07
      server introCredits
      by IT07
       
      ABOUT
      This concept was originally created by me for ArmA 2 DayZ but now it is here for ArmA 3 too :) Enjoy!
       
      VIDEO

       
      WHAT IS THIS?
      This script is a very simple one-file installation which can be installed into the mission file.
      It will then show fully configurable credits to any player that gets ingame. If the player does not want to watch the whole thing, they can skip it using the scroll menu.
      The scroll action for skipping the intro will automatically remove itself after the credits are done showing.
       
      FEATURE HIGHLIGHTS
      - Fully configurable titles and texts
      - Configurable text color
      - Full control over speed
      - Ability to show images
       
      DOWNLOAD
      https://github.com/IT07/A3_ScarCode_ScriptBundle
    • By IT07
      S.A.R. (Simple Ammo Repacker)
      by IT07
       
      INFO
      This script/menu is an extremely simple concept for merging/packing/refilling your USED magazines for any kind of gun/weapon.
      The video below will show you it all in a bit more detail :)
       
      VIDEO (older version)

       
      SCREENSHOT (latest)
      http://imgur.com/34gOsEP
       
      DOWNLOAD & INSTALL
      https://github.com/IT07/A3_ScarCode_ScriptBundle
    • By IT07
      EPOCH Anti-PvP
      by IT07
       
      WHAT IT DOES
      It prevents players from shooting at other players by removing the projectile if fired (directly!) at the player.
      The script is one simple file that runs on the client through the missionfile so a server manager is supposed to install this on his/her server.
       
      DOWNLOAD & INSTALLATION
      https://github.com/IT07/A3_ScarCode_ScriptBundle
       
      Please enjoy :D
  • Advertisement
  • Donation Box

    Please donate to support the community.
    We appreciate all donations!
  • Advertisement
  • Supporters
  • Latest Donations

  • Advertisement
  • Discord

×