Jump to content

Roaming AI in Towns Release


MisterT

Recommended Posts

If you create another you will be fine. MSG your skype

 

Finally, with a new folder and a copy of the original .pbo i got it working. Thanks a lot for your patience ;)

Now the PvE party can start ;)

 

Is it possible to make the ai a bit slower/less aggressive in attack? I tried to change combat mode from red to yellow but i can´t feel a difference.

Link to comment
Share on other sites

Thanks for the great script. Thing i noticed is that roughly 14 ai spawned near 1 person, and some despawned, they weren't in combat, but I wonder if this is a cleanup happening or whats going on. Will they despawn if they are in combat?

 

The despawn isn't immediate, but just noticed it from the admin esp

Link to comment
Share on other sites

As I said, I did that.

 

Anyway, just tested it by increasing the AI to 15 to ensure I did come across one and sure enough they are there, but they can't kill me. I would have thought that the solution to that would be included with the original directions.

 

I have posted how to fix this while helping Joker.  I will update the original post.

Link to comment
Share on other sites

Finally, with a new folder and a copy of the original .pbo i got it working. Thanks a lot for your patience ;)

Now the PvE party can start ;)

 

Is it possible to make the ai a bit slower/less aggressive in attack? I tried to change combat mode from red to yellow but i can´t feel a difference.

 

Joker mind posting the steps you did to resolve the no player damage and pbo work around?

Link to comment
Share on other sites

I get this Error. Anyone point me to where to put the missing characters?

 

 

13:05:34 Error in expression <["moveretry", 0, false];
};
sleep 5;
};
};>
13:05:34   Error position: <};>
13:05:34   Error Missing {
13:05:34 Error in expression <["moveretry", 0, false];
};
sleep 5;
};
};>
13:05:34   Error position: <};>
13:05:34   Error Missing {

Link to comment
Share on other sites

Joker mind posting the steps you did to resolve the no player damage and pbo work around?

 

  • I have addad a new folder "@myconfig" in the servers root (where the arma3server.exe is)
  • In this new folder i created a folder "addons"
  • Then copy the file "a3_epoch_server.pbo" from "@epochhive\addons" in the new created folder "@myconfig\addons"
  • Extract the file with PBO Manager and open the file "\compile\epoch_player\EPOCH_server_loadPlayer.sqf" with Notepad++
  • Search in this file as MisterT said for "_av allowDamage false;" and change it to "_av allowDamage true;"
  • Repack the a3_epoch_server folder back to the PBO file ("a3_epoch_server.pbo")
  • Add to your server startparameter @myconfig like this... -mod=@Epoch;@epochhive;@mycon
  • Have fun...

Don´t know if is the best way but it works for me :)

Link to comment
Share on other sites

If that's the case BetterDeadThanZe than don't add any scripts.  Plus scripts you add can cause bugs that are not part of the epochs server files.Which than can cause users to report false bugs. Seeing that you're an Offical Host, you should not install any script. I believe the Dev would agree with this. (Towing,loadouts,AI MIssions,Roaming AI,HC) All these can cause false positives due to badly coded scripts. Than players will report on epoch forums. So you should be Vanilla not I.

 

My server is Not Vanilla, when people login, I state do not report any bugs to epoch forums due to AoA has extra addons. please report to AoA community forums this broadcast every 20 min.  So that there is no confusion. I try to talk to all players on my servers to make sure all gaming aspects are working, fun, balanced, and survival. 

 

I'm here to share what I have accomplished on my server so others can possibly use or not

 

Spawn Selection for Altis Epoch is almost done. I will release soon.

 

MisterT

Link to comment
Share on other sites

I haven'ted tested this yet, but from blckeagl's post this is how he fixed it. I changed the variable to match this script. Add this to the bottom of your generate_zone.sqf and test it. I will test it later tonight.

//Prevents players from having AI God Mode
while {true} do {
	_players = [];
	_nearEntities = count (_civil nearEntities [["MAN"],1000]);
	//diag_log format["_nearEntities: %1",_nearEntities];  //Used for testing
	{
		if (isPlayer _x) then {
		 _players = _players + [_x];
		};
	} foreach (_civil nearEntities [["MAN"],1000]);
	//diag_log format["Nearplayers: %1",_players]; //Used for testing
	if ((count _players) > 0) then {
		_owner = _players call BIS_fnc_selectRandom;
		_civil setOwner (owner _owner);
	};
	//diag_log format["_civil %2 Owner: %1",owner _civil, _civil]; //Used for testing
	waitUntil{_nearEntities != count (_civil nearEntities [["MAN"],1000])};
};
Link to comment
Share on other sites

I get this Error. Anyone point me to where to put the missing characters?

 

 

13:05:34 Error in expression <["moveretry", 0, false];

};

sleep 5;

};

};>

13:05:34   Error position: <};>

13:05:34   Error Missing {

13:05:34 Error in expression <["moveretry", 0, false];

};

sleep 5;

};

};>

13:05:34   Error position: <};>

