Custom skins as drops

P1-Kashwak

Member
OK i have read all about adding custom skins and have them working, but i have them changing in the DB, what I would like to do is have them as drops like the camo and sniper skins are.

So what is the proper way to get them as parcels?

do i just add them to the loot spawns?
 
I would like to post a link on tunngle, but for some reason I can't... Ok all credits go to Dimedius for the following. Helped me very much. Thanks to him again:


I start in dayz_code>config and add a new entry for the new model

Code:
class Camo2_DZ : Soldier_Crew_PMC {
                displayName = "Survivor";
                side = TWest;
                weapons[] = {"Throw", "Put"};
                backpack = "";
                magazines[] = {};
                (model = use whatever model you wish)
                respawnWeapons[] = {"Throw", "Put"};
                respawnMagazines[] = {};
                weaponSlots = 1  +      4        + 12*          256      + 2*  4096    +      2        + 8*  16  + 12*131072;
                canHideBodies = true;
        };


Under dayz_equip>config I add a new skinbase
Code:
        class Skin_Camo2_DZ : SkinBase {
                scope = public;
                displayName = $STR_EQUIP_NAME_47;
                descriptionShort = $STR_EQUIP_DESC_47;
        };


Then under dayz_code>actions>player_wearClothes add
Code:
        case "Skin_Camo2_DZ": {
                [dayz_playerUID,dayz_characterID,"Camo2_DZ"] spawn player_humanityMorph;
        };

below the other skin_soldier1 etc. This will make it so when you use the package it does the morphing thing and retains the info when using parcels (i.e. if you dont use this, all your parcels will become civilian clothing after putting your original back on).

of course find

Code:
if (!_isNew) then {
        //RETURNING CHARACTER       
        _inventory =    _primary select 4;
        _backpack =    _primary select 5;
        _survival =            _primary select 6;
        _model =                _primary select 7;
        _hiveVer =              _primary select 8;
     
        if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","SurvivorW2_DZ","Camo2_DZ"])) then {
                _model = "Survivor2_DZ";
        };
     
} else {
        _model =                _primary select 3;
        _hiveVer =              _primary select 4;
        if (isNil "_model") then {
                _model = "Survivor2_DZ";
        } else {
                if (_model == "") then {
                        _model = "Survivor2_DZ";
                };
        };

and add your unique name for it (mine still being the Camo2_DZ). My anim config is clean of any banned items, I've tried this with it added to variables sqf and it not being in there and works fine. The only problem is that like I said before, whenever I log out it resets the skin to default.
 
yes i know all of that, what i am looking for is how do i make them into a parcel!

do i just add them to the loot spawns or is there somewhere else i need to add them.
 
With the code above you already made them into a parcel. Now you can add them to the lottables in the dayz_code->config.cpp or add them through the database
 
An FYI, if you create your own references to add new lootable skins, your players must have your files, or all people wearing said skins will be invisible.
 
EDIT:

I've got working skins, I'll post my code when I get home tonight.

I would check that Camo2_DZ and Skin_Camo2_DZ is actually correct, it might be that you have 2 references but I think it's fine looking at it.
 
ok i got it working but having a little bit of a problem.

1. when putting on the skin every now and then i take damage.

I have looked over my code and everything seems right. any ideas? or has anyone ran across this b4?
 
Also get broken legs sometimes when putting on skins, or take slight damage. I assumed it was because you were actually SWAPPING SKELETONS when you change skins, as twisted as that sounds. I looked at it for awhile, but just gave up on it.
 
This post really helped me get custom skin parcels working. One problem I do have though is the custom parcels in the inventory will not save to the DB like the ghillie suit and camo do.

The model saves for the player, but if I have any of the custom parcels in my players inventory, log out, then login, they are gone. I also confirmed this when logging out and looking at the DB inventroy for the player and where the Skin_Whatever_DZ should be, is "".

Any Ideas?
 
TorturedChunk - There's one more file that they didn't bother to mention that might be important.

Within Dayz_Code.pbo, in the sub directory called INIT, change your Variables.sqf to include your new skin names. Folow the same generic format the standard skins have within that file.

As Example.... here's how the start of the file looks.
Code:
disableSerialization;
 
//Model Variables
Bandit1_DZ =    "Bandit1_DZ";
Bandit2_DZ =    "Bandit2_DZ";
BanditW1_DZ =    "BanditW1_DZ";
Survivor1_DZ =    "Survivor2_DZ";
Survivor2_DZ =    "Survivor2_DZ";
SurvivorW2_DZ = "SurvivorW2_DZ";
Sniper1_DZ =    "Sniper1_DZ";
Sniper2_DZ =    "Sniper2_DZ";
Camo1_DZ =        "Camo1_DZ";
Camo2_DZ =        "Camo2_DZ";
Camo3_DZ =        "Camo3_DZ";
Camo4_DZ =        "Camo4_DZ";
 
Nope that isn't necessary anymore I think. I haven't done it and it works fine for me. Also the variables have nothing to do with the parcels, because the parcels are usually named for example "Skin_Camo1_DZ" and the models just "Camo1_DZ".
 
I added them in after redoing everything. And they are working. I did find that last spot to put them as you said McKeighan. Thank you!
 
Hey, in regards to dayz_equip>config is in quite a few random letters, and I have no idea why. Also, in the config for dayz_code, where should I put the cLass? I royally messed up on this. Any help is greatly appreciated!
 
Scratch that. It spawns in hat when I went to test it I set the probability that it would spawn to a 100% and most of the barracks were empty but the parcels still won't spawn. If I could show how I coded it could somebody tell me what I did wrong? Any help is greatly appreciated.
 
Legion, send me a PM with the code in your equip.pbo (config.cpp), and your cfgvehicles.hpp from your code.pbo and I'll take a look.
 
Back
Top