3141 posts in this topic

Actually having looked at the code, it could be relatively simple to do most of the change (only spawn in range of a player). Long term it would probably also need a monitor adding to despawn AI when no players are within a decent range (it would have to be probably 1500m as you can snipe that far).

I'm testing it on my own server at the moment, if it works out I'll push the change to github.

Edited by second_coming
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement
16 minutes ago, towatai said:

have I already told you that I love you? xD

He's back for 5 minutes and everyone forget about little ol' me! xD ^_^

  • Haha 2

Share this post


Link to post
Share on other sites

You can try this if you want to see if it works:

add a variable to config.sqf:

SC_maxDistanceToPlayer			= 1250;						// Maximum distance in metres to the nearest player

and change fnc_isSafePos.sqf in a3_exile_occupation\scripts\functions to:

private _position       = _this select 0;
private _validspot      = true; 

// is position in range of a player?
if([_position, SC_maxDistanceToPlayer] call ExileClient_util_world_isAlivePlayerInRange) then
{
	_validspot = true; 
}
else
{
	_validspot = false;
};

// Check if position is near a blacklisted area
{
    private _blacklistPos       = _x select 0;
    private _blacklistRadius    = _x select 1;
    private _blacklistMap       = _x select 2;
    if(isNil "_blacklistPos" OR isNil "_blacklistRadius" OR isNil "_blacklistMap") exitWith 
    { 
        _logDetail = format["[OCCUPATION]:: Invalid blacklist position supplied check SC_blackListedAreas in your config.sqf"];
        [_logDetail] call SC_fnc_log;           
        
    };
    if (worldName == _blacklistMap) then
    {
        	
		_distance = _position distance2D _blacklistPos;
		if(_distance < _blacklistRadius) then
        {
            _validspot = false;
			diag_log format["[OCCUPATION]:: %1 is %2m from blacklisted position %3 (blacklisted)",_position,_distance,_blacklistPos];			
        };
    };
}forEach SC_blackListedAreas;

if(_validspot) then
{
    

    // is position too close to a player?
    if([_position, SC_minDistanceToPlayer] call ExileClient_util_world_isAlivePlayerInRange) exitwith { _validspot = false; };

    //Check if near player territory
    private _nearBase = (nearestObjects [_position,["Exile_Construction_Flag_Static"],SC_minDistanceToTerritory]) select 0;
    if (!isNil "_nearBase") then { _validspot = false;  };	

    // is position in range of a territory?
    if([_position, SC_minDistanceToTerritory] call ExileClient_util_world_isTerritoryInRange) exitwith { _validspot = false; };

    // is position in range of a trader zone?
    if([_position, SC_minDistanceToTraders] call ExileClient_util_world_isTraderZoneInRange) exitwith { _validspot = false; };

    // is position in range of a spawn zone?
    if([_position, SC_minDistanceToSpawnZones] call ExileClient_util_world_isSpawnZoneInRange) exitwith { _validspot = false; };

 
	
	// is position in range of a map marker?
	{
		_markerPos = getMarkerPos _x;
		if ((_markerPos distance2D _position) < 350) exitWith { _validspot = false; };
	}
	forEach allMapMarkers;
};       

_validspot	

Pastebin code in case the forum buggers it up: https://pastebin.com/raw/MuhZ34Yy

Share this post


Link to post
Share on other sites
1 hour ago, kuplion said:

He's back for 5 minutes and everyone forget about little ol' me! xD ^_^

How could we ever forget you?!  I just love you both!  My heart is big enough for you two:x

  • Haha 1

Share this post


Link to post
Share on other sites
3 hours ago, second_coming said:

Actually having looked at the code, it could be relatively simple to do most of the change (only spawn in range of a player). Long term it would probably also need a monitor adding to despawn AI when no players are within a decent range (it would have to be probably 1500m as you can snipe that far).

I'm testing it on my own server at the moment, if it works out I'll push the change to github.

Make it easier. you could set a AIDespawnTime

lets say ur resetting AI every 20 minutes, it would be just enough to let them spawn/kill and after 20 minutes they will be wiped.

 

Thanks for the Code btw. your just Awesome :D I will give it a shot in a few Hrs, wish Id knew how to develop it by myself -_- need to learn a lot for coding, but definetly a thing i wanna look forward to

Share this post


Link to post
Share on other sites

I've been testing the change and it's not really suitable as it makes the helicrashes and loot crates only spawn near players. I'm testing a further change at the moment which only makes the other modules spawn near players.

Share this post


Link to post
Share on other sites
27 minutes ago, second_coming said:

I've been testing the change and it's not really suitable as it makes the helicrashes and loot crates only spawn near players. I'm testing a further change at the moment which only makes the other modules spawn near players.

right, as you changed the WHOLE Safespot config

hmmm.

Imma take a look into the files too :D

Was about to write here too as you replied xDDD

EDIT: I'd guess you need to split both parts, and give another option in startOccupation.sqf. so if you set "Player Distance true" you need to set "Roaming AI false"

Edited by GrimReapaa

Share this post


Link to post
Share on other sites
22 hours ago, aNNDREH said:

Where to put the Gear Crates away from each other and away from missions?

http://prntscr.com/mj5jv3

 

 

don't use the code I posted above as it also affects the spawn position of the crates and helicrashes. I have an update to put up but my internet is off at home at the moment as the phone line outside my house snapped on friday.

In the mean time you could try this test version if you want to (this is a test version so not on github yet):

https://www.dropbox.com/s/usiukgzujd8z9l0/a3_exile_occupation.pbo?dl=0

This version is based on Kuplions updated version with an additional process that checks to make sure the roaming AI only spawn in range of players and despawn when out of range, this should ensure that the roaming AI are concentrated around players. I have also included some changes required to make the AI compatible with VCOMAI.

Edited by second_coming
  • Like 3

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.