Jump to content

[RE-RELEASE, v1.5.1] Paint Vehicles script using single currency (updated to 1.0.6.2)


iben

Recommended Posts

Hello guys,
do you remember old "Paint vehicles" script? Let's look back to idea fathers:

===

CREDITS:
All credits goes to its original authors:

DayZ Epoch developers, collaborators and contributors (thank you guys for your excellent work!) (visit them on github)
Maca134 for orginal color vehicle script.
@Zupa for the idea of painting vehicles in two different colors.
@0verHeaT for script public release - this version we are updating for 1.0.6.1+ (see original thread)
@raymix for list of paintable vehicles for this script (see original thread)

---

Special Thank you goes to @DAmNRelentless for taking care of Github repo.

 ===

This script was updated for Epoch 1.0.6.2 and upgraded.

===

FEATURES:

  • Vehicles can be painted in two different colors
  • Only vehicles which you own can be painted (vehicles with key)
  • Only vehicles in ColourVehicles array can be painted
  • Script is designed to be used along with Single currency. Player will pay for painting vehicles.
  • UPDATED: Color values are saved in the worldspace field in database
  • NEW: Vehicles can be unpainted to default state (default textures are loaded)
  • UPDATED: Vehicles can be painted using GUI with visual enhancements. Use PaintVehicles defines.hpp for defining custom GUI color scheme
  • UPDATED: Script is now fully compatible with Virtual Garage and Vehicle Key Changer (VKC) script thanks to @salival (2017-08-22).
    All scripts by @salival and this one prior update date should be upgraded to get much better player experience!
  • UPDATED: for Epoch 1.0.6.2

===

Changelog:

  • [2017-05-22], v1.0 | Initial release
  • [2017-05-25], v1.1 | Optimized compiles: 5 files reduced to 1. See changes: [commit  ae29c13]
  • [2017-08-20], v1.2 | Regular code maintenance. See changes: [commit 682f99a] and [commit 7cd8fce]
  • [2017-10-23], v1.3 | Roll back to full version of player_forceSave (uniCoins fix: Issue not related to script itself).
  • [2017-12-04], v1.4 | Safer manipulation with data sending to server. Basic defines fix - from sqf to hpp.  See changes: [commit 2735dea]
  • [2017-29-04], v1.5 | Update for Epoch 1.0.6.2
  • [2017-29-04], v1.5.1 | FIX: fn_selfAction path (thx @hooty): [commit 38fe105]

===

How it looks like:

D86F65EDF949D1ADD387FE352AF0169647C34AC4

=== database screenshot

017539E039856C03C5F7D1DBF50A285C822F867D

===

MiniShowcase

===

How to install:
We are not using common way how is script included to current folder structure (like grab whole folder and put it to the root of mission folder) - 
that's why read carefully, use repo folder structure (or similar) and compare tool like diffmerge! If you have troubles, just ask here or send me PM.

Source files are available at Github repo. You can download them from here.

For client side we need these folders in the root of your 'MPMissions\Dayz_Epoch_11.Chernarus' folder:

  • actions: we will store file with scroll action menu command Paint vehicle here
  • compile: we will store core script client files here
  • Configs: we will store defines && dialog config files for script GUI here
  • gui:  we will store your "Money" or "Coins" picture here (Change path inside: `dayz_code\compile\player_paintVehicle.sqf`)
  • init: we will load all compiles and variables from here

... and finaly files:

  • description.ext: we will load your defines and dialogs from here via master.hpp
  • init.sqf: we will load your custom compiles and variables from here

For server side (dayz_server) we need to touch these files:

  • compiles\paintVehicles  (copy whole folder to compiles)
  • compiles\server_updateObject.sqf
  • system\server_monitor.sqf
  • init\server_functions.sqf (compile init.sqf)

===

Battleye

// Add an exception to publicvariable.txt
!="PVDZE_veh_Color"

===

infiSTAR

// Add an exception to allowed dialogs
571113

===

...that's all, Have Fun!!
Cheers...

===
Link to comment
Share on other sites

17 minutes ago, Dzhabrailov said:

 

