Jump to content

[Release] Chameleon Skin Changer


piggd

Recommended Posts

Mod Features:

This allows user to purchase skins from a menu.

You can change skins with a backpack.

Humanity is backed up and restored after change.

You can make all skins free.

Or some/none skins free, set a global price and define up to four additional special pricing for 4 sets of skins.

Persistent on logout and login.

Removes radio, gps, map, compass and NVG included in some skins but leaves original equipment if equipped before skin purchase (both at purchase and re-log).

Supports both Epoch (351 skins)  and Overpoch (175 skins) by setting a variable.

 

2014-09-01_00002_zpsd5bf513d.jpg

 

Known Issues:

Even though all skin class names are all unique some of the skins have identical appearances.

You have to change back into an epoch skin to use epoch clothes items again (1st one in male and female list - suggest you leave those free)

 

Testing:

All skins have been tested to insure that the inventory, weapon, and backpack slots work.

Special thanks to my user community for all their hard work in testing, especially iSaeko and Laura

I could not have done this without them!

 

Installation:

 

1.   Download the addon from my github by clicking on this link.   (Contains a vanilla epoch chernarus mission.pbo example file).

2.  On the lower left corner click on the button "Download Zip"

3   Create a directory called dayz_code and mission_pbo

4.  Take your mission.pbo file and extract it into the mission_pbo directory

5.  Unzip the zip file you download from my github and move the custom directory into your mission_pbo directory.

6.  Copy C:\Program Files (x86)\Steam\SteamApps\common\ARMA 2 Operation Arrowhead\@DayZ_Epoch\addons\dayz_code.pbo into this new directory (path may vary based on steam installation).

7.  Extract the dayz_code.pbo into the dayz_code directory you created.

8.  if you do not already have a fixes directory create one.

9.  If you do not already have a custom compile then follow these steps otherwise you can skip this step.

    copy dayz_code/init/compiles.sqf  mission_pbo/fixes/compules.sqf

10.  Copy dayz_code/compile/player_switchModel.sqf mission_pbo/fixes/player_switchModel.sqf

11.  Edit your init.sqf file and make the following modifications:

 

from:

//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";				//Initilize the Variables (IMPORTANT: Must happen very early)

to:

//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";				//Initilize the Variables (IMPORTANT: Must happen very early)
// ------------------------------------------------------------------------ Chameleon - Skin Changer Start  ------------------------------------------------------------------------
call compile preprocessFileLineNumbers "custom\chameleon\chameleon_init.sqf";	
// ------------------------------------------------------------------------ Chameleon - Skin Changer End  ------------------------------------------------------------------------from:
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions

to :

progressLoadingScreen 0.4;
// ------------------------------------------------------------------------ Chameleon Skin Changer Start ------------------------------------------------------------------------
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
call compile preprocessFileLineNumbers "fixes\compiles.sqf";                //Compile regular functions
// ------------------------------------------------------------------------ Chameleon Skin Changer End ------------------------------------------------------------------------

from:

    //Lights
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
 
};

to:


** NOTE - If you are using this entry will already exist with a different comment.

    //Lights
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf"; 
// ------------------------------------------------------------------------Chameleon Skin Changer Start ------------------------------------------------------------------------
// Activate Player Menu for Tools
    [] execVM "custom\playertools\activate_player_menu.sqf";
// ------------------------------------------------------------------------Chameleon Skin Changer Start ------------------------------------------------------------------------
    
};

12.  Edit your fixes\compiles.sqf file and make the following modifications:

 

from:

    player_switchModel =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";

to:

// ------------------------------------------------------------------------ Chameleon Skin Changer Start ------------------------------------------------------------------------
//    player_switchModel =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
    player_switchModel =        compile preprocessFileLineNumbers "fixes\player_switchModel.sqf";
// ------------------------------------------------------------------------ Chameleon Skin Changer End ------------------------------------------------------------------------

13.  Edit your fixes\player_switchModel.sqf file and make the following modifications:

 

from

//private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_playerObjName","_wpnType","_ismelee"];

to:

