Fin ¯\_(ツ)_/¯

Rewards from DMS Occupation Gear Crates!

12 posts in this topic

Hi, quick question.

With regard to the DMS Occupation "Gear crates" that spawn on the map, i would like to make it so when someone completes a gear/loot crate, they get a reward of 1000 pop tabs (example) is that possible?

Also, at the moment, when someone does complete one, it doesnt remove the map marker, and doesnt notify the other players?

 

Thanks!

Share this post


Link to post
Share on other sites

You can simply write code to add pop tabs to the crate itself.

Let me look up the code.


_popTabs = 1200;
_box setVariable ["ExileMoney", _popTabs, true];

This is the code I use to put pop tabs in crates.

Should be able to figure out something from there. It can be done several different ways to randomize it.

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Okay, in the code for occupation file: a3_exile_occupation\scripts\occupationLootCrates.sqf

Look for this section:

    _box = "CargoNet_01_box_F" createvehicle _position;
	clearMagazineCargoGlobal _box;
	clearWeaponCargoGlobal _box;
	clearItemCargoGlobal _box;
	
	_box enableRopeAttach SC_ropeAttach; 	// Stop people airlifting the crate
	_box setVariable ["permaLoot",true]; 	// Crate stays until next server restart
	_box allowDamage false; 				// Stop crates taking damage

	{
		_item = _x select 0;
		_amount = _x select 1;
		_randomAmount = _x select 2;
		_amount = _amount + (random _randomAmount);
		_itemType = _x call BIS_fnc_itemType;
		
		
		if((_itemType select 0) == "Weapon") then
		{
			_box addWeaponCargoGlobal [_item, _amount];	
		};
		if((_itemType select 0) == "Magazine") then
		{
			_box addMagazineCargoGlobal [_item, _amount];	
		};
		if((_itemType select 0) == "Item") then
		{
			_box addItemCargoGlobal [_item, _amount];	
		};
		if((_itemType select 0) == "Equipment") then
		{
			_box addItemCargoGlobal [_item, _amount];	
		};	
		if((_itemType select 0) == "Backpack") then
		{
			_box addBackpackCargoGlobal [_item, _amount];	
		};			
	}forEach SC_LootCrateItems;	

I believe adding it so it looks like this will do the job:

Spoiler

	_box = "CargoNet_01_box_F" createvehicle _position;
	clearMagazineCargoGlobal _box;
	clearWeaponCargoGlobal _box;
	clearItemCargoGlobal _box;
	
	_box enableRopeAttach SC_ropeAttach; 	// Stop people airlifting the crate
	_box setVariable ["permaLoot",true]; 	// Crate stays until next server restart
	_box allowDamage false; 				// Stop crates taking damage
	
	_box setVariable ["ExileMoney",(100 + (round (random 1200))),true]; //Add some pop tabs to the crate.

	{
		_item = _x select 0;
		_amount = _x select 1;
		_randomAmount = _x select 2;
		_amount = _amount + (random _randomAmount);
		_itemType = _x call BIS_fnc_itemType;
		
		
		if((_itemType select 0) == "Weapon") then
		{
			_box addWeaponCargoGlobal [_item, _amount];	
		};
		if((_itemType select 0) == "Magazine") then
		{
			_box addMagazineCargoGlobal [_item, _amount];	
		};
		if((_itemType select 0) == "Item") then
		{
			_box addItemCargoGlobal [_item, _amount];	
		};
		if((_itemType select 0) == "Equipment") then
		{
			_box addItemCargoGlobal [_item, _amount];	
		};	
		if((_itemType select 0) == "Backpack") then
		{
			_box addBackpackCargoGlobal [_item, _amount];	
		};			
	}forEach SC_LootCrateItems;	

 

 

Share this post


Link to post
Share on other sites
16 hours ago, Fin ¯\_(ツ)_/¯ said:

@Redbeard_Actual Thanks so much man, people like you shape the community!

So if i wanted to make the amount 2000 pop tabs, would i change the "random 1200" to "random 2000"??

Thanks!

 

EDIT, this didnt work im afraid, what could have gone wrong?

That's weird. I don't have a server I can test this stuff on right now. But that is the basic code to add money to the cargo of pretty mush anything in Exile.

_box setVariable ["ExileMoney",2000,true]; //Add some pop tabs to the crate.

Share this post


Link to post
Share on other sites
26 minutes ago, Redbeard_Actual said:

That's weird. I don't have a server I can test this stuff on right now. But that is the basic code to add money to the cargo of pretty mush anything in Exile.


_box setVariable ["ExileMoney",2000,true]; //Add some pop tabs to the crate.

@Redbeard_Actual Ok, thanks anyway, ill check out this one without the random part and ill let you know!

Share this post


Link to post
Share on other sites
9 minutes ago, Fin ¯\_(ツ)_/¯ said:

@Redbeard_Actual Ok, thanks anyway, ill check out this one without the random part and ill let you know!

The reason it is weird is that it is a code chunk that is used from DMS to put money on AI. Just the numbers were changed and the variable name for the crate object instead of the variable name for the unit.

I will test this myself when I get a chance. Because I believe the crates should have at least a chance to have a bit of cash in them too.

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.