Jump to content
Sign in to follow this  
y-shin

[SOLVED] (vehicle retexture) Van lightbar won't work as intended

Recommended Posts

Hi,

 

I'm trying to do a retexture of vanilla Gendarmerie police van and has been successful halfway. I've got my texture applied and everything.

 

Now what I am seeing is this (sorry for poor quality image):

257556e2bb8b684cadef136922d06a50.jpg

 

So the one toward the front, the vanilla Gendarmerie Police Van, lights up blue when turned on and this is what I want on my vehicle too. The middle one (the vehicle with my texture on) however, lights up red instead of blue.

Other than that, turning on/off the lightbar from scroll menu works, and turning on/off the siren from scroll menu also works.


Here's the code:

Spoiler

class CfgPatches
{
	class ccg_police_units
	{
		author="y-shin";
		name="CCG Police Pack";
		requiredVersion = 0.1;
		requiredAddons[] = 
		{
			"A3_soft_f_orange" // in order to refer to vanilla assets
		};
		units[] = {};
		weapons[] = {};
	};
};

class cfgFactionClasses
{
	class ccg_police_F
	{
		icon = "\ccg_police_units\icon\logo_small.paa";
		displayName = "CCG Central Constabulary";
		priority = 100;
		side = 1;
	};
};

class cfgVehicles
{
	class B_GEN_Offroad_01_gen_F;
	class B_GEN_Offroad_01_covered_F;
	class B_GEN_Van_02_vehicle_F;
	class B_GEN_Van_02_transport_F;
	class TextureSources
	{
		class CCG_Police_Van_TextureSource
		{
			displayName="CCG Police Van";
			textures[]=
			{
				"\ccg_police_units\data\vehicle\van\ccg_police_van.paa",
				"\a3\soft_f_orange\van_02\data\van_wheel_CO.paa",
				"\a3\soft_f_orange\van_02\data\van_glass_gen_CA.paa",
				"\a3\soft_f_orange\van_02\data\van_body_gen_CO.paa"
			};
			materials[]=
			{
				"\a3\Soft_F_Orange\Van_02\Data\van_body.rvmat",
				"\A3\Soft_F_Orange\Van_02\Data\van_wheel.rvmat",
				"",
				"\a3\Data_f\Lights\Car_Beacon_Blue_emit.rvmat"
			};
			factions[]=
			{
				"ccg_police_F"
			};
		};
		class CCG_Police_Van_Transport_TextureSource
		{
			displayName="CCG Police Van (Transport)";
			textures[]=
			{
				"\ccg_police_units\data\vehicle\van\ccg_police_van_transport.paa",
				"\a3\soft_f_orange\van_02\data\van_wheel_transport_CO.paa",
				"\a3\soft_f_orange\van_02\data\van_glass_gen_CA.paa",
				"\a3\soft_f_orange\van_02\data\van_body_gen_CO.paa"
			};
			materials[]=
			{
				"\a3\Soft_F_Orange\Van_02\Data\van_body.rvmat",
				"\A3\Soft_F_Orange\Van_02\Data\van_wheel.rvmat",
				"",
				"\a3\Data_f\Lights\Car_Beacon_Blue_emit.rvmat"
			};
			factions[]=
			{
				"ccg_police_F"
			};
		};
	};
	class CCG_Police_Van : B_GEN_Van_02_vehicle_F // <- This is the one I'm having the problem with :(
	{
		_generalMacro = "B_GEN_Van_02_vehicle_F";
		editorPreview = "\ccg_police_units\data\ui\editor\van.jpg";
		side = 1;
		faction = "ccg_police_F";
		displayName = "CCG Police Van";
		hiddenSelectionsTextures[] = {
			"\ccg_police_units\data\vehicle\van\ccg_police_van.paa",
			"\a3\soft_f_orange\van_02\data\van_wheel_CO.paa",
			"\a3\soft_f_orange\van_02\data\van_glass_gen_CA.paa",
			"\a3\soft_f_orange\van_02\data\van_body_gen_CO.paa"
		};
		textureList[]=
		{
			"CCG_Police_Van_TextureSource",
			1
		};
		class EventHandlers
		{
			init = "(_this select 0) setVariable [""BIS_enableRandomization"", false];if (local (_this select 0)) then {[(_this select 0), false, [""beacon_front_hide"",0,""beacon_rear_hide"",0,""LED_lights_hide"",0,""reflective_tape_hide"",1,""side_protective_frame_hide"",0,""front_protective_frame_hide"",0]] call bis_fnc_initVehicle;};";
		};
	};
	class CCG_Police_Van_Transport : B_GEN_Van_02_transport_F // <- This one however works totally fine :)
	{
		_generalMacro = "B_GEN_Van_02_transport_F";
		editorPreview = "\ccg_police_units\data\ui\editor\van_transport.jpg";
		side = 1;
		faction = "ccg_police_F";
		displayName = "CCG Police Van (Transport)";
		hiddenSelectionsTextures[] = {
			"\ccg_police_units\data\vehicle\van\ccg_police_van_transport.paa",
			"\a3\soft_f_orange\van_02\data\van_wheel_transport_CO.paa",
			"\a3\soft_f_orange\van_02\data\van_glass_gen_CA.paa",
			"\a3\soft_f_orange\van_02\data\van_body_gen_CO.paa"
		};
		textureList[]=
		{
			"CCG_Police_Van_Transport_TextureSource",
			1
		};
		class EventHandlers
		{
			init = "(_this select 0) setVariable [""BIS_enableRandomization"", false];if (local (_this select 0)) then {[(_this select 0), false, [""beacon_front_hide"",0,""beacon_rear_hide"",0,""LED_lights_hide"",0,""reflective_tape_hide"",1,""side_protective_frame_hide"",0,""front_protective_frame_hide"",0]] call bis_fnc_initVehicle;};";
		};
	};
};

 

 