// ------------------------------------------------------------------------ Chameleon Skin Changer Start ------------------------------------------------------------------------
//private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_playerObjName","_wpnType","_ismelee"];
private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_playerObjName","_wpnType","_ismelee","_hasCompass","_hasRadio","_hasGPS","_hasWatch","_hasMap","_hasNVG"];
// ------------------------------------------------------------------------ Chameleon Skin Changer End ------------------------------------------------------------------------

from:

//BackUp Player Object
_oldUnit = player;

to:
//BackUp Player Object
_oldUnit = player;

// ------------------------------------------------------------------------ Chameleon Duplicate Item Fix Start ------------------------------------------------------------------------
_hasCompass = false;
_hasRadio = false;
_hasGPS = false;
_hasWatch = false;
_hasMap = false;
_hasNVG = false;
if (player hasWeapon "ItemCompass") then {_hasCompass = true;};
if (player hasWeapon "ItemRadio") then {_hasRadio = true;};
if (player hasWeapon "ItemGPS") then {_hasGPS = true;};
if (player hasWeapon "ItemWatch") then {_hasWatch = true;};
if (player hasWeapon "ItemMap") then {_hasMap = true;};                
if (player hasWeapon "NVGoggles") then {_hasNVG = true;};                
// ------------------------------------------------------------------------ Chameleon Duplicate Item Fix End ------------------------------------------------------------------------

from:

if (_ismelee == "true") then {
    call dayz_meleeMagazineCheck;
};

to:

if (_ismelee == "true") then {
    call dayz_meleeMagazineCheck;
};
// ------------------------------------------------------------------------ Chameleon Duplicate Item Fix Start ------------------------------------------------------------------------
if (!_hasCompass) then {_newUnit removeWeapon "ItemCompass";};
if (!_hasRadio) then {_newUnit removeWeapon "ItemRadio";};
if (!_hasGPS) then {_newUnit removeWeapon "ItemGPS";};    
if (!_hasWatch) then {_newUnit removeWeapon "ItemWatch";};
if (!_hasMap) then {_newUnit removeWeapon "ItemMap";};
if (!_hasNVG) then {_newUnit removeWeapon "NVGoggles";};
// ------------------------------------------------------------------------ Chameleon Duplicate Item Fix End ------------------------------------------------------------------------

14.  Edit description.ext add the following lines to the end of the file.

//------------------------------------------------------------------------ Chameleon - Skin Changer Start ----------------------------------------------------------------
#include "custom\chameleon\dialog\common.hpp"
#include "custom\chameleon\dialog\SkinGui.hpp"
//------------------------------------------------------------------------ Chameleon - Skin Changer End-------------------------------------------------------------------

**NOTE if you already have installed you only need one common.hpp , comment out the second one by placing a // in front of it.

 

Optional Additional Configuration:

** Enable Overpoch

 

1. Edit custom/chameleon/ chameleon_init.sqf and change the following:

** NOTE: This variable can be placed in the init.sqf or variables.sqf if you prefer.

from:

// *************************************************************************************************************************
// Uncomment the line below to activate Overpoch Skins or add this variable to your init.sqf file. Above your chameleon_init.sql call.
// CSC_WORLD = "overpoch";
// *************************************************************************************************************************

to:

// *************************************************************************************************************************
// Uncomment the line below to activate Overpoch Skins or add this variable to your init.sqf file. Above your chameleon_init.sql call.
 CSC_WORLD = "overpoch";
// *************************************************************************************************************************

** Change Pricing

1. Edit custom/chameleon/ chameleon_init.sqf and change the following:


//CSCFreeSkins = true;
CSCFreeSkins = false;
CSCFreePrice = ["ItemGoldBar",0];

// Regular Skin Price
CSCGlobalPrice = ["ItemGoldBar",4];  // Do not set to 0 unless you have CSCFreeSkins = true;
//CSCGlobalPrice = ["ItemGoldBar10oz",2];  // Do not set to 0 unless you have CSCFreeSkins = true;
//CSCGlobalPrice = ["ItemBriefcase100oz",2];  // Do not set to 0 unless you have CSCFreeSkins = true;

