Jump to content
  • 0

Possible to adjust Veins?


RAMBO

Question

14 answers to this question

Recommended Posts

  • 0

I was just looking into the code, seems like the loot is hardcoded in the config file Doors.hpp (yeah veins are door lol...)

class Land_iron_vein_wreck: ruins	{
	scope = 1;
	model = "\z\addons\dayz_epoch\models\iron_vein_wreck.p3d";
	displayName = "iron vein ruins";
	removeoutput[] = {{"PartOre",{10,10}},{"PartOreSilver",{0,10}},{"PartOreGold",{0,5}}};
};

you can't change that file without a custom epoch client as far as i know, but you could change the script where it uses that value i think.

 

looks like veins are "wrecks" so if you remove them it should be in the file "dayz_code\actions\remove.sqf"

 

i have never actually found a vein in the game so i don't knwo how it works lol, maybe you can figure that out but in the remove.sqf

_isWreckBuilding = _objType in DZE_isWreckBuilding;

is true for veins i think, you can so a check for "isVein" and then customize the the output and ignore the loot from the original loot table. I hope you have some basic scripting knowledge than this should be pretty easy  :)

Link to comment
Share on other sites

  • 0

I was just looking into the code, seems like the loot is hardcoded in the config file Doors.hpp (yeah veins are door lol...)

class Land_iron_vein_wreck: ruins	{
	scope = 1;
	model = "\z\addons\dayz_epoch\models\iron_vein_wreck.p3d";
	displayName = "iron vein ruins";
	removeoutput[] = {{"PartOre",{10,10}},{"PartOreSilver",{0,10}},{"PartOreGold",{0,5}}};
};

you can't change that file without a custom epoch client as far as i know, but you could change the script where it uses that value i think.

 

looks like veins are "wrecks" so if you remove them it should be in the file "dayz_code\actions\remove.sqf"

 

i have never actually found a vein in the game so i don't knwo how it works lol, maybe you can figure that out but in the remove.sqf

_isWreckBuilding = _objType in DZE_isWreckBuilding;

is true for veins i think, you can so a check for "isVein" and then customize the the output and ignore the loot from the original loot table. I hope you have some basic scripting knowledge than this should be pretty easy  :)

 

Thanks for this hint, Axe.

 

I have a better idea how this works now.

 

So far, I changed my variables.sqf to separate the ore veins out of the DZE_isWreckBuilding array, into a DZE_isWrechVein array.

 

I then changed the Remove.sqf like so:

_selectedRemoveOutput = [];
		if(_isWreck) then {
			// Find one random part to give back
			_refundpart = ["PartEngine","PartGeneric","PartFueltank","PartWheel","PartGlass","ItemJerrycan"] call BIS_fnc_selectRandom;
			_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
		} else {
			if(_isWreckVein) then {
				_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
			} else {
			if(_isWreckBuilding) then {
				_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
			} else {
				_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
				_preventRefund = (_objectID == "0" && _objectUID == "0");	
				
			};
			};
		};

My question, is how do I properly populate the _selectedRemoveOutput = []; array

 

With This information:

 

removeoutput[] = {{"PartOre",{10,10}},{"PartOreSilver",{0,10}},{"PartOreGold",{0,5}}};

Link to comment
Share on other sites

  • 0

Okay, after a night of figuring this out, it can be done. It is actually easier to do, than it was to figure out. Go Figure!

Changes must be made in several files. Remove.sqf, fn_selfActions.sqf, variables.sqf and description.ext. You must also add a file I duly named mining.hpp.

Step 1: Create a new text file in your editor. Then copy and paste the following code into the new file.

 

class Mining {
class Land_iron_vein_wreck {
removeoutput[] = {{"PartOre",{10,25}},{"PartOreSilver",{0,1}},{"PartOreGold",{0,5}}};
};
class Land_silver_vein_wreck {
removeoutput[] = {{"PartOreSilver",{10,25}},{"PartOre",{0,1}},{"PartOreGold",{6,4}}};
};
class Land_gold_vein_wreck {
removeoutput[] = {{"PartOreGold",{10,25}},{"PartOre",{0,1}},{"PartOreSilver",{6,4}}};
};
};
Now save this file as mining.hpp and move it into your mission folder. I have mine inside a custom folder.