The server does not load after installing the script): and in RTP no errors

Did you check client && server RPT both? If server doesn't load, you probably did something wrong in serverside files.... use diffmerge and check all files in dayz_server again... (single comma can cause problem!)

In your RPT look beside "error" message also for message "warning: something wasn't found..."

Link to comment
Share on other sites

Super work, but I find it very complicated to paste into an already made script pack. You have to take a few files apart.
for example CfgSounds, besides, it is not quite clear to me where I must insert some entries.
Many server admins have already made their own script pack and are now either to start over again or to implement numerous experiments with the implementation of Vehicle Paint.

Sry for my english. i have used google translation

Link to comment
Share on other sites

1 hour ago, Kimarik said:

Super work, but I find it very complicated to paste into an already made script pack. You have to take a few files apart.
for example CfgSounds, besides, it is not quite clear to me where I must insert some entries.
Many server admins have already made their own script pack and are now either to start over again or to implement numerous experiments with the implementation of Vehicle Paint.

Sry for my english. i have used google translation

Very nice. But I agree with @Kimarik. Maybe a solution in which the client does not need to install any modification? Just serverside?

 

Link to comment
Share on other sites

3 hours ago, iben said:

Did you check client && server RPT both? If server doesn't load, you probably did something wrong in serverside files.... use diffmerge and check all files in dayz_server again... (single comma can cause problem!)

In your RPT look beside "error" message also for message "warning: something wasn't found..."

 

Oh, it worked. Thank you. And there is a script Server_DeleteObjInsafezone on 1.0.6.1 and then I put old 1.5 and the script does not work

Link to comment
Share on other sites

25 minutes ago, Dzhabrailov said:

 

Oh, it worked. Thank you. And there is a script Server_DeleteObjInsafezone on 1.0.6.1 and then I put old 1.5 and the script does not work

I think I know what are you reffering to... probably you mean this old script "delete vehicles parked in safezones on restart"? If so, it working, because I'm using it.

You have to be sure your file 'server_deleteObjInsafezone.sqf' is included in correct place in 'dayz_server\system\server_monitor.sqf'. Check the spoiler:

 

// file: server_monitor.sqf