// Special Skin Prices
CSCSpecialPrice1 = ["ItemGoldBar",2]; // Do not set to 0
CSCSpecialPrice2 = ["ItemGoldBar10oz",1]; // Do not set to 0
CSCSpecialPrice3 = ["ItemGoldBar",6]; // Do not set to 0
CSCSpecialPrice4 = ["ItemGoldBar",7]; // Do not set to 0

Change the CSCFreeSkins  to true to make all skins free or adjust individual variables for the prices you want and then add or remove skins from the list array to match.

 

**  DZE Banking System 

If you are using and have replaced custom/playertools/player_tools_main.sqf you will need to uncomment the following lines.

 

from:

playermenustart = [
    ["",true],
    ["Chameleon Male Skins Menu",[],"", -5,[["expression",format[_EXECscript1,_pathtochameleon + "male_dialog.sqf"]]],"1","1"],
    ["Chameleon Female Skins Menu",[],"", -5,[["expression",format[_EXECscript1,_pathtochameleon + "female_dialog.sqf"]]],"1","1"],
//    ["DZE Piggd Banking System >>", [], "#USER:bankmenu", -5, [["expression", ""]], "1", "1"],            
//    ["Weather/Time Menu (Local Only) >>", [], "#USER:WTMenu", -5, [["expression", ""]], "1", "1"],            
    ["", [], "", -5, [["expression", ""]], "1", "0"],
    ["Main Menu", [20], "#USER:playermenustart", -5, [["expression", ""]], "1", "1"]        
];

to:

playermenustart = [
    ["",true],
    ["Chameleon Male Skins Menu",[],"", -5,[["expression",format[_EXECscript1,_pathtochameleon + "male_dialog.sqf"]]],"1","1"],
    ["Chameleon Female Skins Menu",[],"", -5,[["expression",format[_EXECscript1,_pathtochameleon + "female_dialog.sqf"]]],"1","1"],
    ["DZE Piggd Banking System >>", [], "#USER:bankmenu", -5, [["expression", ""]], "1", "1"],            
//    ["Weather/Time Menu (Local Only) >>", [], "#USER:WTMenu", -5, [["expression", ""]], "1", "1"],            
    ["", [], "", -5, [["expression", ""]], "1", "0"],
    ["Main Menu", [20], "#USER:playermenustart", -5, [["expression", ""]], "1", "1"]        
];

15.  Repack your mission pbo and upload to your sever.

 

Original Framework and Dialog based on from

 

Email: [email protected]
Website: Piggd Dayz Gaming
Donate to piggd

 
Link to comment
Share on other sites

You can put the addaction to your traders with your fn_selfactions.sqf or if you want to use only one trader or only 2 or 3 traders you have to use a way with publicVariables.

With other words, ofcourse this is possible.

 

But i have a question, too:

If i use an INS Skin for example, the AI sint shooting at me anymore. Do i have to remove one fraction out of the skin menu and give the AI just one other fraction which isnt in the skin list of this script or is there any other option to setup the AI shooting at everything ?

Link to comment
Share on other sites

I think you should be able to put it on a vendor following boyd's instruction but my default it runs off a separate menuing system.

 

I am not an expert in this area but my understanding is when your character gets created it gets assigned to a side to the "west" side and in DZAI for instance these lines are in the init

 

//Set side relations
 createCenter east; 
east setFriend [west, 0];        
west setFriend [east, 0];

 

1st line is needed so the AI can talk to each other then it basically is saying east hates west and west hates east.  So I do not think it controlled by what skin you wear but how the character and AI are created. But I have not had any reports of any players not being shot at by AI they seem to like to kill people ;)  If someone knows better than i please speak up this is my layman understanding of the issue,

 

 

Link to comment
Share on other sites

Thank you for this code :)

if (player hasWeapon "ItemCompass") then {_hasCompass = true;};
if (player hasWeapon "ItemRadio") then {_hasRadio = true;};
if (player hasWeapon "ItemGPS") then {_hasGPS = true;};
if (player hasWeapon "ItemWatch") then {_hasWatch = true;};
if (player hasWeapon "ItemMap") then {_hasMap = true;};                
if (player hasWeapon "NVGoggles") then {_hasNVG = true;};  
Link to comment
Share on other sites

Great skin changer.. 

Only getting this in my RPT

 

