geekm0nkey

Merge exad vg with new vg?

31 posts in this topic

I actually like the new interface and nickname feature of the new VG, but I would like to provide the information to the player that the exad VG offered.. I would like it so when you highlight an item in the VG it give you the stats like before.. Amount of fuel, amount of damage, and most importantly.. what the pin number is.

Share this post


Link to post
Share on other sites

shezezeee....

 

Imho the whole "new" system is "flawed" - they missed opportunity to ovetake a runnin system.

I got a basic pincode dispaly runnning, once working as intented i'll share these days.

  • Like 3

Share this post


Link to post
Share on other sites
Advertisement

yeah maybe too focused on making their PUBG clone, felt like the vg implementation should have been one of the smoothest transitions considering ExAd's version was sitting right there working perfectly already LOL

  • Like 1

Share this post


Link to post
Share on other sites

Out of courtesy, they may not wanted to "plagiarize" what they had. All thought, they might have just as easily ASK to use the code... Would have been good.

  • Like 3

Share this post


Link to post
Share on other sites

Look at ExileClient_gui_virtualGarageDialog_event_onLocationChanged.sqf . if I have to setup a test server and use Vanilla Exile, I'll help you along with this issue. But if you just want to use ExAds VG I created a fix for that in your other post Monkey.

  • Like 1

Share this post


Link to post
Share on other sites
On 13.3.2018 at 6:09 PM, geekm0nkey said:

what the pin number is.

n7hNVxf.jpg

Pretty lazy version, if i have some spare time i'll add informations such as pin, money, damage and so on under the listbox.

Overwrites:

ExileServer_object_vehicle_network_storeVehicleRequest = "ExileServer_object_vehicle_network_storeVehicleRequest.sqf";
ExileClient_gui_virtualGarageDialog_event_onLocationChanged ="ExileClient_gui_virtualGarageDialog_event_onLocationChanged.sqf";

Spoiler