13:05:34   Error Missing {

 

Everyone should be getting this error unless they fixed it because your logs are telling you there is an extra }; somewhere.  Based on the walk.sqf from the OP some of the code is misaligned and there is an extra brace at the end. See below.

 

walk.sqf:

     private [

        "_allunits",

        "_buildings",

        "_civil",

        "_index",

        "_group",

        "_position",

        "_positions"

    ];

    _allunits = [];

    _positions = [];

    _group = _this select 0;

    _group setcombatmode "RED";

    _group allowfleeing 0;

    _group setspeedmode "FULL";

    {

        _x setbehaviour "COMBAT";

        _x allowFleeing 0;

        _x setvariable ["lastpos", position _x, false];

        _x setvariable ["destination", position _x, false];

        _x setvariable ["moveretry", 0, false];

        _x setunitpos "UP";

    } foreach (units _group);

    

    _position = position (leader _group);

    _buildings = nearestObjects[_position,["House_F"], DCLdistancemove];

    sleep 1;

    {

        _index = 0;

        while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {

            _position = _x buildingPos _index;

            _positions = _positions + [_position];

            _index = _index + 1;

        };

    }foreach _buildings;

    while { count (units _group) > 0 } do {

        if(count _allunits == 0) then {

            _allunits = units _group;

        };

        _civil = _allunits select 0;

        _allunits = _allunits - [_civil];

        

            if(format["%1", _civil getvariable "lastpos"] == format["%1", position _civil]) then {

                _civil setvariable ["moveretry", (_civil getvariable "moveretry") + 1, false];

            };

        

            _civil setvariable ["lastpos", position _civil, false];

        

            if(_civil getvariable "moveretry" > 3) then {

                _position = _positions call BIS_fnc_selectRandom;

                _civil stop false;

                _civil setvariable ["destination", _position, false];

                _civil domove _position;

                _civil setvariable ["moveretry", 0, false];

            };

            sleep 5;

        };

    };<-------------  extra  };  shouldn't be there

Link to comment
Share on other sites

Everyone should be getting this error unless they fixed it because your logs are telling you there is an extra }; somewhere.  Based on the walk.sqf from the OP some of the code is misaligned and there is an extra brace at the end. See below.

 

walk.sqf:

     private [

        "_allunits",

        "_buildings",

        "_civil",

        "_index",

        "_group",

        "_position",

        "_positions"

    ];

    _allunits = [];

    _positions = [];

    _group = _this select 0;

    _group setcombatmode "RED";

    _group allowfleeing 0;

    _group setspeedmode "FULL";

    {

        _x setbehaviour "COMBAT";

        _x allowFleeing 0;

        _x setvariable ["lastpos", position _x, false];

        _x setvariable ["destination", position _x, false];

        _x setvariable ["moveretry", 0, false];

        _x setunitpos "UP";

    } foreach (units _group);

    

    _position = position (leader _group);

    _buildings = nearestObjects[_position,["House_F"], DCLdistancemove];

    sleep 1;

    {

        _index = 0;

        while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {

            _position = _x buildingPos _index;

            _positions = _positions + [_position];

            _index = _index + 1;

        };

    }foreach _buildings;

    while { count (units _group) > 0 } do {

        if(count _allunits == 0) then {

            _allunits = units _group;

        };

        _civil = _allunits select 0;

        _allunits = _allunits - [_civil];

        

            if(format["%1", _civil getvariable "lastpos"] == format["%1", position _civil]) then {

                _civil setvariable ["moveretry", (_civil getvariable "moveretry") + 1, false];

            };

        

            _civil setvariable ["lastpos", position _civil, false];

        

            if(_civil getvariable "moveretry" > 3) then {

                _position = _positions call BIS_fnc_selectRandom;

                _civil stop false;

                _civil setvariable ["destination", _position, false];

                _civil domove _position;

                _civil setvariable ["moveretry", 0, false];

            };

            sleep 5;

        };

    };<-------------  extra  };  shouldn't be there

 

Thanks for reporting this. I fixed on mine and didnt get time to upload. You the man.

Link to comment
Share on other sites

If that's the case BetterDeadThanZe than don't add any scripts.  Plus scripts you add can cause bugs that are not part of the epochs server files.Which than can cause users to report false bugs. Seeing that you're an Offical Host, you should not install any script. I believe the Dev would agree with this. (Towing,loadouts,AI MIssions,Roaming AI,HC) All these can cause false positives due to badly coded scripts. Than players will report on epoch forums. So you should be Vanilla not I.

 

My server is Not Vanilla, when people login, I state do not report any bugs to epoch forums due to AoA has extra addons. please report to AoA community forums this broadcast every 20 min.  So that there is no confusion. I try to talk to all players on my servers to make sure all gaming aspects are working, fun, balanced, and survival. 

 

I'm here to share what I have accomplished on my server so others can possibly use or not

 

Spawn Selection for Altis Epoch is almost done. I will release soon.

 

MisterT

 