Error in expression <tion _idx;
_idx = -1;
};
};
Sleep 2;
};
_veh removeAction _idx;
_idx = -1;
>
Error position: <_veh removeAction _idx;
_idx = -1;
>
Error Undefined variable in expression: _veh
File mpmissions\__cur_mp.Chernarus\custom\playertools\activate_player_menu.sqf, line 36

 

 

 

 

Link to comment
Share on other sites

Does this work with an actual trader like boyd's script or you can just pop the menu up at anytime?

 

This will add the menu to all traders !!

 

Add this to the fn_selfActions.sqf below  the dog actions.. 

if (_isMan && !_isPZombie && _traderType in serverTraders) then {
if ((speed player <= 1) && _canDo) then { 
        if (s_player_trade < 0) then {
            s_player_trade= player addaction["Instant Skin Menu","custom\playertools\player_tools_main.sqf",cursorTarget,5,false,true,"",""];
        };
    } else {
        player removeAction s_player_trade;
        s_player_trade = -1;

    };
  };

Add this below //Others

//Others
	
// Start Skin menu
player removeAction s_player_trade;
s_player_trade = -1;
// End skin menu
player removeAction s_player_bury_human;
s_player_bury_human = -1;
player removeAction s_player_pzombiesfeed;
s_player_pzombiesfeed = -1;
player removeAction s_player_hippy;
s_player_hippy = -1;

Delete this part in init.sqf

// ------------------------------------------------------------------------Chameleon Skin Changer Start ------------------------------------------------------------------------
// Activate Player Menu for Tools
    [] execVM "custom\playertools\activate_player_menu.sqf";
// ------------------------------------------------------------------------Chameleon Skin Changer Start ------------------------------------------------------------------------
    
};

And your good to go  ;)

Link to comment
Share on other sites

This will add the menu to all traders !!

 

Add this to the fn_selfActions.sqf below  the dog actions.. 

if (_isMan && !_isPZombie && _traderType in serverTraders) then {
if ((speed player <= 1) && _canDo) then { 
        if (s_player_trade < 0) then {
            s_player_trade= player addaction["Instant Skin Menu","custom\playertools\player_tools_main.sqf",cursorTarget,5,false,true,"",""];
        };
    } else {
        player removeAction s_player_trade;
        s_player_trade = -1;

    };
  };

Add this below //Others

//Others
	
// Start Skin menu
player removeAction s_player_trade;
s_player_trade = -1;
// End skin menu
player removeAction s_player_bury_human;
s_player_bury_human = -1;
player removeAction s_player_pzombiesfeed;
s_player_pzombiesfeed = -1;
player removeAction s_player_hippy;
s_player_hippy = -1;

Delete this part in init.sqf

// ------------------------------------------------------------------------Chameleon Skin Changer Start ------------------------------------------------------------------------
// Activate Player Menu for Tools
    [] execVM "custom\playertools\activate_player_menu.sqf";
// ------------------------------------------------------------------------Chameleon Skin Changer Start ------------------------------------------------------------------------
    
};

And your good to go  ;)

Thanks. How would I go about adding to just 1 specific trader? I already have a custom trader just for skins that I would like to continue using.

Link to comment
Share on other sites

Thanks. How would I go about adding to just 1 specific trader? I already have a custom trader just for skins that I would like to continue using.

 

 

Check this post from Boyd. 

look for this in your Mission.sqm
   
