Bulleit

Bigfoot's Shipwrecks

55 posts in this topic

Posted (edited)

Summary

Here's a mod that will spawn random shipwrecks around the map, each with its own loot crate.

This is a very extended version of the water_crates.sqf script that has been floating around. This does NOT include AI (yet...).

Some enhancements are:

  • Shipwreck with configurable class spawns near loot crate.
  • Configurable loot which supports
    • guaranteed loot crate items with optional percentage to spawn,
    • random loot crate items with optional percentage to spawn,
    • random loot class selection (e.g spawn one of three types of underwater goggles),
    • random poptab generation based on seed distribution, 
    • and percentage chance of spawning loot.
  • Configurable Exile toast and chat notification sent to all players when a player reaches the shipwreck/lootcrate (to encourage PvP piracy).
  • Configurable spawn center and distance.
  • Configurable loot crate class.
  • Marker cleanup after players arrive near loot crate.
  • All configurable settings are here: https://github.com/bigfootcode/bigfoots-shipwrecks/blob/master/src/BigfootsShipwrecks_Server/config.sqf

 

Disclaimer:

  • Loot crate inventory cannot be accessed underwater. You'll need Igiload, R3F, or default Exile crate mounting with SDV able to mount these crates in order to bring them to the shore.
  • I am new to Arma modding, so this code can certainly be improved. 
  • All code criticism is welcome, and there are many features that (you!) can add.
  • I've been running this for several weeks on my server without issue.
  • Our server sells Rubber Ducks (literally, yellow rubber ducks) for a huge number of poptabs. If yours doesn't, you may want to remove those from the default loot options in config.sqf.

 