// ... code

    // =====================================================================
    // @PAINT VEHICLES
    // =====================================================================
    if (_object isKindOf "AllVehicles") then {
    // =====================================================================
      private ["_pcolor","_pcolor2","_clrinit","_clrinit2"];
    // =====================================================================
      _object setVariable ["CharacterID", _ownerID, true];
      _isAir = _object isKindOf "Air";
      {
        _selection = _x select 0;
        _dam = if (!_isAir && {_selection in dayZ_explosiveParts}) then {(_x select 1) min 0.8;} else {_x select 1;};
        _strH = "hit_" + (_selection);
        _object setHit[_selection,_dam];
        _object setVariable [_strH,_dam,true];
      } foreach _hitpoints;
      [_object,"damage"] call server_updateObject;
    // =======================================================================
      if(count _worldspace >= 4) then {
        if (((typeName(_worldspace select 2)) == "STRING") and ((typeName(_worldspace select 3)) == "STRING")) then {
          _pcolor = _worldspace select 2;
          _pcolor2 = _worldspace select 3;
          if (_pcolor != "0") then {
            _object setVariable ["Colour",_pcolor,true];
            _clrinit = format ["#(argb,8,8,3)color(%1)",_pcolor];
            _object setVehicleInit "this setObjectTexture [0,"+str _clrinit+"];";
          };
          if (_pcolor2 != "0") then {
            _object setVariable ["Colour2",_pcolor2,true];
            _clrinit2 = format ["#(argb,8,8,3)color(%1)",_pcolor2];
            _object setVehicleInit "this setObjectTexture [1,"+str _clrinit2+"];";
          };
        };
      };
    // =======================================================================
      _object setFuel _fuel;
      if (!_isSafeObject) then {
        _DZE_VehObjects set [count _DZE_VehObjects,_object];
        _object call fnc_veh_ResetEH;
        if (_ownerID != "0" && {!(_object isKindOf "Bicycle")}) then {_object setVehicleLock "locked";};
        _serverVehicleCounter set [count _serverVehicleCounter,_type]; // total each vehicle
      } else {
        _object enableSimulation true;
      };
      // =====================================================================
      // @safezone: Safezone cleanup script
      // =====================================================================
      [_object] execVM "\z\addons\dayz_server\compile\server_deleteObjInsafezone.sqf";
      // =====================================================================
    } else {
 
    // ... rest of code

 

Link to comment
Share on other sites

13 minutes ago, iben said:

I think I know what are you reffering to... probably you mean this old script "delete vehicles parked in safezones on restart"? If so, it working, because I'm using it.

You have to be sure your file 'server_deleteObjInsafezone.sqf' is included in correct place in 'dayz_server\system\server_monitor.sqf'. Check the spoiler:

 

 

  Reveal hidden contents

 



// file: server_monitor.sqf

// ... code

    // =====================================================================
    // @PAINT VEHICLES
    // =====================================================================
    if (_object isKindOf "AllVehicles") then {
    // =====================================================================
      private ["_pcolor","_pcolor2","_clrinit","_clrinit2"];
    // =====================================================================
      _object setVariable ["CharacterID", _ownerID, true];
      _isAir = _object isKindOf "Air";
      {
        _selection = _x select 0;
        _dam = if (!_isAir && {_selection in dayZ_explosiveParts}) then {(_x select 1) min 0.8;} else {_x select 1;};
        _strH = "hit_" + (_selection);
        _object setHit[_selection,_dam];
        _object setVariable [_strH,_dam,true];
      } foreach _hitpoints;
      [_object,"damage"] call server_updateObject;
    // =======================================================================
      if(count _worldspace >= 4) then {
        if (((typeName(_worldspace select 2)) == "STRING") and ((typeName(_worldspace select 3)) == "STRING")) then {
          _pcolor = _worldspace select 2;
          _pcolor2 = _worldspace select 3;
          if (_pcolor != "0") then {
            _object setVariable ["Colour",_pcolor,true];
            _clrinit = format ["#(argb,8,8,3)color(%1)",_pcolor];
            _object setVehicleInit "this setObjectTexture [0,"+str _clrinit+"];";
          };
          if (_pcolor2 != "0") then {
            _object setVariable ["Colour2",_pcolor2,true];
            _clrinit2 = format ["#(argb,8,8,3)color(%1)",_pcolor2];
            _object setVehicleInit "this setObjectTexture [1,"+str _clrinit2+"];";
          };
        };
      };
    // =======================================================================
      _object setFuel _fuel;
      if (!_isSafeObject) then {
        _DZE_VehObjects set [count _DZE_VehObjects,_object];
        _object call fnc_veh_ResetEH;
        if (_ownerID != "0" && {!(_object isKindOf "Bicycle")}) then {_object setVehicleLock "locked";};
        _serverVehicleCounter set [count _serverVehicleCounter,_type]; // total each vehicle
      } else {
        _object enableSimulation true;
      };
      // =====================================================================
      // @safezone: Safezone cleanup script
      // =====================================================================
      [_object] execVM "\z\addons\dayz_server\compile\server_deleteObjInsafezone.sqf";
      // =====================================================================
    } else {
 
    // ... rest of code

 

 

 

its work oh yeaaah THX

Maybe you can tell me some more cool and useful scripts ?
Link to comment
Share on other sites

1 minute ago, Dzhabrailov said:

its work oh yeaaah THX


Maybe you can tell me some more cool and useful scripts ?

:)) I'm glad it worked for you :) Maybe you can try to install virtual garage from @theduke release? It's cool and could help with your server load and performance :)

Link to comment
Share on other sites

Just now, Dzhabrailov said:

 

 

I heard that there are a lot of mistakes and dups, but if it is not so, why not ^^

Well, I haven't installed this script yet... so I cannot tell you if it's true. But generally speaking, the idea is really good - for game and server performance. That's all I can say...

Link to comment
Share on other sites

2 hours ago, Kimarik said:

Super work, but I find it very complicated to paste into an already made script pack. You have to take a few files apart.
for example CfgSounds, besides, it is not quite clear to me where I must insert some entries.
Many server admins have already made their own script pack and are now either to start over again or to implement numerous experiments with the implementation of Vehicle Paint.

Sry for my english. i have used google translation

 

1 hour ago, Anhor said:

Very nice. But I agree with @Kimarik. Maybe a solution in which the client does not need to install any modification? Just serverside?

 

Hello guys,

thank you for feedback. I can hear you and understand, thank you!

10 hours ago, iben said:

How to install:
We are not using common way how is script included to current folder structure (like grab whole folder and put it to the root of mission folder) - 
that's why read carefully, use repo folder structure (or similar) and compare tool like diffmerge! If you have troubles, just ask here or send me PM.

I wrote this in installation description, because during past days I helped couple guys to cleanup mess with scripts conflicts which comes from installation instructions like: 'grab all folder and put it in root... then...'

The thing is, more scripts you install, bigger chance to go to conflict (mainly with defines and dialogs - description.ext mess) - and a lot of duplicity code (like basic defines).

So I decided to follow original dayz_code structure and give all admins and owners alternative, so they can decide, where they put files so it fit their own script pac.

And for example 'CfgSounds' - this is not related to script at all - this file was included just because to make all sense in description.ext (I mean how to load correctly all in right order in description.ext using master.hpp).

 

Anyway, I can think anything, but it doesn't mean I'm right.
And what's important - this script is for you, so if more people find installation confusing, I'll definitely create another branch in Github and make client side in one pack as usuall.

Cheers

Link to comment
Share on other sites

4 minutes ago, iben said:

The thing is, more scripts you install, bigger chance to go to conflict (mainly with defines and dialogs - description.ext mess) - and a lot of duplicity code (like basic defines).

So I decided to follow original dayz_code structure and give all admins and owners alternative, so they can decide, where they put files so it fit their own script pac.

And for example 'CfgSounds' - this is not related to script at all - this file was included just because to make all sense in description.ext (I mean how to load correctly all in right order in description.ext using master.hpp).

Yes this is a problem and im one of them to have his mission all messed up. I started 2 years ago and the bad habit stayed with me lol.

Im actually in the process of redoing my missions so that it does reflect the same paths for the dayz client files.  Its a good habit to have.

EDIT: as for the virtual garage.  I only updated it. as for the colors in the database for the sql, it shouldnt need to change.

Link to comment
Share on other sites

2 minutes ago, theduke said:

Yes this is a problem and im one of them to have his mission all messed up. I started 2 years ago and the bad habit stayed with me lol.

Im actually in the process of redoing my missions so that it does reflect the same paths for the dayz client files.  Its a good habit to have.

Tell me about this... :)))

Last couple days I spent hours to help guys organize their files.... and that's exactly why I decided to give install instruction as they look like... :))

Link to comment
Share on other sites

56 minutes ago, iben said:

The thing is, more scripts you install, bigger chance to go to conflict (mainly with defines and dialogs - description.ext mess) - and a lot of duplicity code (like basic defines).

I agree ....... had this problem today with my "no one left back" idea and the "bury & butcher human" script and some others.

Link to comment
Share on other sites

3 minutes ago, Dzhabrailov said:

 

Removal of technology is working, but my ATV did not retire after the restart, but everything is removed, except the ATV 


Only noticed

yeah, just go to your 'server_deleteObjInsafezone.sqf' and find:

// file: server_deleteObjInSafezone.sqf
// find around line ::42
_defdelar = ["Bicycle","Motorcycle","CSJ_GyroC","CSJ_GyroCover","CSJ_GyroP"];
// ...and change it to:
_defdelar = ["Bicycle","Motorcycle","CSJ_GyroC","CSJ_GyroCover","CSJ_GyroP","ATV_Base_EP1"]; // @readme: this will deletes ATV's after restart

PS: we are solving problems for another script here: please, send me PM so we don't spam another topic here. Thank You...

Link to comment
Share on other sites

Just now, iben said:

yeah, just go to your 'server_deleteObjInsafezone.sqf' and find:


