Grahame Posted February 26, 2018 Report Share Posted February 26, 2018 ARMA3 Take Clothes Script As some of you are aware, one of my pet peeves with ARMA3 is that Bohemia added detachable uniforms but then made it so you could not wear all of them by siding each. Thus, in Epoch, if you are female, you can wear female and NATO uniforms, but not CSAT or AAF. Males have a similar issue being bared from wearing NATO or AAF. While some mods like Tryk's unlock all their uniforms, unfortunately many do not (including CUP). Here is my work-in-progress solution to the problem that allows you to take and wear any uniform that a dead adversary is wearing. Installation UPDATE: 2/27/2018 @ 1916EST: Updated the code and installation instructions based on feedback from the community. UPDATE: 3/21/2018 @ 0943EST: Updated the code based on feedback from the community and a rewrite by He-Man. Create a file in your favourite text editor called TakeClothes.sqf with the following code: /* Author: Grahame/He-Man Description: Take and wear any clothes from a dead player or AI Licence: Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike */ private ["_target_uniform","_player_uniform"]; params ["_target","_player"]; _nearentities = (((_player nearEntities 7) select {isplayer _x && alive _x && !(_x iskindof "HeadlessClient_F")}) - [_player]); if !(_nearentities isequalto []) exitwith { ["Cannot take clothes when other players are nearby",5] call epoch_message; }; if (uniform _target isequalto "") exitwith { ["Target has no uniform to take",5] call epoch_message; }; _playerloadout = getunitloadout _player; _targetloadout = getunitloadout _target; _player_uniform = _playerloadout param [3,""]; _target_uniform = _targetloadout param [3,""]; _playerloadout set [3,_target_uniform]; _targetloadout set [3,_player_uniform]; _player setunitloadout _playerloadout; _target setunitloadout _targetloadout; Put that file in your mission, for example as custom/TakeClothes.sqf. Add the following lines to your mission's init.sqf: if(hasInterface) then{ TakeClothes = compileFinal preprocessFileLineNumbers "custom\TakeClothes.sqf"; }; In your mission file, edit the epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp, adding the following lines to the end: // Take Clothes class take_clothes { condition = "((!alive dyna_cursorTarget) && ((dyna_cursorTarget isKindOf 'SoldierWB') || (dyna_cursorTarget isKindOf 'SoldierEB') || (dyna_cursorTarget isKindOf 'SoldierGB')))"; action = "[dyna_cursorTarget, player] call TakeClothes;"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_requests_ca.paa"; tooltip = "Take Clothes"; }; Rebuild the mission file and upload to the server. Voila! You can now look at any dead player or AI and take and wear their uniform no matter what it is! Acknowledgements Though no code was needed from the DayZ/ARMA2/Epoch Take Clothes script, it is the reason I have always been so bugged about not being able to wear uniforms from dead adversaries. Yeah, I'm a bit of a bandit that way for sure Anyway, cheers guys: He-Man, Ghostrider-GRG, Drokz and 2 others 5 Link to comment Share on other sites More sharing options...
Kenobi Posted February 26, 2018 Report Share Posted February 26, 2018 Thanks for script. Players reported, that If you use takeclothes on dead players body repeately, this will cause copy af all actually items in clothes. Link to comment Share on other sites More sharing options...
Grahame Posted February 26, 2018 Author Report Share Posted February 26, 2018 Have you seen that happen @Kenobi If so can you let me know the steps to reproduce? The enemy uniform should be empty after the first run - unless the second run happens before the first is completed (it just finishes so quick for me that I did not think about that). Did say better error handling was necessary Link to comment Share on other sites More sharing options...
Kenobi Posted February 26, 2018 Report Share Posted February 26, 2018 My friend told me this issue, I tryed reproduce this on my test server but negative. I ask him for video, so maybe later I can post some stuff :-) Grahame 1 Link to comment Share on other sites More sharing options...
Kenobi Posted February 27, 2018 Report Share Posted February 27, 2018 This is video from my view. My friend will send me video from his view. I can upload his video tomorrow. PS: I killed cultist and then try to take his clothes. Cultists dead body was changed to woman ghillie with this takeclothes script. Maybe this can help you. Cheers. Link to comment Share on other sites More sharing options...
Grahame Posted February 27, 2018 Author Report Share Posted February 27, 2018 Ah @Kenobi.. that's weird and I had had not tested with vanilla Epoch adversaries (apart from I_Soldier_Epoch) because I never use them. I note that I do not see your uniforms changing... I'll test and fix!!! Link to comment Share on other sites More sharing options...
Ghostrider-GRG Posted February 27, 2018 Report Share Posted February 27, 2018 @Grahamme, consider setting a variable on the corpse once clothes were taken to ensure that this action is only done once. This of course would require an additional exception in setvariable.txt. Thanks for the script ! Cheers - Ghost Grahame 1 Link to comment Share on other sites More sharing options...
Grahame Posted February 27, 2018 Author Report Share Posted February 27, 2018 @Ghostrider-GRG That is a very good idea. Will do so. Exactly like the A2 version in that you can only transfer once. I like it! Will implement asap Link to comment Share on other sites More sharing options...
Ghostrider-GRG Posted February 27, 2018 Report Share Posted February 27, 2018 Just what I was thinking - Cheers - Ghost. Link to comment Share on other sites More sharing options...
Grahame Posted February 27, 2018 Author Report Share Posted February 27, 2018 I also think that the issues with Epoch adversaries probably apply to Ryan's Zs too in that I don't think that they have detachable uniforms... their model is the look... Will also fix that Link to comment Share on other sites More sharing options...
Kenobi Posted February 27, 2018 Report Share Posted February 27, 2018 Steps to reproduce copy issue ;-) Grahame 1 Link to comment Share on other sites More sharing options...
Grahame Posted February 28, 2018 Author Report Share Posted February 28, 2018 Okay folks, I have made some changes (will update the first post with them) based on suggestions and good video reports from @Kenobi- Cheers mate! First, a small change to the take clothes code in CfgActionMenu_target.hpp so that the option to take clothes will not be provided when looking at dead things with no uniforms, like the vanilla Epoch adversaries like sappers, cloakers and zombies and the Ryan's Zombies zombies (which are not the same): // Take Clothes class take_clothes { condition = "((!alive dyna_cursorTarget) && ((dyna_cursorTarget isKindOf 'SoldierWB') || (dyna_cursorTarget isKindOf 'SoldierEB') || (dyna_cursorTarget isKindOf 'SoldierGB')))"; action = "[dyna_cursorTarget, player] call TakeClothes;"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_requests_ca.paa"; tooltip = "Take Clothes"; }; The definition of the base classes for west, east and guer soldiers should catch most AI wearing uniforms from any mod. That definitely is the case for CUP. Changed the custom/TakeClothes.sqf script to set a variable on the corpse so a uniform can only be changed once, even if you subsequently take the uniform off them (thanks @Ghostrider-GRG) and present a message to the player if they attempt to take it again: /* Author: Grahame Description: Take and wear any clothes from a dead player or AI Licence: Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike */ private ["_target","_player","_target_uniform","_player_uniform","_target_carried_items","_player_carried_items","_clothes_taken"]; _target = _this select 0; _player = _this select 1; _target_carried_items = []; _player_carried_items = []; _items_to_add = []; _clothes_taken = _target getvariable ["CLOTHESTAKEN", "false"]; if (_clothes_taken != "true") then { _target setvariable ["CLOTHESTAKEN", "true", true]; _target_uniform = uniform _target; _player_uniform = uniform _player; _target_carried_items = uniformItems _target; _player_carried_items = uniformItems _player; _items_to_add = _player_carried_items + _target_carried_items; _target forceAddUniform _player_uniform; _player forceAddUniform _target_uniform; { _player addItem _x; } foreach _items_to_add; } else { ["Clothes have already been taken from this body", 5] call Epoch_message; }; As a result of that change you will also need to add !"CLOTHESTAKEN" to your setvariable.txt BattlEye filter. Please let me know if you find any other issues. Kenobi, Helion4 and natoed 3 Link to comment Share on other sites More sharing options...
Kenobi Posted March 14, 2018 Report Share Posted March 14, 2018 Grahame, thanks. But items copy is still possible, but only once. Steps to reproduce: 1) Throw away actual uniform from your body. 2) Take uniform from dead body through inventory to your body. 3) On dead body use TakeClothes through space key. This will cause, that you will have the same uniform on your body and on dead body and items in uniform will be copied. Link to comment Share on other sites More sharing options...
Grahame Posted March 14, 2018 Author Report Share Posted March 14, 2018 Think I see the issue there. Will post an update later after real-life work is complete for the day. Thanks for the heads up @Kenobi Link to comment Share on other sites More sharing options...
Grahame Posted March 20, 2018 Author Report Share Posted March 20, 2018 New version of the script provided by @He-Man (cheers buddy!): private ["_target_uniform","_player_uniform"]; params ["_target","_player"]; _nearentities = (((_player nearEntities 7) select {isplayer _x && alive _x && !(_x iskindof "HeadlessClient_F")}) - [_player]); if !(_nearentities isequalto []) exitwith { ["Cannot take clothes when other players are nearby",5] call epoch_message; }; if (uniform _target isequalto "") exitwith { ["Target has no uniform to take",5] call epoch_message; }; _playerloadout = getunitloadout _player; _targetloadout = getunitloadout _target; _player_uniform = _playerloadout param [3,""]; _target_uniform = _targetloadout param [3,""]; _playerloadout set [3,_target_uniform]; _targetloadout set [3,_player_uniform]; _player setunitloadout _playerloadout; _target setunitloadout _targetloadout; Tested on my server this afternoon. If others can check it out and confirm no issues then I will update the thread's first post. natoed, Kenobi, He-Man and 2 others 5 Link to comment Share on other sites More sharing options...
Tarabas Posted March 21, 2018 Report Share Posted March 21, 2018 No duping for me till now :) Great! Grahame and natoed 2 Link to comment Share on other sites More sharing options...
Grahame Posted March 21, 2018 Author Report Share Posted March 21, 2018 Thanks @TarabasFirst post updated with the latest code natoed, Tarabas and Kenobi 2 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now