Jump to content
  • 0

Anyone have a working Take Clothes Script for Overpoch?


Chunk. No Captain Chunk.

Question

23 answers to this question

Recommended Posts

  • 0

I think the best way would be to add the clothes to the config. not a hard task and should solve the problem, other way could be define an array which skins are allowed to take and instead of giving them into inventory let them just switch skins right away.

Link to comment
Share on other sites

  • 0

Use Zupa's Arma/Overwatch Clothing Script. Comes with Take Clothes integrated.

Tried that, couldn't get it working.

 

 

I think the best way would be to add the clothes to the config. not a hard task and should solve the problem, other way could be define an array which skins are allowed to take and instead of giving them into inventory let them just switch skins right away.

I'd do that if I knew how.

Link to comment
Share on other sites

  • 0

IMPORTANT: You need to check if the clothes already exist as items like: skin_blablabla

 

try somehting like this:

 

copy this file to your mission folder and place it wherever you like (maybe to your other Cfgs):

 

https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/Configs/CfgArma.hpp

 

at the end of the class CfgSurvival {

 
just add the clothes you would like to have from overwatch in there.
 
then simply call this file from your description.ext with something like:
#include "pathTo\CfgArma.hpp"

in your custom player_wearClothes.sqf change every:

configFile >> "CfgSurvival"

into

missionconfigFile >> "CfgSurvival" 

this should do the trick.

 

the other way would be like i've already said is simply let them change the skin on the action rather then add it to the inventory if there is no itemclass for some skins

Link to comment
Share on other sites

  • 0

 

IMPORTANT: You need to check if the clothes already exist as items like: skin_blablabla

 

try somehting like this:

 

copy this file to your mission folder and place it wherever you like (maybe to your other Cfgs):

 

https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/Configs/CfgArma.hpp

 

at the end of the class CfgSurvival {

 
just add the clothes you would like to have from overwatch in there.
 
then simply call this file from your description.ext with something like:
#include "pathTo\CfgArma.hpp"

in your custom player_wearClothes.sqf change every:

configFile >> "CfgSurvival"

into

missionconfigFile >> "CfgSurvival" 

this should do the trick.

 

the other way would be like i've already said is simply let them change the skin on the action rather then add it to the inventory if there is no itemclass for some skins

 

Will I need any other script for this to work?

Link to comment
Share on other sites

  • 0

nope just player_wearClothes, compiles, CfgArma.cfg and description.ext

Cheers, I shall have to give that a go.

I noticed you posted the fix for the salvage vehicle for epoch right?

Well I've added that to my server and my trying to get a working salvage vehicle script to work and I was thinking of applying your fix then changing the values within your fix to make a salvage vehicle, but it didn't exactly go as planned.

Got any ideas on that?

Link to comment
Share on other sites

  • 0

 

IMPORTANT: You need to check if the clothes already exist as items like: skin_blablabla

 

try somehting like this:

 

copy this file to your mission folder and place it wherever you like (maybe to your other Cfgs):

 

https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/Configs/CfgArma.hpp

 

at the end of the class CfgSurvival {

 
just add the clothes you would like to have from overwatch in there.
 
then simply call this file from your description.ext with something like:
#include "pathTo\CfgArma.hpp"

in your custom player_wearClothes.sqf change every:

configFile >> "CfgSurvival"

into

missionconfigFile >> "CfgSurvival" 

this should do the trick.

 

the other way would be like i've already said is simply let them change the skin on the action rather then add it to the inventory if there is no itemclass for some skins

 

This doesn't work :/

Link to comment
Share on other sites

  • 0

I use this on my overpoch server and it works just fine. Obviously doesn't work for overwatch skins.

// By Zabn 2014
private["_isEpoch","_itemNew","_onLadder","_skin","_body","_okSkin","_clothesTaken","_itemNewName","_result","_animState","_takeClothesUsageTime","_started","_finished","_takeClothesUseTime"];

if (!isNil "DZE_ActionInProgress") then { // check if this is dayz epoch
	if (DZE_ActionInProgress) exitWith {}; // Do not allow if any script is running.
};

_body = (_this select 3) select 0;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText ["You can't perform this action while on a ladder!" , "PLAIN DOWN"]};

if (vehicle player != player) exitWith {cutText ["You may not take clothes while in a vehicle", "PLAIN DOWN"]};

player removeAction s_player_clothes;
s_player_clothes = -1;

_skin = (typeOf _body);

_itemNew = _skin;

switch (_itemNew) do {
	case "Survivor3_DZ": {
		_itemNew = "Survivor2_DZ";
	};
	case "Bandit1_DZ": {
		_itemNew = "Survivor2_DZ";
	};
};

_itemNew = "Skin_" + _itemNew;
_okSkin = isClass (configFile >> "CfgMagazines" >> _itemNew);

_takeClothesUseTime = 6;

r_interrupt = false; 
r_doLoop = true; 
_takeClothesUsageTime = time;
_animState = animationState player;
_started = false;
_finished = false;

if(_okSkin) then {
	_clothesTaken = _body getVariable["clothesTaken",false];
	if(!_clothesTaken) then {
		while {r_doLoop} do {
			private ["_isMedic"];
			
			_clothesTaken = _body getVariable["clothesTaken",false];
			_animState = animationState player;
			_isMedic = ["medic",_animState] call fnc_inString;
			if(_clothesTaken) then { 
				r_doLoop = false; 
			};
			if (_isMedic) then {
				_started = true;
			};
			if(!_isMedic && !r_interrupt && (time - _takeClothesUsageTime) < _takeClothesUseTime) then {
				player playActionNow "Medic"; 
				_isMedic = true;
			};
			if (_started && !_isMedic && (time - _takeClothesUsageTime) > _takeClothesUseTime) then {
				r_doLoop = false; 
				_finished = true;
			};
			if (r_interrupt) then {
				r_doLoop = false; 
			};
			sleep 0.1;
		};
		r_doLoop = false; 

		if(_finished) then {
			_itemNewName = getText (configFile >> "CfgMagazines" >> _itemNew >> "displayName");
			_result = [player,_itemNew] call BIS_fnc_invAdd;
			if (_result) then {
				_body setVariable["clothesTaken",true,true];
				cutText [format["One %1 has been added to your inventory!",_itemNewName], "PLAIN DOWN"];
			} else {
				cutText [format["You didn't have enough room to store a %1 :(",_itemNewName], "PLAIN DOWN"];
			};
		} else {
			if(_clothesTaken) then { 
				player switchMove "";
				player playActionNow "stop";
				cutText ["This Skin has already been taken!", "PLAIN DOWN"];
			} else {
				r_interrupt = false;
				player switchMove "";
				player playActionNow "stop";
				cutText [format["You have interrupted taking clothes!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt
			};
		};
	} else {
		cutText ["This Skin has already been taken!", "PLAIN DOWN"];
	};
} else {
	cutText [format["Currently %1 is not supported by the steal skin script.",_skin], "PLAIN DOWN"];
};

 

_clothesTaken = _cursorTarget getVariable["clothesTaken",false];
		// Take clothes by Zabn
	if (_isMan and !_isAlive and !_isZombie and !_clothesTaken) then {
        if (s_player_clothes < 0) then {
            s_player_clothes = player addAction [("<t color='#78E678'>")+("Take Clothes")+("</t>"), "Scripts\player_takeClothes.sqf",[_cursorTarget], -10, false, true, "",""];
        };
    } else {
        player removeAction s_player_clothes;
        s_player_clothes = -1;
        };
		// Take clothes by Zabn

Link to comment
Share on other sites

  • 0

almost sad that to this date, there is no script which works with overwatch skins ^^

 

well here it is then, this script works with every skin:

private["_isSchwedesinstantSkins","_isEpoch","_itemNew","_onLadder","_skin","_body","_okSkin","_clothesTaken","_itemNewName","_result","_animState","_takeClothesUsageTime","_started","_finished","_takeClothesUseTime"];

_body = _this select 3;
DZE_ActionInProgress = true;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {DZE_ActionInProgress = false;cutText ["I can not perform this action while on a ladder!" , "PLAIN DOWN"]};
_playernear = ({isPlayer _x} count (getPos vehicle player nearEntities [["AllVehicles"], 8]))-1;
if (_playernear != 0) exitWith {DZE_ActionInProgress = false;cutText [format["You cannot us this action while another player is nearby"] , "PLAIN DOWN"]};


if (vehicle player != player) exitWith {DZE_ActionInProgress = false;cutText ["You can not take clothes while in a vehicle.", "PLAIN DOWN"]};

player removeAction s_player_clothes;
s_player_clothes = -1;

_skin = (typeOf _body);
_itemNew = _skin;

//add other Skins in here
_isSchwedesinstantSkins = ['gsc_military_helmet_wdl','gsc_eco_stalker_mask_fred']; 

switch (_itemNew) do {
   case "Survivor3_DZ": {
     _itemNew = "Soldier_Sniper_PMC_DZ";
   };

};

if (!(_skin in _isSchwedesinstantSkins)) then {
_itemNew = "Skin_" + _itemNew;
_okSkin = isClass (ConfigFile >> "CfgMagazines" >> _itemNew);
} else {
_okSkin = true;
};
if (_okSkin) then {
   player playActionNow "Medic";
   sleep 3;
   if (!(_skin in _isSchwedesinstantSkins)) then {
   _result = [player,_itemNew] call BIS_fnc_invAdd;
   } else {
   [dayz_playerUID,dayz_characterID,_itemNew] spawn player_humanityMorph;
   _result = true;
   };
   if (_result) then {
     _mags = magazines _body;
     _weps = weapons _body;
     _bag = unitBackpack _body;
     _corpse = createVehicle ["GraveDZE", position _body, [], 0, "CAN_COLLIDE"];

     _corpse setVariable ["permaLoot",true];
     {_corpse addMagazineCargoGlobal [_x, 1];} forEach _mags;
     {_corpse addWeaponCargoGlobal [_x, 1];} forEach _weps;
     if (!isNull _bag) then {
       _bmags = getMagazineCargo _bag;
       _bweps = getWeaponCargo _bag;
       _corpse addBackpackCargoGlobal [(typeOf _bag), 1];
       {_corpse addMagazineCargoGlobal [_x, ((_bmags select 1) select _forEachIndex)];} forEach (_bmags select 0);
       {_corpse addWeaponCargoGlobal [_x, ((_bweps select 1) select _forEachIndex)];} forEach (_bweps select 0);
     };
     if (!isNull _body) then {deleteVehicle _body};
      if (!(_skin in _isSchwedesinstantSkins)) then {cutText ["I put the clothes in my inventory", "PLAIN DOWN"];};
   } else {
     cutText ["I do not have enough room in my inventory.", "PLAIN DOWN"];
     player switchMove "";
     player playActionNow "stop";
   };
} else {
   cutText [format["I'm not able to take them off"], "PLAIN DOWN"];
   player switchMove "";
   player playActionNow "stop";
};
DZE_ActionInProgress = false;

just add your skins into the array and you should have a nice simple take clothes script which lets you change the clothes on the spot ;P

Link to comment
Share on other sites

  • 0

almost sad that to this date, there is no script which works with overwatch skins ^^

 

well here it is then, this script works with every skin:

private["_isSchwedesinstantSkins","_isEpoch","_itemNew","_onLadder","_skin","_body","_okSkin","_clothesTaken","_itemNewName","_result","_animState","_takeClothesUsageTime","_started","_finished","_takeClothesUseTime"];

_body = _this select 3;
DZE_ActionInProgress = true;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {DZE_ActionInProgress = false;cutText ["I can not perform this action while on a ladder!" , "PLAIN DOWN"]};
_playernear = ({isPlayer _x} count (getPos vehicle player nearEntities [["AllVehicles"], 8]))-1;
if (_playernear != 0) exitWith {DZE_ActionInProgress = false;cutText [format["You cannot us this action while another player is nearby"] , "PLAIN DOWN"]};


if (vehicle player != player) exitWith {DZE_ActionInProgress = false;cutText ["You can not take clothes while in a vehicle.", "PLAIN DOWN"]};

player removeAction s_player_clothes;
s_player_clothes = -1;

_skin = (typeOf _body);
_itemNew = _skin;

//add other Skins in here
_isSchwedesinstantSkins = ['gsc_military_helmet_wdl','gsc_eco_stalker_mask_fred']; 

switch (_itemNew) do {
   case "Survivor3_DZ": {
     _itemNew = "Soldier_Sniper_PMC_DZ";
   };

};

if (!(_skin in _isSchwedesinstantSkins)) then {
_itemNew = "Skin_" + _itemNew;
_okSkin = isClass (ConfigFile >> "CfgMagazines" >> _itemNew);
} else {
_okSkin = true;
};
if (_okSkin) then {
   player playActionNow "Medic";
   sleep 3;
   if (!(_skin in _isSchwedesinstantSkins)) then {
   _result = [player,_itemNew] call BIS_fnc_invAdd;
   } else {
   [dayz_playerUID,dayz_characterID,_itemNew] spawn player_humanityMorph;
   _result = true;
   };
   if (_result) then {
     _mags = magazines _body;
     _weps = weapons _body;
     _bag = unitBackpack _body;
     _corpse = createVehicle ["GraveDZE", position _body, [], 0, "CAN_COLLIDE"];

     _corpse setVariable ["permaLoot",true];
     {_corpse addMagazineCargoGlobal [_x, 1];} forEach _mags;
     {_corpse addWeaponCargoGlobal [_x, 1];} forEach _weps;
     if (!isNull _bag) then {
       _bmags = getMagazineCargo _bag;
       _bweps = getWeaponCargo _bag;
       _corpse addBackpackCargoGlobal [(typeOf _bag), 1];
       {_corpse addMagazineCargoGlobal [_x, ((_bmags select 1) select _forEachIndex)];} forEach (_bmags select 0);
       {_corpse addWeaponCargoGlobal [_x, ((_bweps select 1) select _forEachIndex)];} forEach (_bweps select 0);
     };
     if (!isNull _body) then {deleteVehicle _body};
      if (!(_skin in _isSchwedesinstantSkins)) then {cutText ["I put the clothes in my inventory", "PLAIN DOWN"];};
   } else {
     cutText ["I do not have enough room in my inventory.", "PLAIN DOWN"];
     player switchMove "";
     player playActionNow "stop";
   };
} else {
   cutText [format["I'm not able to take them off"], "PLAIN DOWN"];
   player switchMove "";
   player playActionNow "stop";
};
DZE_ActionInProgress = false;

just add your skins into the array and you should have a nice simple take clothes script which lets you change the clothes on the spot ;P

I wonder if this will interfere with my player_wearclothes.sqf which doesn't allow players wearing a backpack to change skins. Epoch is still really buggy when it comes to changing skins and keeping your inventory and/or not getting teleported or relogging in miles away from where you logged off.

 

Might need to add some kind of restriction requiring players to remove backpacks before taking clothes.

something similar to

if (!isNull (unitBackpack player)) exitWith { DZE_ActionInProgress = false; cutText  [("You must remove your backpack to change clothes"), "PLAIN DOWN"] };
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
  • Advertisement
  • Discord

×
×
  • Create New...