As you can see, I got 2 vehicles; a normal van (CCG_Police_Van), and a transport van with back passenger seats (CCG_Police_Van_Transport). Both are inherited from Gendarmerie Van (Cargo) and Van (Transport) respectively.

The transport one works totally fine and lights up blue just like vanilla Gendarmerie vans, but the normal van lights up red (as shown in the pic).

I've tried to find out how the animation for this specific lightbar works but so far I've got nothing.

 

What I tried:

  1. change the 4th one from hiddenSelectionTextures[], which I assume is for the lightbar anim texture, to a vanilla white van (\a3\Soft_F_Orange\Van_02\Data\van_body_white_CO.paa), as well as textures[] in class TextureSources
    Result: It DID change the color of the side LEDs to yellow, which you normally see on a service van with yellow lightbar.
  2. change the 4th one from hiddenSelectionTextures[] to a default Gendarmerie van (\a3\Soft_F_Orange\Van_02\Data\van_body_gen_CO.paa), as well as textures[] in class TextureSources like shown in the code above
    Result: Nothing changes, the problem persists.
  3. make both of the vehicles refer to the exact same texture file
    Result: Same as #2.
  4. remove the materials[] definition from class TextureSources, as well as remove the entire class TextureSources
    Result: Same as #2.

 

I thought all the settings that are not included in my config will be inherited from the vanilla config, but apparently I have to define specific things on my config.cpp to get certain stuffs to work.

 

Any ideas what is going wrong with my configs?

Share this post


Link to post
Share on other sites

...anyone?

 

EDIT: after posting this 18 minutes ago, I found out the solution myself lol

 

All I did was to add this line:

(_this select 0) setObjectMaterialGlobal [3, ""\a3\Data_f\Lights\Car_Beacon_Blue_emit.rvmat""];

into the definition of class TextureSource -> class EventHandler like this:

init = "
    (_this select 0) setVariable [""BIS_enableRandomization"", false];
    (_this select 0) setObjectMaterialGlobal [3, ""\a3\Data_f\Lights\Car_Beacon_Blue_emit.rvmat""]; // THIS LINE IS ADDED
    if (local (_this select 0)) then {[(_this select 0), false, [""beacon_front_hide"",0,""beacon_rear_hide"",0,""LED_lights_hide"",0,""reflective_tape_hide"",1,""side_protective_frame_hide"",0,""front_protective_frame_hide"",0]] call bis_fnc_initVehicle;};
";

So that it tell to Arma "please include the rvmat for blue light at the initial stage of vehicle creation".

 

If this helps others in any way, I am happy 😉

Edited by y-shin
was bumping to see if anyone knows solution but I found the solution myself

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×