I don't have any of those scripts you mentioned. What I do have (loot on the floor of the buildings and welcome credits) were added to the server files without taking core Epoch files and manipulating them. By using core Epoch files, you'll need to edit those files again and again with every release. It's better to do scripts that can run outside of those Epoch files.

Link to comment
Share on other sites

btw this fixed the damage issue without having to edit any epoch files.

//Prevents players from having AI God Mode
while {true} do {
	_players = [];
	_nearEntities = count (_civil nearEntities [["MAN"],1000]);
	//diag_log format["_nearEntities: %1",_nearEntities];  //Used for testing
	{
		if (isPlayer _x) then {
		 _players = _players + [_x];
		};
	} foreach (_civil nearEntities [["MAN"],1000]);
	//diag_log format["Nearplayers: %1",_players]; //Used for testing
	if ((count _players) > 0) then {
		_owner = _players call BIS_fnc_selectRandom;
		_civil setOwner (owner _owner);
	};
	//diag_log format["_civil %2 Owner: %1",owner _civil, _civil]; //Used for testing
	waitUntil{_nearEntities != count (_civil nearEntities [["MAN"],1000])};
};
Link to comment
Share on other sites

 

btw this fixed the damage issue without having to edit any epoch files.

//Prevents players from having AI God Mode
while {true} do {
	_players = [];
	_nearEntities = count (_civil nearEntities [["MAN"],1000]);
	//diag_log format["_nearEntities: %1",_nearEntities];  //Used for testing
	{
		if (isPlayer _x) then {
		 _players = _players + [_x];
		};
	} foreach (_civil nearEntities [["MAN"],1000]);
	//diag_log format["Nearplayers: %1",_players]; //Used for testing
	if ((count _players) > 0) then {
		_owner = _players call BIS_fnc_selectRandom;
		_civil setOwner (owner _owner);
	};
	//diag_log format["_civil %2 Owner: %1",owner _civil, _civil]; //Used for testing
	waitUntil{_nearEntities != count (_civil nearEntities [["MAN"],1000])};
};

I Add this to the bottom of my generate_zone.sqf and still no damage from roaming ai

Link to comment
Share on other sites

This works perfect as you can see a lot of people already use this. So where are you client.rpt and server rpt errors? 

 

Hiya MisterT, 

 

I too have this issue - no AI spawning at all.

I then realised this was only made for Altis - then I went to get all the Chernarus WorldSpace coords, added that and still nothing. 

Then I changed from 39% chance to 100% chance and still nothing

 

Coords - in case you want to use em:

 

DCLaltistownpositions = [[4500,2460],[14000,15160],[12900,10060],[15100,13860],[3300,3960],[5600,2560],[12000,13760],[6700,2660],[12900,15060],[11200,6660],[3300,4960],[6600,3660],[10400,9860],[10300,2160],[9500,8860],[5900,10360],[8400,6760],[8500,11960],[5300,8660],[1900,2260],[6600,14560],[12100,3560],[12500,14660],[12200,10960],[3600,2560],[4400,4660],[11100,12360],[6400,15060],[2700,10060],[7900,13060],[7500,5160],[11200,5560],[2000,7360],[5800,4760],[9200,14660],[12900,7960],[3600,13160],[11600,14460],[6100,3260],[7000,7760],[13300,12960],[12100,7360],[1600,3860],[4400,6460],[10600,8060],[5700,13560],[7900,3260],[4900,5660],[9100,3860],[3000,7960],[6100,12760],[4700,6860],[7900,12660],[9600,6660],[1400,11960],[11400,15160],[13400,6160],[2500,6360],[10100,5460],[6100,7760],[4900,15160],[9500,13860],[13900,13260],[3400,14860],[2700,12360],[7600,13460],[12800,4460],[13500,14160],[2200,11060],[3800,8960],[9900,10460],[6500,6060],[4500,13260],[2700,5460]];

 
Attached are also my rpt files.

 

arma3server_2015-01-09_09-57-56.zip

Link to comment
Share on other sites

all installed but getting a lovely error

 

 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];
 
};
 
while { tr>
17:13:22   Error position: <_position, _civilrole]];
 
};
 
while { tr>
17:13:22   Error Undefined variable in expression: _position
17:13:22 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];
 
};
 
 
oh and ya no ai spawn
 
while { tr>
17:13:22   Error position: <_position, _civilrole]];
 
};
 
while { tr>
17:13:22   Error Undefined variable in expression: _position
17:13:22 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];
 
};
 
while { tr>
17:13:22   Error position: <_position, _civilrole]];
 
};
 
while { tr>
17:13:22   Error Undefined variable in expression: _position
17:13:22 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
17:13:22   Error position: <createUnit [_civiltype, (_x select 1), [>
17:13:22   Error 0 elements provided, 3 expected
17:13:22 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
17:13:22   Error position: <createUnit [_civiltype, (_x select 1), [>
17:13:22   Error 0 elements provided, 3 expected
17:13:22 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
17:13:22   Error position: <createUnit [_civiltype, (_x select 1), [>
17:13:22   Error 0 elements provided, 3 expected
Edited by Humpabry
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
×
×
  • Create New...