Bones51

[RELEASE] Vehicle Ammo Save Script (Updated 12 Aug 18)

100 posts in this topic

@Bones51 

Spoiler

3270. 18:56:53 Error in expression <lletAmount, _turretPath];
3279. 18:56:53   Error position: <forEach _savedMagazines;
3283. 18:56:53   Error foreach: Type String, expected Array
3284. 18:56:53 File mpmissions\__cur_mp.Lythium\Exile_Server_Overrides\ExileServer_object_vehicle_database_load.sqf, line 172

This is an error i recieve when trying to use this. Im using extdb3 and merged the file with the extdv3 override. Any ideas? Im also running your vehiclerearm script. Both of these scripts share the getloadout function and i do have both in the init.

 

Edited by KyleGD

Share this post


Link to post
Share on other sites
On 9/18/2018 at 7:19 AM, KyleGD said:

@Bones51 

  Hide contents

3270. 18:56:53 Error in expression <lletAmount, _turretPath];
3279. 18:56:53   Error position: <forEach _savedMagazines;
3283. 18:56:53   Error foreach: Type String, expected Array
3284. 18:56:53 File mpmissions\__cur_mp.Lythium\Exile_Server_Overrides\ExileServer_object_vehicle_database_load.sqf, line 172

This is an error i recieve when trying to use this. Im using extdb3 and merged the file with the extdv3 override. Any ideas? Im also running your vehiclerearm script. Both of these scripts share the getloadout function and i do have both in the init.

 

Not sure, kept it configured for extDB2 for simplicities sake. Check page 2/3 of the thread there are some instructions about configuring it for etxDB3.

Share this post


Link to post
Share on other sites
Advertisement

EDIT: The issue was that newly created vehicles didnt default to have [] in their entry. This caused the query to return a string. I fixed this by changing the value to VARCHAR(512) and defaulting to '[]'

EDIT 2: Looks like everything is working. Only thing i have noticed on certain vehicles with rocket pylons on both sides, is that it loads up the ammo for one side of the vehicle only. The other side goes to 0. I dont see any issues in the DB so im curious as to why this may be.

Edited by KyleGD

Share this post


Link to post
Share on other sites

Hi @Bones51,

I love the concept of actually having the VG to only store vehicles and do nothing with them (repair / re-arm / refuel) and thus I also love the concept you have created here.

What I was wondering tho, if it would be possible / doable to also store vehicle damage and fuel level (and not only ammo) this would actually require the players to do proper maintenance on their vehicles. I know it would mean an expansion to your current script.

I haven't gotten around to look at it myself.

Thank you in advance.

Regards,

Share this post


Link to post
Share on other sites
28 minutes ago, Lonewolf_1974 said:

What I was wondering tho, if it would be possible / doable to also store vehicle damage and fuel level (and not only ammo) this would actually require the players to do proper maintenance on their vehicles.

This already exists in the exile code by default. My guess is you are having problems with your VG. The default exile VG, if configured correctly, will retrieve vehicles with the same amount of fuel and damage they were stored with.

Share this post


Link to post
Share on other sites

Hi @BaroN,

Thanks for your fast reply.

I will take a look at what is going on then...

so, this script will only solve the ammo part (so all parameters are basically persistent across VG store/retrieve and restarts with this script added and the default behavior of the VG)?

Regards

Share this post


Link to post
Share on other sites

This script will add an ammo field in the vehicle table in the database to record the vehicle's ammo and provides the code to read / write to and from it. 

The other stuff should work automatically with the default exile vg and has nothing to do with what this script is doing. 

Share this post


Link to post
Share on other sites
42 minutes ago, BaroN said:

This script will add an ammo field in the vehicle table in the database to record the vehicle's ammo and provides the code to read / write to and from it. 

The other stuff should work automatically with the default exile vg and has nothing to do with what this script is doing. 

I have noticed, however, that with vehicles with more than one pylon type, for example the hind with rockets on either side, only one side loads up as intended. The other side defaults to 0 ammo.

Share this post


Link to post
Share on other sites