// file: server_deleteObjInSafezone.sqf
// find around line ::42
_defdelar = ["Bicycle","Motorcycle","CSJ_GyroC","CSJ_GyroCover","CSJ_GyroP"];
// ...and change it to:
_defdelar = ["Bicycle","Motorcycle","CSJ_GyroC","CSJ_GyroCover","CSJ_GyroP","ATV_Base_EP1"]; // @readme: this will deletes ATV's after restart

PS: we are solving problems for another script here: please, send me PM so we don't spam another topic here. Thank You...

okay thx )))

Link to comment
Share on other sites

On 5/22/2017 at 3:45 AM, iben said:

Hello guys,
do you remember old "Paint vehicles" script? Let's look back to idea fathers:

===

CREDITS:
All credits goes to its original authors:

DayZ Epoch developers, collaborators and contributors (thank you guys for your excellent work!) (visit them on github)
Maca134 for orginal color vehicle script.
@Zupa for the idea of painting vehicles in two different colors.
@0verHeaT for script public release - this version we are updating for 1.0.6.1+ (see original thread)
@raymix for list of paintable vehicles for this script (see original thread)

===

This script was updated for Epoch 1.0.6.1 and upgraded. Special thanks goes to @S4M for testing script on his server.

===

FEATURES:

  • Vehicles can be painted in two different colors
  • Only vehicles which you own can be painted (vehicles with key)
  • Only vehicles in ColourVehicles array can be painted
  • Script is designed to be used along with Single currency. Player will pay for painting vehicles.
  • UPDATED: Color values are saved in the worldspace field in database
  • NEW: Vehicles can be unpainted to default state (default textures are loaded)
  • UPDATED: Vehicles can be painted using GUI with visual enhancements. Use PaintVehicles defines.hpp for defining custom GUI color scheme

===

What needs to be done:

  • #todo: check and update vehicle classes in ColourVehicle array: I hope you will share you knowledge here so it's available for all of us, thx guys!
  • #todo: should be compatible with Virtual Garage script (@theduke release - needs multiple confirmations from server owners)

===

Changelog:

  • [2017-05-22], v1.0 | Initial release
  • [2017-05-25], v1.1 | Optimized compiles: 5 files reduced to 1. See changes: [commit  ae29c13]

===

How it looks like:

D86F65EDF949D1ADD387FE352AF0169647C34AC4

=== database screenshot

017539E039856C03C5F7D1DBF50A285C822F867D

===

How to install:
We are not using common way how is script included to current folder structure (like grab whole folder and put it to the root of mission folder) - 
that's why read carefully, use repo folder structure (or similar) and compare tool like diffmerge! If you have troubles, just ask here or send me PM.

Source files are available at Github repo. You can download them from here.

For client side we need these folders in the root of your 'MPMissions\Dayz_Epoch_11.Chernarus' folder:

  • actions: we will store file with scroll action menu command Paint vehicle here
  • compile: we will store core script client files here
  • Configs: we will store defines && dialog config files for script GUI here
  • gui: we will store your "Money" or "Coins" picture here
  • init: we will load all compiles, variables and public eventhandlers from here

... and finaly files:

  • description.ext: we will load your defines and dialogs from here via master.hpp
  • init.sqf: we will load your custom compiles, variables and public EH from here

For server side (dayz_server) we need to touch these files:

  • compiles\server_paintVehicles.sqf (needs to be created)
  • compiles\server_updateObject.sqf
  • system\server_monitor.sqf
  • init\server_functions.sqf

===

Battleye


// Add an exception to publicvariable.txt
!="PVDZE_veh_Color"

===

infiSTAR


// Add an exception to allowed dialogs
571113

===

...that's all, Have Fun!!
Cheers...

===

fnc_SC_uniCoins = compile preprocessFileLineNumbers "dayz_code\compile\fnc_SC_uniCoins.sqf";

could yo explain what/how/why this is?

i saw in another post, but im not 100 percent sure if its something i needed

 

ive not used this before- i see its commeted out in variables- is this needed?

// if (isServer) then {
//   DZE_safeVehicle = [];
// };

Link to comment
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
  • Discord

×
×
  • Create New...