Jump to content

Treasure hunt addon for Ems 0.3


brw1990

Recommended Posts

Treasure Hunt Addon.

 

Fully tested and works great!

 

https://www.dropbox.com/sh/ubfv2kvaydv57jc/GErygVkuZ6

 

I added this into the ems 0.3 thinking it would be a nice escape for the those survivors who just wanted to do a mission and make some money and not worry about bandits. i own a PvE and its a great addon. it works well with the mission system just gives you a third mission to run.

 

What it does.

 

It spawns a crate in a 750x750 Green circle and fills it with gold,silver,copper which can be changed to your liking.

 

g03g.jpg

 

which makes the players, have to wonder around this huge circle looking for a little green box on the ground.

 

You can edit the sayings to those are just what i picked.

 

98ag.jpg

 

ffqm.jpg

 

it sticks with the random select so what ever you put in it, it will random select your items in sets of 10, my box had gold,silver,copper set it in and random selected copper and silver. thus making the treasure hunt each time different and fun. some loot may be shy some maybe great, its like in real games.

 

88ue.jpg

 

once the treasure is found it clears itself. And restarts the timer.

 

d0ub.jpg

 

Set up - moderate.

need notepad++

basic knowledge of your server pbo.

ems 0.3.

your pbo of choose packer.

Dayz epoch 1.0.4.2

 

1.Too start your going to need to get your dayz_server.pbo  By downloading it off your server provider. then unpack it and load in ems 0.3.

 

