Jump to content

[Release] Swap Kit 1.2


Fogazi

Recommended Posts

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.

b_560_95_1.png

Link to comment
Share on other sites

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

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

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

Definately 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

  • 2 months later...
  • 5 months later...

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

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...