class Groups
    {
        items=2; // if 3 change it too 4 etc.

Change it to:
	class Groups
	{
		items=3; // if 3 change it too 4 etc.

Now look for this at around line 1155:

		class Item1
		{
			side="LOGIC";
			class Vehicles
			{
				items=1;
				class Item0
				{
					position[]={8810.7705,138.52499,11751.518};
					id=50;
					side="LOGIC";
					vehicle="FunctionsManager";
					leader=1;
					lock="UNLOCKED";
					skill=0.60000002;
				};
			};
		};


After the "};" add this:

		class Item2
		{
			side="GUER";
			class Vehicles
			{
				items=1;
				class Item0
				{
					position[]={6303.8,0.001,7795.03};//Trader City Stary the position you want!
					azimut=138.222;
					special="NONE";
					id=101;
					side="GUER";
					vehicle="UN_CDF_Soldier_SL_EP1"; // the trader you want
					leader=1;
					skill=0.60000002;
					init="this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;this enableSimulation false;this setcaptive true;this addAction [""Instant Skin Menu"",""custom\playertools\player_tools_main.sqf""]";
				};
			};
		};

This should work

Link to comment
Share on other sites

Check this post from Boyd. 

look for this in your Mission.sqm
   
class Groups
    {
        items=2; // if 3 change it too 4 etc.

Change it to:
	class Groups
	{
		items=3; // if 3 change it too 4 etc.

Now look for this at around line 1155:

		class Item1
		{
			side="LOGIC";
			class Vehicles
			{
				items=1;
				class Item0
				{
					position[]={8810.7705,138.52499,11751.518};
					id=50;
					side="LOGIC";
					vehicle="FunctionsManager";
					leader=1;
					lock="UNLOCKED";
					skill=0.60000002;
				};
			};
		};


After the "};" add this:

		class Item2
		{
			side="GUER";
			class Vehicles
			{
				items=1;
				class Item0
				{
					position[]={6303.8,0.001,7795.03};//Trader City Stary the position you want!
					azimut=138.222;
					special="NONE";
					id=101;
					side="GUER";
					vehicle="UN_CDF_Soldier_SL_EP1"; // the trader you want
					leader=1;
					skill=0.60000002;
					init="this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;this enableSimulation false;this setcaptive true;this addAction [""Instant Skin Menu"",""custom\playertools\player_tools_main.sqf""]";
				};
			};
		};

This should work

I already have the custom trader from boyd's post. Pretty sure this is what I was looking for to make it work with my trader: addAction [""Instant Skin Menu"",""custom\playertools\player_tools_main.sqf""]";

Thanks man!

Link to comment
Share on other sites

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

Players are getting kicked for  BadVar 2: helpmenu. I have changed helpmenu to helpmenuu as suggested in the Piggd Banking Thread. I have also added "#USER:playermenustart", "#USER:Helpmenu" and "#USER:ChameleonMenu" to the AH. Any other ideas what I could try?

Link to comment
Share on other sites

Any ideas on how I could number the skins in the list, or something to make them a little easier to identify? Some players are getting teleported, or losing all their gear with certain skins and when I ask them what skin it was so I can test it further and remove as necessary, they can't tell me.

CSCMenClothing = [
"Survivor2_DZ",
"BAF_ASoldier_DDPM",
"BAF_ASoldier_MTP",
"BAF_ASoldier_W",
"BAF_crewman_DDPM",
"BAF_crewman_MTP",
"BAF_creWman_W",
"BAF_Pilot_DDPM",
"BAF_Pilot_MTP",
"BAF_Pilot_W",
"BAF_Soldier_AA_DDPM",
"BAF_Soldier_AA_MTP",
"BAF_Soldier_AA_W",
"BAF_Soldier_AAA_DDPM",
"BAF_Soldier_AAA_MTP",
"BAF_Soldier_AAA_W",
"BAF_Soldier_AAR_DDPM",
"BAF_Soldier_AAR_MTP",
"BAF_Soldier_AAR_W",
"BAF_Soldier_AAT_DDPM",
"BAF_Soldier_AAT_MTP"

I tried adding number like this : 

CSCMenClothing = [
"1.Survivor2_DZ",
"2.BAF_ASoldier_DDPM",
"3.BAF_ASoldier_MTP",
"4.BAF_ASoldier_W",
"5.BAF_crewman_DDPM",
"6.BAF_crewman_MTP",
"7.BAF_creWman_W",
"8.BAF_Pilot_DDPM",
"9.BAF_Pilot_MTP",
"10.BAF_Pilot_W",
"11.BAF_Soldier_AA_DDPM",
"12.BAF_Soldier_AA_MTP",
"13.BAF_Soldier_AA_W",
"14.BAF_Soldier_AAA_DDPM",
"15.BAF_Soldier_AAA_MTP"
 

but all that did was teleport everyone that put a skin on to the debug, stripped them of everything and left them there. I just need something that shows in the menu for players.

Link to comment
Share on other sites

  • 6 months later...

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