Jump to content
MattL

[RELEASE] Random Skin based on Sex

Recommended Posts

Hollowaddiction requested this one from me after being bugged by a female player for a couple weeks. What this does (the way I have it set up) is select a random skin (from the list given) and either spawns the player as that skin OR adds the skin to their inventory at random. This is configurable. You can add it in to your server in a couple of different ways, like as a pay for skin option when right clicking on gold or whatever you want, really. 

Requirements (PBO Manager and Notepad ++)

  • Easy = Blue <10

Installation Steps - 
1. go into your dayz_server\compiles folder and find server_playerSetup.sqf, locate the line that looks like 

dayzPlayerLogin2 = [_worldspace,_state];

and replace it with 

dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];

and repack your server pbo

 

2. open up your mission folder / pbo and open the init.sqf and put this at the bottom : 

sexcheck = compile preprocessFileLineNumbers "scripts\sexcheck.sqf";
waitUntil {!isNil ("PVDZE_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2) then
{
    player spawn sexcheck;
};

change the filepath accordingly
3. download this file and place it in a scripts folder 
4. configure
5. enjoy

 

Credits -

HollowAddiction for the idea

Share this post


Link to post
Share on other sites

Nice release!

Can you explain me what is buggy when you use usemorph?

And with the script I'm sure you can get random loadouts to work too ;)

 

Thanks for the release,

xBowBii

before I released it, when I was still stress testing it, some of the female skins would get you stuck in debug fields on morph, pre-release I isolated these skins and removed them from the morph list but left the notice up there as a warning that anything can, and probably will happen haha.

Share this post


Link to post
Share on other sites

Great idea, i will give it a try! When the server gets empty!

 

 

 

 

 

EDIT: BTW didn´t u  make the crashsite marker script on Opendayz? if yes could u help getting it to work?

Edited by Mr.Exodus

Share this post


Link to post
Share on other sites

why are you not implementing this into the player_monitor.fsm?

 

it would be a much better way to do it, instead of switching the players skin after he already spawned in, not to mention the switch might prevent the backpack being added to the player, as the player is not always ready right after using player_humanityMorph.

 

also, why use two diffrent checks to check for the sex?

imo you should just use the check for what skintype they are wearing since you can only spawn as either survivor or female unless edited before this (iirc bandits are switched after entering the game) and i doubt its quicker to check config than to check if the skin is in one of two in an array.

Share this post


Link to post
Share on other sites

why are you not implementing this into the player_monitor.fsm?

 

it would be a much better way to do it, instead of switching the players skin after he already spawned in, not to mention the switch might prevent the backpack being added to the player, as the player is not always ready right after using player_humanityMorph.

 

also, why use two diffrent checks to check for the sex?

imo you should just use the check for what skintype they are wearing since you can only spawn as either survivor or female unless edited before this (iirc bandits are switched after entering the game) and i doubt its quicker to check config than to check if the skin is in one of two in an array.

Firstly, if you checked the epoch block of code you would clearly see 

_pack = unitBackPack player;
_packToAdd = typeOf _pack;
removeBackpack player;
uisleep 1;
[dayz_playerUID,dayz_characterID,_morph] spawn player_humanityMorph;
uisleep 1;
player addBackpack _packToAdd;


lastly, there is only one check for sex.  it checks if they are wearing any skin that is designated as a female skin by the cfgSurvival.hpp like so, 

	_type = typeOf player;
	_girltype = "Skin_" + _type;
	_currentSex = getText (configFile >> "CfgSurvival" >> "Skins" >> _girltype >> "sex");
	if (_currentSex == "female") then { 

and in cfgSurvival : 

	class Skin_GUE_Soldier_2_DZ : Default {
			sex = "male";
			playerModel = "GUE_Soldier_2_DZ";
		};
		
		class Skin_BanditW1_DZ : Default {
			sex = "female";
			playerModel = "BanditW1_DZ";
		};
		

but anyways, I don't know why you are pointing out flaws and asking questions when this script is now moot. 1051 added this in by default, all you have to do is put this in your init.sqf :

_male = ["Male skin1","Male skin2","Male skin3","Male skin4"] call BIS_fnc_selectRandom;
_female = ["Female skin1","Female skin2","Female skin3","Female skin4"] call BIS_fnc_selectRandom;
DZE_defaultSkin = [_male,_female];

Share this post


Link to post
Share on other sites

but anyways, I don't know why you are pointing out flaws and asking questions when this script is now moot. 1051 added this in by default, all you have to do is put this in your init.sqf :

_male = ["Male skin1","Male skin2","Male skin3","Male skin4"] call BIS_fnc_selectRandom;
_female = ["Female skin1","Female skin2","Female skin3","Female skin4"] call BIS_fnc_selectRandom;
DZE_defaultSkin = [_male,_female];

 

I tried that in my init.sqf but I didn't spawn with a random skin:

 

_male = ["Sniper1_DZ","Camo1_DZ","Rocket_DZ","Soldier1_DZ","RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","GUE_Commander_DZ","Functionary1_EP1_DZ","Priest_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","GUE_Soldier_Sniper_DZ","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ"] call BIS_fnc_selectRandom;
_female = ["SurvivorWpink_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ"] call BIS_fnc_selectRandom;
DZE_defaultSkin = [_male,_female];

Share this post


Link to post
Share on other sites

 

I tried that in my init.sqf but I didn't spawn with a random skin:

 

_male = ["Sniper1_DZ","Camo1_DZ","Rocket_DZ","Soldier1_DZ","RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","GUE_Commander_DZ","Functionary1_EP1_DZ","Priest_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","GUE_Soldier_Sniper_DZ","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ"] call BIS_fnc_selectRandom;
_female = ["SurvivorWpink_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ"] call BIS_fnc_selectRandom;
DZE_defaultSkin = [_male,_female];

 

depends on where you put it in your init.

 

Usually you would put configs like that above the compiles lines, but for BIS_fnc_selectRandom to work it has to be below them. 

Share this post


Link to post
Share on other sites

Thanks for the awesome release Matt.

 

We had this in our server for a few days then started noticing issues with custom loadouts. Our UID based custom loadouts would work, but backpack items would not spawn in. I think this is due to the sexcheck.sqf executing after the loadout is deployed, which removes content from backpack. 

 

Is there anything that could be done to allow custom loadouts to function correctly with this?

Share this post


Link to post
Share on other sites

Thanks for the awesome release Matt.

 

We had this in our server for a few days then started noticing issues with custom loadouts. Our UID based custom loadouts would work, but backpack items would not spawn in. I think this is due to the sexcheck.sqf executing after the loadout is deployed, which removes content from backpack. 

 

Is there anything that could be done to allow custom loadouts to function correctly with this?

https://www.dropbox.com/s/a6lqr18krlb3c0j/sexcheck.sqf?dl=0

not 100% sure it will work, but it should. If you have any issues with it let me know (and let me know the issue / error)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By unerground2
      Hey Guys i wonder if theres an option to switch weapon textures- IN game like with vehicles etc... . 
       
      I played around with MAS1.8 and changed some textures in the client side.
       
      Heres my AWP Lightning strike from CS GO
      And Running in Epoch on my Server.

    • By SilverWind252
      Fixed it! Never mind
    • By maddingamer
      Do somebody know if I can change the textures for vehicles? (like e.g. in altis life) 

      And if yes, how? 
      Thanks :)
    • By Matijs
      This might be not the way to do this, but I dont reallly care, because it works.
      This script was made for a server to be able to have random spawns. (Spawn points given by the administrator.)

      Make a script called spawnpoints.sqf:
      if (isNil "inSpawnPoint") then { inSpawnPoint = false; }; while {true} do { waitUntil { inSpawnPoint }; titleText [format["Entering Spawn Point."],"PLAIN DOWN"]; titleFadeOut 4; waitUntil { player == vehicle player }; thePlayer = vehicle player; _spawnpointsarray = [ [1745,2107,0.1], [2737,1980,0.1], [3663,2130,0.1], [4109,2317,0.1], [4813,2086,0.1], [5825,2023,0.1], [6357,2082,0.1], [7198,2533,0.1], [7226,2187,0.1], [8045,2835,0.1], [8577,2320,0.1], [9286,1902,0.1], [9840,1786,0.1], [10466,1886,0.1], [10243,1576,0.1], [10857,2275,0.1], [11939,3402,0.1], [11105,3009,0.1], [13509,6166,0.1], [13081,7804,0.1], [12940,9326,0.1], [13170,10292,0.1] ]; systemChat "[DeadZ] Selecting spawn point..."; _selectspawnpoint = _spawnpointsarray select floor random count _spawnpointsarray; sleep 1; systemChat "[DeadZ] Spawn point selected. Spawning..."; sleep 1; thePlayer setPos _selectspawnpoint; waitUntil { !inSpawnPoint }; titleText [format["Exiting Spawn Point. Have fun."],"PLAIN DOWN"]; titleFadeOut 4; }; In the init.sqf add this: if (!isDedicated) then { [] execVM "spawnpoints.sqf"; }; In your mission sqm, create a sensor called SPAWNPOINT like this: class Sensors { items=1; class Item0 { position[]={6325.6772,0,7807.7412}; //Spawnpoint coords (same as respawn_west & east) activationBy="ANY"; repeating=1; interruptable=1; age="UNKNOWN"; name="SPAWNPOINT"; expCond="(player distance SPAWNPOINT) < 50;"; expActiv="inSpawnPoint = true;"; expDesactiv="inSpawnPoint = false;"; class Effects { }; }; }; And it should spawn you automaticaly after 2 seconds randomly. Also you need to remove your portals, or place them -x in the ground.

      Tell me if you like it.
      This is very nooby, but it works, so no hate.

      EDIT: I think you can remove the sleep 1;, im not sure about this, I just added it in for safety, so the player is definetaly going to a new location.

      Greetings,

      Matijs
    • By Matijs
      UPDATE: I got it working on my other computer, so it was probably a problem with my main desktop pc.
       
      Hey,
       
      I was trying to set up my server; everything works great, but now I got this problem.
      The server randomly stops working. This is what the rpt log file is giving me:
      Mods: @EpochHive Distribution: 0 Version 1.36.128579 Fault time: 2014/12/08 21:59:20 Fault address: 7706AE33 01:0002AE33 C:\Windows\SysWOW64\ntdll.dll file: epoch world: Altis Prev. code bytes: 0A 8B C1 59 94 8B 00 89 04 24 C3 2D 00 10 00 00 Fault code bytes: 85 00 EB E9 90 90 90 90 90 8B FF 55 8B EC 8B 15 Registers: EAX:1E75F000 EBX:00000022 ECX:1E75E80C EDX:0993A492 ESI:00000001 EDI:0000002A CS:EIP:0023:7706AE33 SS:ESP:002B:1E85E838 EBP:1E85E844 DS:002B ES:002B FS:0053 GS:002B Flags:00010206 ======================================================= note: Minidump has been generated into the file SC\arma3server_2014-12-08_21-55-43.mdmp If anyone knows the problem, please tell me.
       
      This is the "Minidump" file that has been generated opened with Visual Studio:
       
         
      Kind Regards,
       
      Matijs
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...