/**
 * ExileClient_gui_virtualGarageDialog_event_onLocationChanged
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display", "_dropdown", "_listbox", "_confirmButton", "_nicknameBox", "_index", "_flag", "_storedVehicles", "_nickname", "_nearVehicles", "_pin", "_class"];
disableSerialization;
_display = uiNameSpace getVariable ["RscExileVirtualGarageDialog", displayNull];
_dropdown = _display displayCtrl 4005;
_listbox = _display displayCtrl 4006;
_confirmButton = _display displayCtrl 4007;
_nicknameBox = _display displayCtrl 4010;
_confirmButton ctrlEnable false;
_nicknameBox ctrlSetText "";
_index = _dropdown lbValue (lbCurSel _dropdown);
lbClear _listbox;
_flag = player call ExileClient_util_world_getTerritoryAtPosition;
if (isNull _flag) exitWith {};
_display setVariable ["ExileSelectedVehicle", ""];
switch (_index) do
{
    case 0:
    {
        _confirmButton ctrlSetText "Retrieve Vehicle";
        _nicknameBox ctrlEnable false;
        _storedVehicles = _flag getVariable ["ExileTerritoryStoredVehicles", []];

        if !(_storedVehicles isEqualTo []) then 
        {
            {
                _nickname = _x select 1;
                _pin = _x select 2;
                _index = _listbox lbAdd (format ["(%1) - CODE: %2",_nickname, _pin]); 
                _listbox lbSetData [_index, str(_x)];
                
                

            }
            forEach _storedVehicles;
        };
    };
    case 1:
    {
        _confirmButton ctrlSetText "Store Vehicle";
        _nicknameBox ctrlEnable true;
        _nearVehicles = nearestObjects [player, getArray(missionConfigFile >> "CfgVirtualGarage" >> "allowedVehicleTypes"), _flag getVariable ["ExileTerritorySize", 0]];
        {
            if (local _x) then
            {
                if (alive _x) then
                {
                    _index = _listbox lbAdd getText(configFile >> "CfgVehicles" >> (typeOf _x) >> "displayName");
                    _listbox lbSetData [_index, str([typeOf _x,netId _x])];
                };
            };
        }
        forEach _nearVehicles;
    };
    default {};
};

Spoiler

 * ExileServer_object_vehicle_network_storeVehicleRequest
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_sessionID", "_parameters", "_netID", "_nickname", "_playerObject", "_pin", "_vehicleObject", "_alphabet", "_forbiddenCharacter", "_flagObject", "_storedVehicles", "_level", "_maxNumberOfVehicles", "_vehiclePosition", "_items", "_magazines", "_weapons", "_containers", "_popTabs", "_groundHolder", "_popTabsObject"];
_sessionID = _this select 0;
_parameters = _this select 1;
_netID = _parameters select 0;
_nickname = _parameters select 1;

try
{
    if (getNumber(missionConfigFile >> "CfgVirtualGarage" >> "enableVirtualGarage") isEqualTo 0) then 
    {
        throw "Virtual Garage is disabled on this server";
    };
    _playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
    if (isNull _playerObject) then 
    {
        throw "Player is null";
    };
    if (_playerObject getVariable ["ExileMutex",false]) then
    {
        throw "Player is Mutex";
    };
    _playerObject setVariable ["ExileMutex", true];
    _vehicleObject = objectFromNetID(_netID);
    if (isNull _vehicleObject) then 
    {
        throw "Vehicle is null";
    };
    if !(alive _vehicleObject) then 
    {
        throw "Vehicle has been destroyed";    
    };
    if (_vehicleObject getVariable ["ExileMutex",false]) then
    {
        throw "Vehicle is in the process of being stored";
    };
    _vehicleObject setVariable ["ExileMutex", true];
    if !(_vehicleObject getVariable ["ExileIsPersistent", false]) then 
    {
        throw "You cannot store non-persistent vehicles in the garage!";
    };
    _alphabet = getText (missionConfigFile >> "CfgClans" >> "clanNameAlphabet");
    _forbiddenCharacter = [_nickname, _alphabet] call ExileClient_util_string_containsForbiddenCharacter;
    if !(_forbiddenCharacter isEqualTo -1) then
    {
        throw "Invalid vehicle nickname";
    };
    _flagObject = _playerObject call ExileClient_util_world_getTerritoryAtPosition;
    _storedVehicles = _flagObject getVariable ["ExileTerritoryStoredVehicles", []];
    _level = _flagObject getVariable ["ExileTerritoryLevel", 1];
    _maxNumberOfVehicles = getArray(missionConfigFile >> "CfgVirtualGarage" >> "numberOfVehicles") select ((_level - 1) max 0);
    if (_maxNumberOfVehicles isEqualTo -1) then 
    {
        throw "Your territory isn't allowed to store any vehicles.<br />Upgrade your territory to gain access to Virtual Garage";
    };
    if (count(_storedVehicles) >= _maxNumberOfVehicles) then 
    {
        throw "You cannot store any more vehicles in your territory.<br />Upgrade your territory to store more vehicles!";
    };
    if ((getPosATL _vehicleObject) distance (getPosATL _flagObject) > (_flagObject getVariable ["ExileTerritorySize", 0])) then 
    {
        throw "Vehicle must be in your territory";
    };
    if (getNumber(missionConfigFile >> "CfgVirtualGarage" >> "clearInventoryOnStore") isEqualTo 1) then 
    {        
        _vehiclePosition = getPosATL _vehicleObject;
        _items = _vehicleObject call ExileServer_util_getItemCargo;
        _magazines = magazinesAmmoCargo _vehicleObject;
        _weapons = weaponsItemsCargo _vehicleObject;
        _containers =_vehicleObject call ExileServer_util_getObjectContainerCargo;
        _popTabs = _vehicleObject getVariable ["ExileMoney", 0];
        _groundHolder = createVehicle ["GroundWeaponHolder",_vehiclePosition, [], 0, "CAN_COLLIDE"];
        _groundHolder setPosATL _vehiclePosition;
        if (_popTabs > 0 ) then 
        {
            _popTabsObject = createVehicle ["Exile_PopTabs", _vehiclePosition, [], 0, "CAN_COLLIDE"];    
            _popTabsObject setVariable ["ExileMoney", _popTabs, true];
        };
        [_groundHolder,_items] call ExileServer_util_fill_fillItems;
        [_groundHolder,_magazines] call ExileServer_util_fill_fillMagazines;
        [_groundHolder,_weapons] call ExileServer_util_fill_fillWeapons;
        [_groundHolder,_containers] call ExileServer_util_fill_fillContainers;
        _vehicleObject call ExileClient_util_containerCargo_clear;
    };
    _pin = _vehicleObject getVariable ["ExileAccessCode",""];
    _storedVehicles pushBack [typeOf(_vehicleObject), _nickname, _pin];
    _flagObject setVariable ["ExileTerritoryStoredVehicles", _storedVehicles, true];
    _vehicleObject call ExileServer_object_vehicle_database_update;
    format["storeVehicle:%1:%2:%3:%4", _flagObject getVariable ["ExileDatabaseID", -1], _nickname, _pin, _vehicleObject getVariable ["ExileDatabaseID", -1]] call ExileServer_system_database_query_fireAndForget;
    _vehicleObject call ExileServer_system_vehicleSaveQueue_removeVehicle;
    _vehicleObject call ExileServer_system_simulationMonitor_removeVehicle;
    deleteVehicle _vehicleObject;
    [_sessionID, "storeVehicleResponse", [true,_nickname]] call ExileServer_system_network_send_to;
    
}
catch
{
    [_sessionID, "storeVehicleResponse", [false,_exception]] call ExileServer_system_network_send_to;
    _exception call ExileServer_util_log;    
};
_playerObject setVariable ["ExileMutex", false];
if !(isNull _vehicleObject) then 
{
    _vehicleObject setVariable ["ExileMutex", false];
};
true

Merge exile.ini

[storeVehicle]
SQL1_1 = UPDATE vehicle SET territory_id = ?, nickname = ?, pin_code = ?, last_updated_at = NOW() WHERE id = ?
Number of Inputs = 4
SQL1_INPUTS = 1,2,3,4

[loadTerritoryVirtualGarage]
SQL1_1 = SELECT class, nickname, pin_code FROM vehicle WHERE territory_id = ?
Number of Inputs = 1
SQL1_INPUTS = 1
OUTPUT = 1-STRING,2-STRING,3

 

Edited by WURSTKETTE
  • Like 2

Share this post


Link to post
Share on other sites

Works for me, as always good job.. Just trying to prevent the whole  "I restored my item and it's locked and i forgot the pin, I need an admin!!!!!" kinda thing..

Share this post


Link to post
Share on other sites
9 hours ago, Beowulfv said:

Look at ExileClient_gui_virtualGarageDialog_event_onLocationChanged.sqf . if I have to setup a test server and use Vanilla Exile, I'll help you along with this issue. But if you just want to use ExAds VG I created a fix for that in your other post Monkey.

I saw that.. Thank you.. But, I actually like the potential for the new VG.. Ideally as a community we should be able to prefect it.

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.