Fogazi Posted April 12, 2015 Report Share Posted April 12, 2015 In this day and age of DayZ and Epoch/Overpoch particularly, it is no longer a case of getting killed and losing all your equipment forever. Nowadays most players re-spawn, halo in to nearly on top of their old body and then go through the monotonous process of transferring gear back 1 piece at a time. I can't remember that last time I went through and re-kitted by looting and farming buildings. Apart from dying in the water or some form of explosion cause your kit to be lost. I thought that process needed to be simplified, especially seeing as I was getting killed numerous times every hour be it by AI or other players. I looked around and couldn't find anything similar or even close to what I wanted so I wrote this script. I am an amateur when it comes to scripting so there will probably be mistakes and different/better ways to do what I have done. These things when bought to my attention will be fixed/implemented as I gain more knowledge on the topic. So here it is, a kit swapping(taking at this early stage) script. Fogazi's Swap Kit Script Purpose: 1. Allows you to take complete kits with a dead AI or player. 2. Additional options to restrict this only to a players own dead body. -WARNING- This script takes the kit of the dead AI or player but deletes/wipes whatever equipment you had on you before you chose to swap. Future plans are to actually swap kits. Instructions and script files here Credits: seaweeduk from the OPENDAYZ community, I adapted some of his code from his Bury Corpses script. Gr8, stonXer and CartoonrBOY 3 Link to comment Share on other sites More sharing options...
Gr8 Posted April 16, 2015 Report Share Posted April 16, 2015 Why not just swap your gear with the body instead of deleting it? Link to comment Share on other sites More sharing options...
Mikeeeyy Posted April 16, 2015 Report Share Posted April 16, 2015 One thing that always bugs me is this: _counter = 0; { _bp addMagazineCargoGlobal [_x,(_bp_MagsQtys select _counter)]; _counter = _counter + 1; } forEach _bp_MagsTypes; forEach has a magic variable '_forEachIndex' which does what your _counter variable is doing, please use it. :D Also there's no need for brackets! { _bp addMagazineCargoGlobal [_x, _bp_MagsQtys select _forEachIndex]; } forEach _bp_MagsTypes; Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2015 Report Share Posted April 16, 2015 I like the idea, but i would like it more, if i could choose different types, like for example: Take Toolbelt (All Tools obviously) Take Vest (Where Ammunition and Items are) Swap / Take primary weapon Swap / Take secondary weapon Link to comment Share on other sites More sharing options...
Fogazi Posted April 17, 2015 Author Report Share Posted April 17, 2015 I like the idea, but i would like it more, if i could choose different types, like for example: Take Toolbelt (All Tools obviously) Take Vest (Where Ammunition and Items are) Swap / Take primary weapon Swap / Take secondary weaponDefinately something I will be incorporating down the track. Why not just swap your gear with the body instead of deleting it?Also coming, lazy I know but I just wanted to get a working script out there to start with. One thing that always bugs me is this:_counter = 0; { _bp addMagazineCargoGlobal [_x,(_bp_MagsQtys select _counter)];_counter = _counter + 1;} forEach _bp_MagsTypes;forEach has a magic variable '_forEachIndex' which does what your _counter variable is doing, please use it. :D Also there's no need for brackets!{ _bp addMagazineCargoGlobal [_x, _bp_MagsQtys select _forEachIndex]; } forEach _bp_MagsTypes;I mucked around with forEach for ages but never got it to work. Edit: Though I never tried it out for the backpack as I couldn't get it to work for the players inventory. Will muck around with it. Edit 2: WAIT! I never even looked at this code for the backpack and now that I have I realise the error/bad code. This was part I took straight from another script and just changed some variables. As I said I am an amateur teaching myself along the way using the old test and try. Link to comment Share on other sites More sharing options...
stonedreality Posted July 8, 2015 Report Share Posted July 8, 2015 Thanks for this script. Works really well. I just wondered if anyone could help with adding skins to the swap code, it's a little above my pay grade? Link to comment Share on other sites More sharing options...
JohnnyBravo666 Posted December 26, 2015 Report Share Posted December 26, 2015 Just wondering if there has been any progress in this mod in making it an actual Swap Kit or if it's still just a Take Kit mod? I have been trying to figure out how to set it up as an actual Swap Kit but I got stuck on how to set the player's current gear to the variable and then recalled to the corpse. So was hoping that there might've been some progress on this mod... Link to comment Share on other sites More sharing options...
JohnnyBravo666 Posted January 1, 2016 Report Share Posted January 1, 2016 On 7/8/2015 at 6:30 AM, stonedreality said: Thanks for this script. Works really well. I just wondered if anyone could help with adding skins to the swap code, it's a little above my pay grade? Have you figured this out yet or no ? I'm interested in this too now. I think I may know how to implement this actually. Link to comment Share on other sites More sharing options...
NoxSicarius Posted January 2, 2016 Report Share Posted January 2, 2016 On 1/1/2016 at 1:23 AM, JohnnyBravo666 said: Have you figured this out yet or no ? I'm interested in this too now. I think I may know how to implement this actually. To do this you could simply run a typeOf check on the dead body against all skins, then run a transform on them by spawning a player_humanityMorph. Just be sure to morph them during the swap or you will erase all the gear, unless they fixed that issue. On 12/26/2015 at 0:29 AM, JohnnyBravo666 said: Just wondering if there has been any progress in this mod in making it an actual Swap Kit or if it's still just a Take Kit mod? I have been trying to figure out how to set it up as an actual Swap Kit but I got stuck on how to set the player's current gear to the variable and then recalled to the corpse. So was hoping that there might've been some progress on this mod... I was just about to code this stuff in as it is pretty easy to do, but I noticed there is an old push from Ghost that has not been allowed in from April that does this all. I guess the OP has abandoned this project. It will be a bit tedious, but you can pull all the modified code from the pull request and manually add it. You can't take it from Ghost as he is a deleted user now. https://github.com/Fogazi/SwapKit/pull/2 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