2. Once its unpacked go into your ems/missions file and add a folder named Treasurehunt. (has to be like that) (then add the file tr1.sqf into the folder.

 

3. next your going to go into your script folder in the ems 0.3 and add the following line to your you DZMSBOX.sqf

_Treasure = ["ItemGoldbar","Itemsilverbar10oz","ItemCopperBar10oz"];

so it looks like this.


_bpackList = ["DZ_ALICE_Pack_EP1","DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];
_gshellList = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203"];
_medical = ["ItemBandage","ItemMorphine","ItemEpinephrine","ItemPainkiller","ItemWaterbottle","FoodMRE","ItemAntibiotic","ItemBloodbag"];
_Treasure = ["ItemGoldbar","Itemsilverbar10oz","ItemCopperBar10oz"];

4. Then your going to add this into the DZMSBox.sqf. i added it above medical.

///////////////////////////////////////////////////////////Treasure Hunt By Brw1990
if (_type == "Treasure") then {
	// load treasure
	_scount = count _Treasure;
	for "_x" from 1 to 3 do {
		_sSelect = floor(random _sCount);
		_item = _Treasure select _sSelect;
		_crate addMagazineCargoGlobal [_item,10];
	};
};

5.Now your going to stay in your scripts and add the following scripts. DZMSaddtreasurehunt.sqf and DZMSTrTimer.sqf.

 

6. Now your going to stay in scripts and looker for DZMSMarkerloop.sqf and add the following.

Right above //now we wait another 25 seconds.(which is at the bottom)

	/////////Treasure hunt////////by brw1990
		if (!(getMarkerColor "DZMStrMarker" == "")) then {
		deleteMarker "DZMStrMarker";
		//Re-Add the markers
		_nul = createMarker ["DZMStrMarker", DZMStrCoords];
		"DZMStrMarker" setMarkerColor "ColorGreen";
		"DZMStrMarker" setMarkerShape "ELLIPSE";
		"DZMStrMarker" setMarkerBrush "Grid";
		"DZMStrMarker" setMarkerSize [750,750];
	};

7. Now your going to go into your DZMSconfig.sqf and add the following. bellow dzmsminormax =990  around line 62.

// Time in seconds before a Treasure Hunt mission will run.
// At least this much time will pass between treasure hunt missions. Default = 3600 (1 hour)
DZMStrMin = 3600;

// Maximum time in seconds before a Treasure mission will run.
// A Treasure hunt mission will always run before this much time has passed. Default = 3605 (1 hour 5 seconds)
DZMStrMax = 3605;

8. Then your going to need to add in the same file DZMSconfig.sqf

DZMStreasureArray = ["tr1"];

so it looks like.

DZMSMajorArray = ["SM1","SM2","SM3","SM4","SM5","SM6","SM7","SM8","SM9","SM10","SM13"];
DZMSMinorArray = ["SM1","SM2","SM3","SM4","SM5","SM6","SM7","SM8","SM9","SM10","SM11","SM12"];
DZMStreasureArray = ["tr1"];

9. now your going to go into your DZMSfunctions.sqf and add the following lines.

DZMSTRTIMER = "\z\addons\dayz_server\EMS\Scripts\DZMStrTimer.sqf";


DZMSAddtreasurehunt = "\z\addons\dayz_server\EMS\Scripts\DZMSAddtreasurehunt.sqf";

So i looks like.

DZMSMajTimer = "\z\addons\dayz_server\EMS\Scripts\DZMSMajTimer.sqf";
DZMSMinTimer = "\z\addons\dayz_server\EMS\Scripts\DZMSMinTimer.sqf";
DZMSTRTIMER = "\z\addons\dayz_server\EMS\Scripts\DZMStrTimer.sqf";
DZMSMarkerLoop = "\z\addons\dayz_server\EMS\Scripts\DZMSMarkerLoop.sqf";

DZMSAddMajMarker = "\z\addons\dayz_server\EMS\Scripts\DZMSAddMajMarker.sqf";
DZMSAddMinMarker = "\z\addons\dayz_server\EMS\Scripts\DZMSAddMinMarker.sqf";
DZMSAddtreasurehunt = "\z\addons\dayz_server\EMS\Scripts\DZMSAddtreasurehunt.sqf

10. Now your going to go into your DZMSInit.sqf and add the following line.

[] ExecVM DZMStrTimer;

so it looks like this. around line 100.

[] ExecVM DZMSMajTimer;
[] ExecVM DZMSMinTimer;
[] ExecVM DZMStrTimer;

now pack it all up watch it play. Enjoy i know my players are. please give credit where credits do.

 

I don't take credit for making the EMS 0.3 i did not make that. i just added the mission.

 

Any bugs or issues please report so i can try and fix.

 

https://www.dropbox.com/sh/ubfv2kvaydv57jc/GErygVkuZ6

Link to comment
Share on other sites

  • 2 months later...

yes thats the way i have set up when i get time ill figure out how to move the cord so it clears and you can set the box at the different spot

 Um, im confused since you wrote

"which makes the players, have to wonder around this huge circle looking for a little green box on the ground."

If it spawns the box in the middle of the circle then its not a hunt. ill write something up in a bit and post it here

 

EDIT# Posted below

Link to comment
Share on other sites

treasure always spawns in the middle of the circle? is this normal?

 

In order to spawn the crate in a random location with-in the map grid, open the tr1.sqf

and replace:

_crate = createVehicle ["USLaunchersBox",[(_coords select 0) -5, (_coords select 1),0],[], 0, "CAN_COLLIDE"];

with 

_iPosX = _coords select 0;
_iPosY = _coords select 1;
_positionOffset = Random(50);
_randomMath = Random(1);
if (_randomMath < 1 ) then {
 _randomPosition = [_iPosX -_positionOffset,_iPosY - _positionOffset,0 ];
} else 
{
 _randomPosition = [_iPosX + _positionOffset,_iPosY + _positionOffset,0 ];
};

_crate = createVehicle ["USLaunchersBox", _randomPosition, [], 0, "CAN_COLLIDE"];

found a typo in my original post, its now updated, if you used this prior fix Rnadom to Random

Link to comment
Share on other sites

In order to spawn the crate in a random location with-in the map grid, open the tr1.sqf

and replace:

_crate = createVehicle ["USLaunchersBox",[(_coords select 0) -5, (_coords select 1),0],[], 0, "CAN_COLLIDE"];

with 

_iPosX = _coords select 0;
_iPosY = _coords select 1;
_positionOffset = Random(50);
_randomMath = Random(1);
if (_randomMath < 1 ) then {
 _randomPosition = [_iPosX -_positionOffset,_iPosY - _positionOffset,0 ];
} else 
{
 _randomPosition = [_iPosX + _positionOffset,_iPosY + _positionOffset,0 ];
};

_crate = createVehicle ["USLaunchersBox", _randomPosition, [], 0, "CAN_COLLIDE"];

found a typo in my original post, its now updated, if you used this prior fix Rnadom to Random

 

Did you just seriously like your own post. Boss :D

Link to comment
Share on other sites

  • 2 weeks later...

Hello I keep getting this error every few seconds in the RPT, any ideas on how to fix this?

waitUntil {DZMStreasureDone};
DZMStreasureDone = ni>
1:20:35 Error position: <DZMStreasureDone};
DZMStreasureDone = ni>
1:20:35 Error Undefined variable in expression: dzmstreasuredone
1:20:35 File z\addons\dayz_server\EMS\Scripts\DZMStrTimer.sqf, line 36
1:20:35 Error in expression <easurehunt %1.",_varName];

Link to comment
Share on other sites

Hello I keep getting this error every few seconds in the RPT, any ideas on how to fix this?

waitUntil {DZMStreasureDone};

DZMStreasureDone = ni>

1:20:35 Error position: <DZMStreasureDone};

DZMStreasureDone = ni>

1:20:35 Error Undefined variable in expression: dzmstreasuredone

1:20:35 File z\addons\dayz_server\EMS\Scripts\DZMStrTimer.sqf, line 36

1:20:35 Error in expression <easurehunt %1.",_varName];

 

This is a result of updating arma2 on your server to 112555, however its nothing to be concerned about, the error was there before but now with 112555 its shown, you will prob find alot of errors with the tag "undefined variable"

Link to comment
Share on other sites

  • 1 month later...

Ok i have tryed to make the Loot Box Bigger And Made the Circle even smaller i cant seem to find the box at all... When i have Random installed

 

 

All works fine when im not using the random script .. plz help me !! :)

Link to comment
Share on other sites

  • 7 months later...

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
  • Discord

×
×
  • Create New...