Anyone know why this wouldn't save the ammo to the DB? Ive checked after every restart and its always at 0 

Found this in the Logs >>

Quote

11:47:34 Warning: 1398 ms spent in callExtension calling name: "extDB2", function: "0:183257:getVehicleAmmo:2691"
11:47:39 Warning: 4433 ms spent in callExtension calling name: "extDB2", function: "0:183257:insertVehicle:Exile_Bike_QuadBike_Black:76561198081265051:0:3002.0200195:6727.359863:1.62558:-0.455406:0.890284:0:0:0:1:2352"
11:47:39 Error in expression <ield = _fields select _i;
if ((typeName _field) isEqualTo "SCALAR") then 
{
_fie>
11:47:39   Error position: <_field) isEqualTo "SCALAR") then 
{
_fie>
11:47:39   Error Undefined variable in expression: _field
11:47:39 File exile_server\code\ExileServer_util_extDB2_createMessage.sqf, line 19
11:47:39 Error in expression <;
_currentLoadout = _vehicleObject call Bones_fnc_getVehicleLoadout;
_extDB2Mess>
11:47:39   Error position: <Bones_fnc_getVehicleLoadout;
_extDB2Mess>
11:47:39   Error Undefined variable in expression: bones_fnc_getvehicleloadout
11:47:39 File mpmissions\__cur_mp.ChernarusRedux\Custom\ammoSave\ExileServer_object_vehicle_database_insert.sqf, line 37
11:47:39 Error in expression <ield = _fields select _i;
if ((typeName _field) isEqualTo "SCALAR") then 
{
_fie>
11:47:39   Error position: <_field) isEqualTo "SCALAR") then 
{
_fie>
11:47:39   Error Undefined variable in expression: _field
11:47:39 File exile_server\code\ExileServer_util_extDB2_createMessage.sqf, line 19
11:47:39 Error in expression <

_currentLoadout = _vehicleObject call Bones_fnc_getVehicleLoadout;

_extDB2Mes>
11:47:39   Error position: <Bones_fnc_getVehicleLoadout;

_extDB2Mes>
11:47:39   Error Undefined variable in expression: bones_fnc_getvehicleloadout
11:47:39 File mpmissions\__cur_mp.ChernarusRedux\Custom\ammoSave\ExileServer_object_vehicle_database_update.sqf, line 55

Quote

Error in expression <[1,[[any]]]>
11:51:38   Error position: <any]]]>
11:51:38   Error Undefined variable in expression: any
11:51:38 Error in expression <edMagazines = _query select 0;
if(count _savedMagazines == 0) exitwith {};
_oldT>
11:51:38   Error position: <_savedMagazines == 0) exitwith {};
_oldT>
11:51:38   Error Undefined variable in expression: _savedmagazines
11:51:38 File mpmissions\__cur_mp.ChernarusRedux\Custom\ammoSave\ExileServer_object_vehicle_database_load.sqf, line 117
11:51:38 Exile_Car_Zamak: rear_hide - unknown animation source rear_hide
11:51:39 Bad simulation fire, type Land_FirePlace_F (class=house), a3\structures_f\civ\camping\fireplace_f.p3d
11:51:39 Error in expression <[1,[[any]]]>
11:51:39   Error position: <any]]]>
11:51:39   Error Undefined variable in expression: any
11:51:39 Error in expression <edMagazines = _query select 0;
if(count _savedMagazines == 0) exitwith {};
_oldT>
11:51:39   Error position: <_savedMagazines == 0) exitwith {};
_oldT>
11:51:39   Error Undefined variable in expression: _savedmagazines
11:51:39 File mpmissions\__cur_mp.ChernarusRedux\Custom\ammoSave\ExileServer_object_vehicle_database_load.sqf, line 117
11:51:41 Warning: 1400 ms spent in callExtension calling name: "extDB2", function: "0:183257:loadVehicleContainer:2996"
11:51:43 Warning: 2350 ms spent in callExtension calling name: "extDB2", function: "0:183257:getVehicleAmmo:2996"

 

Edited by Blaezit

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.