Darth_Rogue Posted March 30, 2015 Report Share Posted March 30, 2015 Random Loot Crates v1.25 Many of us among the community are doing custom map addons using various map editing tools, but up until now there hasn't been a "good" way to spice things up with loot crates. Sure you can manually spawn in crates via script, but then you have to go through the laborious process of filling each one with a specific set of loot. What's more, the loot is always the same with no variety, which gets boring for your players after a while once they know what to expect from each crate. So to combat this issue I've come up with a way to have a random and dynamic loot crate spawn system that is fully customizable. You can change the number of crates, their position on the map, what type of crate is used, what loot goes in each crate and how much of it, and add or remove loot items as needed. You can also specify a static amount of any given item, such as explosives, to prevent large random amounts of them from spawning in. To use this addon - simply download and unzip the attached file and place the PBO in your @epochhive folder. You're done! No BE filters are needed for this to work. The coordinates that are currently listed in the script for the crates are for a custom area that I designed for Bornholm, Object X-99. So those of you using will be all set already, especially if you have AI soldiers guarding the area. If you are running other maps then you will likely need to edit the coords for the crates and possibly the number of crates you want to spawn. But using this as a base template you should be able to create a solution that will fit your needs. Included here is a screenshot of the main file and a short explanation of what each section is for and a general idea of how it works. Use these instructions as a guide and you should be all set. Of course, questions in this thread are welcome! I will be happy to help with any hiccups. Script structure breakdown and explanation: DOWNLOAD A3 Epoch Custom Crates v1.25 - Download (Github) UPDATE 4/27 - Ghostrider-DBD- has added the ability to use vehicle crashes at crate locations, similar to Richie's Heli Crash script. This option can be enabled or disabled on line 23. You also have the option to create a crate spawn location offset. Check lines 150-152 to set those up. There are other things that can be tweaked as well. See the script's line notes for details I'm sure there's probably a "better" or more efficient way to do what I've done in this script. I'm no scripting expert. If anyone has any ideas or suggestions that can make this better I'm all ears! However, since this is run by the server only and only loads one time on each server restart, I'm not incredibly worried about optimizing it. If it ain't broke, don't fix it! ;) This addon is nearly infinitely customizable and should meet the needs of nearly any situation where a static crate is needed. Credits: Authored by Darth Rogue and Chisel (tdwhite) Special thanks to Robio and deadeye for helping overcome the last couple roadblocks! Modified by Ghostrider-DBD- for better random loot distribution and adding vehicle crashes :) DanVonTrap, RuschGaming, Ghostrider-GRG and 5 others 8 Link to comment Share on other sites More sharing options...
OfficeGlenn Posted March 30, 2015 Report Share Posted March 30, 2015 Is there a way to set this up so Admins can just spawn this on the fly at their location? We currently have the IgiLoad script on our server and this would be great to be able to use with that script. Link to comment Share on other sites More sharing options...
OfficeGlenn Posted March 30, 2015 Report Share Posted March 30, 2015 I would even love to be able to spawn an empty crate on the fly. Link to comment Share on other sites More sharing options...
Darth_Rogue Posted March 30, 2015 Author Report Share Posted March 30, 2015 If you use Infistar it already has a spawn crate option that can be set up. If you're using the stock admin tools then you're probably out of luck since it blocks many addAction commands. I'm sure there's a way though. I'll check into some options and see if I can come up with something. Link to comment Share on other sites More sharing options...
Richie Posted March 30, 2015 Report Share Posted March 30, 2015 Congratulations Darth :D I read the ups and downs you had with this, glad to see you done it and shared it, very nice Darth_Rogue 1 Link to comment Share on other sites More sharing options...
RC_Robio Posted March 30, 2015 Report Share Posted March 30, 2015 Is there a way to set this up so Admins can just spawn this on the fly at their location? We currently have the IgiLoad script on our server and this would be great to be able to use with that script. Look at second_comings post: http://epochmod.com/forum/index.php?/topic/32432-release-actionmenu-working-with-stock-ah/?p=209061 second_coming and Darth_Rogue 2 Link to comment Share on other sites More sharing options...
bombajack Posted March 30, 2015 Report Share Posted March 30, 2015 Is any chance for do random drop position on map? EDIT:..for Altis Thx. Link to comment Share on other sites More sharing options...
RC_Robio Posted March 30, 2015 Report Share Posted March 30, 2015 Is any chance for do random drop position on map? EDIT:..for Altis Thx. Link to comment Share on other sites More sharing options...
prone Posted March 30, 2015 Report Share Posted March 30, 2015 Is any chance for do random drop position on map? EDIT:..for Altis Thx. I threw this together, but you can do something like the file below. https://www.mediafire.com/#4a4423jvm2n8a Only downside i see, is each crate will spawn the same "random" weapons each reboot ... but you get the idea. Link to comment Share on other sites More sharing options...
second_coming Posted March 30, 2015 Report Share Posted March 30, 2015 Look at second_comings post: Yep, been using this with the standard AH and now also infiSTAR. Works fine as an admin with both. Link to comment Share on other sites More sharing options...
CoercionX Posted March 30, 2015 Report Share Posted March 30, 2015 Any suggestions for a good static ai system to use? Goes hand in hand with this. Link to comment Share on other sites More sharing options...
Richie Posted March 30, 2015 Report Share Posted March 30, 2015 Any suggestions for a good static ai system to use? Goes hand in hand with this. Bit of a chew on setting up but by far the best is AI Spawn Script Pack I use the militarize.sqf and fillHouse.sqf so you have some that patrol land and some that go building to building, they'll spawn when players enter the area and despawn when they leave, much better for server performance :) Link to comment Share on other sites More sharing options...
Darth_Rogue Posted March 30, 2015 Author Report Share Posted March 30, 2015 I use A3EAI and it works really well. You can create custom spawns anywhere you like on any map with any number of units. You can also customize their difficulty and patrol radius. I haven't used Richie's solution yet but I'm sure it works just as well. Link to comment Share on other sites More sharing options...
Richie Posted March 30, 2015 Report Share Posted March 30, 2015 I started using AI Spawn Script Pack before A3EAI was released, i've never compared them, use what ever suits, i just like how i can control how many units will patrol and how many will go in buildings, it also has the option to spawn fixed numbers plus random. Link to comment Share on other sites More sharing options...
RHE24 Posted April 1, 2015 Report Share Posted April 1, 2015 thanks for Sharing this Script it works like a Charm :) Darth_Rogue 1 Link to comment Share on other sites More sharing options...
prue420 Posted April 4, 2015 Report Share Posted April 4, 2015 How do i put the cords in this is what i got how to convert it because it wont work. [6378.66,14109,0.667542],356.818,0,0,true], [6336.35,14138.4,-0.0528259],356.364,0,0,false], [6410.72,14097.8,-0.0742798],355,0,0,false], [6299.25,14088.9,0.564484],320.909,0,0,false] Link to comment Share on other sites More sharing options...
Richie Posted April 4, 2015 Report Share Posted April 4, 2015 How do i put the cords in this is what i got how to convert it because it wont work. Try : [6378.66,14109,0.667542] [6336.35,14138.4,-0.0528259] [6410.72,14097.8,-0.0742798] [6299.25,14088.9,0.564484] The rest isn't needed, just x,y and z Link to comment Share on other sites More sharing options...
prue420 Posted April 4, 2015 Report Share Posted April 4, 2015 Could i use the same cords in missions sqm for map markers? or do you need to concert them to xzy like in arma 2? Link to comment Share on other sites More sharing options...
Darth_Rogue Posted April 4, 2015 Author Report Share Posted April 4, 2015 The only place coords need to be x,z,y is in the mission.sqm. Every place else it's x,y,z. Link to comment Share on other sites More sharing options...
VAKE Posted April 4, 2015 Report Share Posted April 4, 2015 This will come in handy on my server. Thank you for sharing, Darth_Rogue! Link to comment Share on other sites More sharing options...
prue420 Posted April 4, 2015 Report Share Posted April 4, 2015 Is there something wrong in this? _crate_1 = objNull; if (true) then { _this = createVehicle ["Land_PaperBox_C_EPOCH", [6378.66,14109,0.667542], "CAN_COLLIDE"]; _crate_1 = _this; _this setPos [6378.66,14109,0.667542]; _this setDir 180; _this setVariable ["permaLoot",true]; Link to comment Share on other sites More sharing options...
Darth_Rogue Posted April 4, 2015 Author Report Share Posted April 4, 2015 Is there a closing }; below that? Link to comment Share on other sites More sharing options...
prue420 Posted April 4, 2015 Report Share Posted April 4, 2015 the only thing i changed was I added my cords and its still not spawning in. Link to comment Share on other sites More sharing options...
Richie Posted April 4, 2015 Report Share Posted April 4, 2015 Try without changes :p then when it works you know the error is your side, doube, tripple check your code Link to comment Share on other sites More sharing options...
deadeye Posted April 4, 2015 Report Share Posted April 4, 2015 try this: _this = createVehicle ["Land_PaperBox_C_EPOCH", [6378.66,14109,0.667542], [], 0, "CAN_COLLIDE"]; 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