Step 2: Open your description.ext and add this line of code at the very bottom.

#include "custom\mining.hpp" //Make sure to edit to the proper path to file.
Save and close your description.ext

Step 3: Open your variables.sqf. (I assue you know what and where to find this. Most people have a custom file.)

Look for this code:

 

DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck","Land_ammo_supply_wreck"];
Replace it with this code:

DZE_isWreckVein = ["Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck"];

DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_ammo_supply_wreck"];
Save and close your variables.sqf.

Step 4: Open your fn_selfActions.sqf (If you don't have a custom one, you are gonna have to sort that out.)

Find this code:

_isWreck = _typeOfCursorTarget in DZE_isWreck;
Add this Below it:

 

_isWreckVein = _typeOfCursorTarget in DZE_isWreckVein;
Find this code:

 

//Allow player to delete objects
		if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
			if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
				_player_deleteBuild = true;
			};
		};
Change it to:

 

//Allow player to delete objects
		if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding || _isWreckVein) then {
			if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
				_player_deleteBuild = true;
			};
		};
Save and close your fn_selfActions.sqf

Step 5: Open your remove.sqf

Find this code:

_isWreck = _typeOfCursorTarget in DZE_isWreck;
Add this Below it:

 

_isWreckVein = _typeOfCursorTarget in DZE_isWreckVein;
Find this code:

 

		_selectedRemoveOutput = [];
		if(_isWreck) then {
			// Find one random part to give back
			_refundpart = ["PartEngine","PartGeneric","PartFueltank","PartWheel","PartGlass","ItemJerrycan"] call BIS_fnc_selectRandom;
			_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
		} else {
			if(_isWreckBuilding) then {
				_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
			} else {
				_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
				_preventRefund = (_objectID == "0" && _objectUID == "0");

			};
		};
Change it to this:

 

		_selectedRemoveOutput = [];
		if(_isWreck) then {
			// Find one random part to give back
			_refundpart = ["PartEngine","PartGeneric","PartFueltank","PartWheel","PartGlass","ItemJerrycan"] call BIS_fnc_selectRandom;
			_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
		} else {
			if(_isWreckVein) then {
				_selectedRemoveOutput = getArray (missionConfigFile >> "Mining" >> _objType >> "removeoutput");
			} else {
			if(_isWreckBuilding) then {
				_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
			} else {
				_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
				_preventRefund = (_objectID == "0" && _objectUID == "0");	
				
			};
			};
		};
Save and close your remove.sqf.

You are now done with all my hard work!

Now let me go over customizing the vein loot drops!

Back to the mining.hpp. This code is where it is all done:

 

class Mining {
class Land_iron_vein_wreck {
removeoutput[] = {{"PartOre",{10,25}},{"PartOreSilver",{0,1}},{"PartOreGold",{0,5}}};
};
class Land_silver_vein_wreck {
removeoutput[] = {{"PartOreSilver",{10,25}},{"PartOre",{0,1}},{"PartOreGold",{6,4}}};
};
class Land_gold_vein_wreck {
removeoutput[] = {{"PartOreGold",{10,25}},{"PartOre",{0,1}},{"PartOreSilver",{6,4}}};
};
};
A break down of how it works!

In each class, you will have a line that looks like this:

removeoutput[] = {{"PartOreGold",{10,25}},{"PartOre",{0,1}},{"PartOreSilver",{6,4}}};
This line is the array used to determine what is dropped when you de-construct an ore vein.

 

removeoutput[] = {
{"PartOreGold",{10,25}}, 
//Array Structure
//{"Item to Drop",{AmountGuaranteedToDrop,AmountToRandomlyAddToGuaranteedDropAmount}},
{"PartOre",{0,1}},
{"PartOreSilver",{6,4}}
};
You can even add to the array to add other possible drops like this:

removeoutput[] = {{"PartOreGold",{10,25}},{"PartOre",{0,1}},{"PartOreSilver",{6,4}},{"ItemRuby",{6,4}}};
Please have fun using this!
Link to comment
Share on other sites

  • 0

Redbeard, did you come up with a way of globally removing the vein after its been salvaged by one person?

i got this solved, by making the veins and crates indestructable and able to remove them in the not damaged state.

Arma has some prblems with wrecks, for some reason

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...