Jump to content

Setting maximum grade


Recommended Posts

I had a mission spawn in Taksitan tonight on one crazy hill. Is there a way to limit the locations to those below a certain grade?

 

I read this page: http://tactical.nekromantix.com/wiki/doku.php?id=arma2:scripting:bis_fnc_findsafepos

 

And I saw in DZMSFunctions.sqf these lines:

DZMSFindPos = {
    private["_mapHardCenter","_mapRadii","_isTavi","_centerPos","_pos","_disCorner","_hardX","_hardY","_findRun","_posX","_posY","_feel1","_feel2","_feel3","_feel4","_noWater","_tavTest","_tavHeight","_disMaj","_disMin","_okDis","_isBlack","_playerNear"];
  
    //Lets try to use map specific "Novy Sobor Fixes".
    //If the map is unrecognised this function will still work.
	//Better code thanks to Halv
	_mapHardCenter = true;
	_mapRadii = 5500;
	_isTavi = false;
	_tavHeight = 0;
	switch (DZMSWorldName) do {
		case "chernarus":{_centerPos = [7100, 7750, 0];_mapRadii = 5500;};
		case "utes":{_centerPos = [3500, 3500, 0];_mapRadii = 3500;};
		case "zargabad":{_centerPos = [4096, 4096, 0];_mapRadii = 4096;};
		case "fallujah":{_centerPos = [3500, 3500, 0];_mapRadii = 3500;};
		case "takistan":{_centerPos = [5500, 6500, 0];_mapRadii = 5000;};
		case "tavi":{_centerPos = [10370, 11510, 0];_mapRadii = 14090;_isTavi = true;};
		case "lingor":{_centerPos = [4400, 4400, 0];_mapRadii = 4400;};
		case "namalsk":{_centerPos = [4352, 7348, 0]};
		case "napf":{_centerPos = [10240, 10240, 0];_mapRadii = 10240;};
		case "mbg_celle2":{_centerPos = [8765.27, 2075.58, 0]};
		case "oring":{_centerPos = [1577, 3429, 0]};
		case "panthera2":{_centerPos = [4400, 4400, 0];_mapRadii = 4400;};
		case "isladuala":{_centerPos = [4400, 4400, 0];_mapRadii = 4400;};
		case "smd_sahrani_a2":{_centerPos = [13200, 8850, 0]};
		case "sauerland":{_centerPos = [12800, 12800, 0];_mapRadii = 12800;};
		case "trinity":{_centerPos = [6400, 6400, 0];_mapRadii = 6400;};
		//We don't have a supported map. Let's use the norm.
		default{_pos = [getMarkerPos "center",0,5500,60,0,20,0] call BIS_fnc_findSafePos;_mapHardCenter = false;};
	};

I'm just not too sure how I would adjust that to allow a maximum grade for a mission to spawn on.

Link to comment
Share on other sites

I love when that happens. I get it too and its one of the things on my hit list. I'll get back to you soon if I have a fix :)

 

 

Edit:

 

Try replace the Tavi Line with this. Seemed to work for me.

		case "tavi":{
					_centerPos = [10370, 11510, 0];
					_mapRadii = 14090;
					_safePos = [_centerPos, 0, _mapRadii, 30, 0, 20, 0] call BIS_fnc_findSafePos;
					diag_log format ["Finding Safe Pos for Tavi: %1", _safePos];
					_isTavi = true;
		};

You can remove the log entry, was just using that to tell when the mission was spawning

 

Edit 2: Never-mind, The first one got lucky it seems, still worth to try I guess but the static vehicles still spazzed out for me. 

Link to comment
Share on other sites

Yeah just adjust the gradient, 20 seems a tad too high:

default{_pos = [getMarkerPos "center",0,5500,60,0,20,0] call BIS_fnc_findSafePos

If you want missions to spawn on relatively flat terrain, I wouldn't go higher than 5.

Link to comment
Share on other sites

Yeah just adjust the gradient, 20 seems a tad too high:

default{_pos = [getMarkerPos "center",0,5500,60,0,20,0] call BIS_fnc_findSafePos

If you want missions to spawn on relatively flat terrain, I wouldn't go higher than 5.

 

Wouldn't I need to edit this line since it's Takistan? I figured the line above was only if the map wasn't detected.

case "takistan":{_centerPos = [5500, 6500, 0];_mapRadii = 5000;};
Link to comment
Share on other sites

A little off topic here Dean, but I think you guys over at Dayz Evolved need some spam protection for your forum:

 

soiEcC.png

 

I'm not in charge of the forums haha, Its crappy forum thing don't even think you can do anything on it haha,

 

on-topic: My one looked like it did work, but I didn't test it properly I just threw it in there, so it might be worth trying but yeah possibly because I had it set to 20 as gradient  

Link to comment
Share on other sites

I'm not in charge of the forums haha, Its crappy forum thing don't even think you can do anything on it haha,

 

on-topic: My one looked like it did work, but I didn't test it properly I just threw it in there, so it might be worth trying but yeah possibly because I had it set to 20 as gradient  

 

Where did you put the 20? In the "default" line or the line for the map you are running?

Link to comment
Share on other sites


case "takistan":{
_centerPos = [5500, 6500, 0];
_mapRadii = 5000;
_safePos = [_centerPos, 0, _mapRadii, 30, 0, 20, 0] call BIS_fnc_findSafePos;
diag_log format ["Finding Safe Pos for Takistan: %1", _safePos]; 
};

should do it 

Link to comment
Share on other sites

hmm, try changing this then. around/at line 116

        //We need to loop findSafePos until it doesn't return the map center
        _findRun = true;
        while {_findRun} do
        {
            _pos = [_centerPos,0,_mapRadii,60,0,20,0] call BIS_fnc_findSafePos;
           
Link to comment
Share on other sites

 

hmm, try changing this then. around/at line 116

        //We need to loop findSafePos until it doesn't return the map center
        _findRun = true;
        while {_findRun} do
        {
            _pos = [_centerPos,0,_mapRadii,60,0,20,0] call BIS_fnc_findSafePos;
           

 

It looks like that did it. I've been checking the missions and they all seem to be spawning on much more flat ground.

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

×
×
  • Create New...