Jump to content

[RELEASE] Random Loot Crates v1.25


Darth_Rogue

Recommended Posts

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:

 

FNbpJq4.png

 

 

 

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   :)

Link to comment
Share on other sites

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

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 

Link to comment
Share on other sites

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

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

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

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

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

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
×
×
  • Create New...