Jump to content

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


iben

Recommended Posts

1 hour ago, DieTanx said:

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 = [];
// };

Hello,

first - could you please edit your post and surround quote by spoiler (always use it if your quote is too long)? Thx

second - 'fnc_SC_uniCoins' is neccesary for script, because it's used for money transaction and player wealth check (player is paying for painting). Without it you get error. Besides, it's universal function for single currency, so it can be used every time you need to manipulate money (if you are developer). More info about fnc_SC_uniCoins you can find in this post.

third - variables, commented part if(isServer)... it's not neccessary for script - it's just there to visualise spot, where to put paintable vehicles array. You can safely remove it, if you don't need it...

Hope it helps,

Cheers

Link to comment
Share on other sites

  • 1 month later...

Just installed working great for me.  After pulling vehicles out of garage it takes like 5 seconds for the paint to come back, no biggie. Great Work easy install instructions, thanks for showing all the paint code for easy merging.

Link to comment
Share on other sites

On 5/25/2017 at 10:10 PM, DieTanx said:

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 = [];
// };

Its not needed but say you spawn in a vehicle with a script this should keep it from blowing up once a player gets in it not really sure though.

Link to comment
Share on other sites

15 hours ago, Hooty said:

Just installed working great for me.  After pulling vehicles out of garage it takes like 5 seconds for the paint to come back, no biggie. Great Work easy install instructions, thanks for showing all the paint code for easy merging.

yeah, painting local object globally uses deprec. method and can be slow in some scenarios I guess. Seems garage is one of them...

Link to comment
Share on other sites

My issue was the dialogs and the client / server / both on the compiles / variables files.

 

I've never had to do that before for a plugin, so I think you could maybe break that down for future reference and make people aware that in those files in the "Init" folder, 

(compiles, PublicEH and variables .sqf)

there's client / server / both / sections. make sure you paste the bits under each relevant section. 

My other issue was in the server_monitor.sqf I already had this piece  of code : 
 

    if (_object isKindOf "AllVehicles") then {
_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;

 

So i had to wrap the other bits around it... 

private ["_pcolor","_pcolor2","_clrinit","_clrinit2"];

and

 

      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+"];";
          };
        };
      };


Thanks for a great plugin! Keep up the good work.

Link to comment
Share on other sites

9 minutes ago, JakeQue said:

I've never had to do that before for a plugin, so I think you could maybe break that down for future reference and make people aware that in those files there's client / server / both sections make sure you paste these bits under each section relevant. 

Understood, there was a discussion about this before, you can check it out here.
For rest of your comment - yeah, sometimes we need to be creative when mergin couple plugins code. But as I said, feeling good you made it working and share your experience her for others. Thx a lot for that...

Link to comment
Share on other sites

took a lot of trial and error, i think mostly because you have defined things that already exist in zsc and i didnt see where you instructed me to remove any current defines.

my current master.hpp

#include "Defines\Basic_defines.sqf"
//#include "\z\addons\dayz_code\Configs\RscDisplay\ZSCdefines.hpp"
#include "Defines\PlayerGUI\RscPlayerUIdefines.hpp"
#include "Defines\PaintVehicles\defines.hpp"
//#include "RscDisplay\PlayerGUI\RscPlayerUI.hpp" // @important: here is your RscTitles class (wm_disp - watermark is included)
#include "extra_rc.hpp" // @important: move your extra_rc code here
//#include "RscDisplay\Money\zscATMdialogs.hpp"
//#include "RscDisplay\Money\zscdialogs.hpp"
#include "RscDisplay\PaintVehicles\dialog.hpp"


 

Link to comment
Share on other sites

4 hours ago, kingpapawawa said:

took a lot of trial and error, i think mostly because you have defined things that already exist in zsc and i didnt see where you instructed me to remove any current defines.

I'm very sory for your troubles. Thx for sharing your feelings.
(... just in case you're asking for help - here is one: just use repo files as it is and add things they're not there (and follow pattern how to add extra files),
or just do not add any files into your pack, that's already there. Try to understand, repo for this script is not build common way as it's stated at least in the first post.
If you know, how to work with server/client files as server owner, that should not be a problem. If you do not, don't hesitate to ask specific question here on forum - 
there are a lot of experienced awesome guys willing to help)

Cheers

Link to comment
Share on other sites

  • 1 month later...
On 5. 7. 2017 at 2:46 AM, Hooty said:

Just installed working great for me.  After pulling vehicles out of garage it takes like 5 seconds for the paint to come back, no biggie. Great Work easy install instructions, thanks for showing all the paint code for easy merging.

Hi @Hooty,

I heard about this problem a lot, so I finally looked into virtual garage source code.
Problem is serverside file for spawning vehicle, that tries to recover object textures by statement stored using setVehicleInit.
Not sure which VG version (salival, duke) do you use, but if there is that kind of problem, reason is still the same...it's common scenario to miss process init commands

Fortunately here is easy fix that should make things right (example based on @salival VG version): 

  1. Go to server folder and find server_spawnVehicle.sqf file (probably in server compiles folder)
  2. Find part where script works with 'colours'
  3. Bellow that just put processInitCommands;

... like that:

	// server_spawnVehicle file (server folder)

	// [...]
	if (_colour != "0") then {
		_object setVariable ["Colour",_colour,true];
		_clrinit = format ["#(argb,8,8,3)color(%1)",_colour];
		_object setVehicleInit "this setObjectTexture [0,"+str _clrinit+"];";
	};

	if (_colour2 != "0") then {			
		_object setVariable ["Colour2",_colour2,true];
		_clrinit2 = format ["#(argb,8,8,3)color(%1)",_colour2];
		_object setVehicleInit "this setObjectTexture [1,"+str _clrinit2+"];";
	};

    processInitCommands; //@update here
	// [...] rest of code

This special command will process statements stored using setVehicleInit and you start getting your vehicles colored immediately without delay when you spawn them from garage.
I've already sent fix to salival and he commited the fix to source code.

Hope it helps for better player experience,

Cheers...

Link to comment
Share on other sites

Hello guys,

...just released update to v1.2 (see changelog above)

===

Main headlines:
Thanks to great cooperation with @salival we managed make paint vehicles script compatible with Virtual garage and Key vehicle changer (VKC).
That means for exmaple:

  • no more recoloring delay (cca 5sec) when vehicle was spawned from virtual garage
  • no more losing colors when player changed key of colored vehicle

If you have paint vehicle script installed and along with virtual garage and VKC, you should definitely update all scripts to the latest version for better player experience.

===

Paint vehicles script v1.2 you can download from here.

===

Check updated version of scripts in action:

===

Cheers... have fun!

 

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

not work Reset paint

 

RPT log

 9:45:50 "=== [IBEN WAI AUTOCLAIM ADDON, v1.3.1] || DEBUG [find_position.sqf] >> 'iben_wai_ACcoordProtectorTimer' active (300s) >> Initialising custom position FNC for mission coord protection..."
 9:45:51 Error in expression <ring (_textArr select 0));
_texture2 = (toString (_textArr select 1));

_object >
 9:45:51   Error position: <toString (_textArr select 1));

_object >
 9:45:51   Error Generic error in expression
 9:45:51 File z\addons\dayz_server\compile\paintVehicles\server_paintVehicles.sqf, line 54

 

any idea?

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...