Jump to content

[RELEASE] Random Loot Crates v1.25


Darth_Rogue

Recommended Posts

ah I just had another look and I thought I had it the correct way around.....  

 

My cords are  

     x               y                z

[[8484.51,25058.1,0.00132751],0]

 

z = 0.00132751 is only a little high because this is on a island

 

and 

    x            y          z

[[3049.72,13202,18.3877],0],

 

z = 18.3877 is a bit higher because this one is in a tower

 

I noticed on yours Z are all 0

 

yes you are right on the mission.sqm ...... I will double check later

Link to comment
Share on other sites

 

Try:

switch (_worldName) do {
	case "altis":{
		_lootBoxes = [
		diag_log "Altis-specific settings loaded";
			[[8484.51,25058.1,0.00132751],0],
			[[8706.97,25374.2,0.00118256],0],
			[[3049.72,13202,18.3877],0],
			[[3137.43,13088.5,0.00112152],0]
			];
	}; 

 

Hi Robio

 

Sorry this didnt work either ?  really strange I had them working in the previous version and all I changed was the locations which are correct ?

 

Cheers

Link to comment
Share on other sites

  • 3 weeks later...

I think I may see the problem.  In your fn_random_crates.sqf, find the section that has your position array for Chernarus and add this code so that your position arrays are between the brackets

_lootBoxes = [  // format as [_position, _lootType (range 1-4)] or [_position, 0] for randomly selected loot.
			
			]; 

So your Chernarus section should look similar to this:


	case "chernarus":{
		// Setup for Chernarus AI controlled sector		
		_lootBoxes = [  // format as [_position, _lootType (range 1-4)] or [_position, 0] for randomly selected loot.
			[[7093.73,12145.4,0],0],
			[[7093.73,12140.4,0],0],
			[[7291.69,12044.5,0],0],
			[[7295.69,12044.5,0],0],	
			[[19288.5,22358.8,1.2],0],
			[[19633.8,22128.8,0],0], 
			[[11068.9,7125.94,0],0]	// ** Note that there is no comma after the last entry.
			]; 
	};

Obviously you'll have to replace the coords arrays with your own coordinates, but I'm pretty sure that should do the trick.

 

 

To everyone else, in case you haven't caught it already, there is some code missing for maps other than Bornholm.  I will fix it when I get home Thursday morning and have access to my Github repo.  

Link to comment
Share on other sites

it still doesn't seem too be working for me :( iv copied your example in and went too the locations that were in the example and still nothing, i thought it might have been because i was trying to spawn a box under a camo net but it doesn't seem to be the problem 

Link to comment
Share on other sites

Hi Darth,

First, thank you for the script.

 

Second, I'm having trouble getting it to work with Richie's Heli crash script.

 

I know I'm just doing something dumb, but I can't quite figure out what it is. I understand (I think?) from the error file that I'm missing a closing "]" but I just don't see it...

 

Here's the error in the rpt file.

http://pastebin.com/uZxAs0zG

 

random crate sqf

http://pastebin.com/ViijE6TA

 

Richie's heli crash

http://pastebin.com/ChzwG5rM

 

I plan on turning Richie's loot to 0 spawns after I get the crates working, but no-go so far.

Link to comment
Share on other sites

So still no boxes at spawn, but no errors in the RPT...

 

http://pastebin.com/K09jkgSq

 

I noticed that it went through the Epoch-hive addons in this order "crates--A3EAI--HeliCrashes"... does that matter? If there are no heli crashes spawned yet will there be no places to spawn the crates?

If that could be it, I guess my next question is, how do I make them load in a certain order?

Thanks in advance...

Link to comment
Share on other sites

I'm not sure how you're trying to get this to work with Richie's script.  The crate spawner requires coords to be entered into an array so it knows where to place the crates.  In order for what you're trying to do to work you'd have to have Richie's heli crash script pick the coords then somehow pass them to the crate spawner, which would mean that you would have to guarantee that the crash spawner runs first before the crate spawner every time, which would be quite difficult if not impossible.  I'd have to think about it but it seems at first glance that you would be better off to include a call to the fn_crate_spawner file in Richie's heli crash spawner PBO and call it as part of the heli crash process.  And even then you still have to pass the coords from one to the other, otherwise the crate script will have no way to know where to spawn the crates.  

Link to comment
Share on other sites

Ahhhhh... ok. Gross conceptual error on my part...

Back to the drawing board!

 

Do you think it would be possible to merge the two scripts into one PBO, where Richie's script does it's thing, generating the points, then just assign those to a variable and pass that to the next part of the script, or even incorporate the crate spawn into the part right after where Richie's script picks a spawn point?

 

I'm not new to coding, but pretty new to Arma 3 scripting.

Link to comment
Share on other sites

Probably the best thing to do would be to alter Richie's script to spawn a crate instead of loot piles and fill the crate with loot from the loot arrays in the crash spawner.  I'd start the discussion over on his thread and see where that takes you.  You'll have an easier time with that than trying to get his and mine to work together.  

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...