Credits (if you should be listed here, let me know and I'll add you!)

  • Earliest known script variation: Darth_Rogue, Chisel, deadeye, and Robio.
  • Based on modified script by @Tuna.
  • @Taylor Swift for very helpful mod template.
  •  @second_coming for Occupation mod from which I learned techniques.
  • @StokesMagee - my scripting Mr. Miyagi

 

Source and Install Instructions

  • Source code and pre-packaged PBO can be found here: https://github.com/bigfootcode/bigfoots-shipwrecks
  • Current latest release: 1.0.3
  • Read the README.txt!
  • Drop BigfootsShipwrecks_Server.pbo in your @ExileServer/addons/ folder. Many settings can be modified in BigfootsShipwrecks_Server/config.sqf.

 

OPTIONAL: Exile Supply Box mounting on SDV and boats!

You will need a way to load or mount the Exile_Container_SupplyBox on SDVs, since inventory cannot be accessed underwater in ARMA. It is also convenient if they can be loaded on boats. This can be done with R3F, Igiload, or by modifyng the built-in Exile towing.

Here is how I do it without R3F or Igiload. In mpmissions/config.cpp, modify class cfgVehicleTransport so it uses boats and SDVs:

class CfgVehicleTransport 
{
	class Exile_Container_SupplyBox
	{
		vehicles[] = {
			"Exile_Car_Van_Abstract", 
			"Exile_Car_Offroad_Abstract", 
			"Exile_Car_Zamak_Abstract", 
			"Exile_Car_HEMMT_Abstract", 
			"Exile_Car_Tempest_Abstract", 
			"Exile_Boat_RHIB_Abstract", // Added: this is necessary
			"Exile_Boat_RHIB", // Added: not sure if necessary    
			"Exile_Boat_Rubberboat_Abstract", // Added: this is necessary
      			"Exile_Boat_RubberDuck_CSAT", // Added: not sure if necessary     
        		"Exile_Boat_RubberDuck_Digital", // Added: not sure if necessary     
        		"Exile_Boat_RubberDuck_Orange", // Added: not sure if necessary     
        		"Exile_Boat_RubberDuck_Blue", // Added: not sure if necessary     
        		"Exile_Boat_RubberDuck_Black", // Added: not sure if necessary 
			"Exile_Boat_SDV_Abstract", // Added: this is necessary   
      			"Exile_Boat_SDV_CSAT", // Added: not sure if necessary     
        		"Exile_Boat_SDV_Digital", // Added: not sure if necessary     
        		"Exile_Boat_SDV_Grey" // Added: not sure if necessary  
     		};
		 
		class Exile_Car_Van_Abstract
		{
			attachPosition[] = {0, -1.1, 0.2};
			cargoIndizes[] = {2, 3, 4, 5, 6, 7}; 
			detachPosition[] = {0, -4.4};
		};

		class Exile_Car_Offroad_Abstract
		{
			attachPosition[] = {0, -1.6, 0.4};
			cargoIndizes[] = {1, 2, 3, 4}; 
			detachPosition[] = {0, -4};
		};

		class Exile_Car_Zamak_Abstract
		{
			attachPosition[] = {0.03, 0.3, 0};
			cargoIndizes[] = {2, 3, 4, 5, 6, 7}; 
			detachPosition[] = {0.03, -4.8};
		};

		class Exile_Car_HEMMT_Abstract
		{
			attachPosition[] = {0.05, -0.1, 0.3};
			cargoIndizes[] = {1, 2, 8, 9}; 
			detachPosition[] = {0.05, -6.1};
		};

		class Exile_Car_Tempest_Abstract
		{
			attachPosition[] = {0.08, -0.85, 0.4};
			cargoIndizes[] = {1, 6, 7, 9}; 
			detachPosition[] = {0.08, -6};
		};

		// Added: Contains positioning for supply boxes loaded in RHIB.
		class Exile_Boat_RHIB_Abstract   
		{  
			attachPosition[] = {0, 1.5, 0.4};  
			cargoIndizes[] = {1, 2, 3, 4};   
			detachPosition[] = {0, 5};  
		};  
 
		// Added: Contains positioning for supply boxes loaded in Rubber Boats.
		class Exile_Boat_Rubberboat_Abstract   
		{  
			attachPosition[] = {0, 0.5, 0.25};  
			cargoIndizes[] = {1, 2, 3, 4};   
			detachPosition[] = {0, 6};  
		};  
 
		// Added: Contains positioning for supply boxes loaded in SDV.
		class Exile_Boat_SDV_Abstract   
		{  
			attachPosition[] = {0, -1, 0.5};  
			cargoIndizes[] = {1, 2, 3, 4};   
			detachPosition[] = {0, 8};  
		};

		// Added: Applies positioning defined above to specific vehicles.
		class Exile_Boat_RHIB: Exile_Boat_RHIB_Abstract {};  
		class Exile_Boat_RubberDuck_CSAT: Exile_Boat_Rubberboat_Abstract {};  
		class Exile_Boat_RubberDuck_Digital: Exile_Boat_Rubberboat_Abstract {};  
		class Exile_Boat_RubberDuck_Orange: Exile_Boat_Rubberboat_Abstract {};  
		class Exile_Boat_RubberDuck_Blue: Exile_Boat_Rubberboat_Abstract {};  
		class Exile_Boat_RubberDuck_Black: Exile_Boat_Rubberboat_Abstract {};  
		class Exile_Boat_SDV_CSAT: Exile_Boat_SDV_Abstract {};  
		class Exile_Boat_SDV_Digital: Exile_Boat_SDV_Abstract {};  
		class Exile_Boat_SDV_Grey: Exile_Boat_SDV_Abstract {};  
	};
};

 

Edited by Bulleit
6 people like this

Share this post


Link to post
Share on other sites
Advertisement

Also, params, much faster than array select x; if you want to get into optimizing it :)

example here

Share this post


Link to post
Share on other sites

Posted (edited)

8 minutes ago, StokesMagee said:

Also, params, much faster than array select x; if you want to get into optimizing it :)

Absolutely, this is a learning project for me (new to ARMA modding).

But what do you mean exactly by params...

Edited by Bulleit

Share this post


Link to post
Share on other sites
6 hours ago, Bulleit said:
  •  @second_coming for Occupation mod from which I learned techniques.

god help you : )

nice idea

4 people like this

Share this post


Link to post
Share on other sites
41 minutes ago, Bulleit said:

Absolutely, this is a learning project for me (new to ARMA modding).

But what do you mean exactly by params...

https://community.bistudio.com/wiki/params

He means that. But it's not exactly "faster" it's main purpose is basically just a fail safe to save you from arma's zero divisor error. You can give a param a default value so in the case that whatever you're trying to select is null it will use that instead.

1 person likes this

Share this post


Link to post
Share on other sites
39 minutes ago, Taylor Swift said:

https://community.bistudio.com/wiki/params

He means that. But it's not exactly "faster" it's main purpose is basically just a fail safe to save you from arma's zero divisor error. You can give a param a default value so in the case that whatever you're trying to select is null it will use that instead.

Perfect, thanks.

Here's a related question: if something was null, when it absolutely should not be, and there's no good default value, what's the "good" approach for handling these in SQF, e.g try/catch/log/exit or just let them bubble up to (a magical unhandled exception handler?)

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.