Jump to content
  • 0

Random Starting skin


sparrow8332

Question

ive been trying to setup where a player has a random model skin on new spawn instead of the std survivor skin but no matter what i do i always fresh spawn in as a survivor and no other skin. this is how i have my server_playerLogin.sqf set as 

	if (!(_model in AllPlayers)) then {
	 _model = ["Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ",
	 "RU_Policeman_DZ","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ",
	 "TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ",
	 "GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ"] select floor random 24;
	};
} else {
	_isInfected =	_primary select 3;
	_model =		_primary select 4;
	_hiveVer =		_primary select 5;
	
	if (isNil "_model") then {
	 _model = ["Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ",
	 "RU_Policeman_DZ","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ",
	 "TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ",
	 "GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ"] select floor random 24;
	} else {
		if (_model == "") then {
	 _model = ["Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ",
	 "RU_Policeman_DZ","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ",
	 "TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ",
	 "GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ"] select floor random 24;
		};
	};

PLEASE could i get some help on this . thanks

even tried this and still no luck . 

    if (!(_model in ["FR_Rodriguez_DZ","GUE_Soldier_2","GUE_Soldier_CO_DZ","GUE_Soldier_2","FR_R","TK_INS_Soldier_EP1_DZ","Soldier_Bodyguard_AA12_PMC_DZ","GUE_Soldier_MG,GUE_Commander","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","Rocket_DZ"])) then {
    _model = ["TK_INS_Warlord_EP1_DZ","FR_R","FR_Rodriguez_DZ","GUE_Soldier_CO_DZ","TK_INS_Soldier_EP1_DZ","Soldier_Bodyguard_AA12_PMC_DZ"] select floor random 7;
    };
       
} else {
	_isInfected =	_primary select 3;
	_model =		_primary select 4;
	_hiveVer =		_primary select 5;
	
	if (isNil "_model") then {
		_model = "Survivor2_DZ";
	} else {
		if (_model == "") then {
			_model = "Survivor2_DZ";
		};
	};
	RandomModels = [
		"SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWsequishaD_DZ",
		"SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ","SurvivorW2_DZ","Bandit1_DZ",
		"Bandit2_DZ","BanditW1_DZ","BanditW2_DZ","Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ",
		"Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ",
		"GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ",
		"pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor",
		"pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest",
		"Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ",
		"CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ",
		"FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ",
		"GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ"
	];

	if (!(_model in AllPlayers)) then {
		_numModels = ((count RandomModels) - 1);
		_model = RandomModels select (random _numModels);
	};
	
} else {
	_isInfected =	_primary select 3;
	_model =		_primary select 4;
	_hiveVer =		_primary select 5;
	
	if (isNil "_model") then {
		_model = "Survivor2_DZ";
	} else {
		if (_model == "") then {
			_model = "Survivor2_DZ";
		};
	};
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

ive played arround with it for DayZ-celle a while ago and the problem was. that the player skin was reset again after picking a gender at the gender selection screen.

 

example: https://github.com/JoSchaap/DayZ-Private-master/commit/786ec0e39f9824f7ddba338e77daa413d6a57b43

 

 

 

For dayz Celle this resulted in either needing to disable the gender selection screen completely, or sticking with those 2 default skins :)

Link to comment
Share on other sites

  • 0

try this: file "dayz_code\system\player_monitor.fsm", line 1419:

_model = dayz_selectGender;

that is the place where the model (skin) is changed after your chose a gender... well i think it is i was just looking through the files for 1 minute :)

 

Shouldn't that be:

dayz_selectGender = _model;

_model should be populated from server_playerLogin.sqf..

 

EDIT: My line numbers are different, am looking a little bit before, in Gender Selection... (Line #1355)..

Link to comment
Share on other sites

  • 0

@axeman: look at the date my post was made before Epoch 1.0.3.1 so the line numbers might be different :D

 

anyway the mode is set on the client in "Parse Login" state:

_model		= _msg select 6;

but if you spawn fresh it will be overwritten after you've choosen a gender with

_model = dayz_selectGender;

dayz_selectGender is just the variable from the gender dialog, so either "Survivor2_DZ" as male or "SurvivorW2_DZ" as female.

 

at last the skin will be set in the state "Phase One":

_model call player_switchModel;

if you change the model there it should be used, and not the survivor skin.

 

if you open the player_monitor.fsm with the FSM editor it looks like this (in case you don't know what I am talking about):

YYdXIoPl.png

Link to comment
Share on other sites

  • 0

but if you spawn fresh it will be overwritten after you've choosen a gender with

_model = dayz_selectGender;

dayz_selectGender is just the variable from the gender dialog, so either "Survivor2_DZ" as male or "SurvivorW2_DZ" as female.

 

at last the skin will be set in the state "Phase One":

_model call player_switchModel;

if you change the model there it should be used, and not the survivor skin.

 

 

Hi Axe Cop

 

I tried a whole night to change the start skin, your instructions too...

But now, i spawn as an invisible model. Only if you go to 3rd person and move the mouse down, i see my chest (it looks like a soldier skin or something) but i used "Rocker1_DZ" instead of Survivor2_DZ.

 

I changed all _model = Survivor2_DZ into _model = ""Rocker1_DZ"", i removed the Gender_Selection with FSM Editor and i changed the line _model call player_switchmodel line into _model = ""Rocker1_DZ"".

Rocker1_DZ i used just for testing, my goal is Random Start Skins.

What does "_model        = _msg select 6;" mean ?

Do you have any ideas what i do wrong ?

(Epoch 1.0.4.2a)

 

Can u help me please ?

Link to comment
Share on other sites

  • 0

Hi sparky,

"_model        = _msg select 6;" just sets the model from the "_msg" array. I don't know what model class is in there or where it comes form without looking further into that :D

but as far as I see from your text you did something wrong, your can't remove the line

_model call player_switchmodel;

that actually changes the model so you need to call it no matter what skin you use (or you will be invisible)!

I don't know if you skin name is valid, but lets assume it is you can call it like this:

"Rocker1_DZ" call player_switchmodel;

or

_model = ​"Rocker1_DZ";
_model  call player_switchmodel;

hope that hepls.

Link to comment
Share on other sites

  • 0

Thx for answering.

 

I will try it now and can report you if i have any success...

 

But i have one further question of understanding:

If i change _model functions in the player_monitor.fsm, which effect this will take for the server_playerLogin.sqf ?

Do i have to change the server_playerLogin.sqf the same way like i do in the fsm file or doesnt it matter ? :)

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