Jump to content

blckeagls' AI Mission - Version 2.0.2 Release (1/2/2015)


blckeagls

Recommended Posts

I have compiled some code from multiple authors and edited them.  Most of this being from Arma 2, since I have been running this script for over a year, I don't remember the authors.

 

Thanks to GhostRider for taking this and improving it.  You can see his improvements on his GitHub: https://github.com/G...v-2.0.2-updated

 

 

Current Version Number: 2.0.2

 

AI Features:
4 AI Missions (Each Different Color)

Each mission individually configurable
New Improved AI setOwner to enable JIP and new spawn damage
4 Crates at each mission (You can edit each one individually)

Variable amount of AI at each location, you can choose the range. (Default 5-15)

 

 

If anyone has any other cool ideas they would like me to make..  Personal Message me...  I'll work on them and post them on forum when completed if I like them...

 

NOTE: DO NOT USE CUSTOM @MOD FOLDERS, WILL PREVENT SERVER FROM SHOWING ON LAUNCHERS(Like A3LAUNCHER)

 

Instructions:

1. Download the attached files.

2. Add custom_server.pbo in your @EpochHive/Addons/ folder.

3. In your Mission Folder or PBO , if you have an init.sqf go to step 5.

4. Create a file called "init.sqf" in your mission folder or PBO (init.sqf provided in .zip)

5. Add the following Lines:

//If server execute this script
if (isServer) then {
	execVM "\q\addons\custom_server\init.sqf";
//If anything but server execute this script
} else {
	[] spawn {
		//This is to spawn the markers when players enter after server has started
		[] execVM "debug\addmarkers.sqf";
		[] execVM "debug\addmarkers2.sqf";
		[] execVM "debug\addmarkers75.sqf";
		[] execVM "debug\addmarkers752.sqf";
		//Event handler to show messages to players // this can be used for other scripts to send messages to players -- see AIM.sqf
		"blck_Message" addPublicVariableEventHandler {titleText[format["%1",_this select 1],"PLAIN DOWN",1];};
	};
}; 

6. Unzip the mission.zip file and add the debug folder into your mission folder or PBO. (init.sqf is provided only needed if step 6 was not completed)

 

You are complete!  Enjoy!
 

 

ATTACHED IN THE ZIP ARE THE BE FILTERS THAT I AM USING..  IF THEY DON'T WORK FOR YOU, NOT SURE WHY.  Due to too many people having different BE Filters issues, I will not provide BE Filter Support.  Use mine if you have issues (make a backup of your old ones in case of further issues)

 

 

AI Damaging players was configured by the following code added to the end of the AI.sqf and AI1.sqf files.

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

AI Cleanup was completed by adding the following:

_ai1 spawn {
	waitUntil{!alive _this};
	_this setOwner 1;
	sleep blck_aiCleanUpTimer;
	deleteVehicle _this;
};
  • FILES CAN BE EDITTED. to edit the server files, you need to unpack the custom_server.pbo with PBOMANAGER...  then once your done editting repack the PBO.
  • To edit I would suggest using Notepad++ and the SQF Addon from Armaholics
  • The PBOManager can be downloaded from Armaholics as well

Change Notes:

2.0.1 > 2.0.2

Minor Fixes

 

2.0.0 > 2.0.1

Fixed the issue with the AI not getting inside vehicles

 

1.3.4 > 2.0.0

You can customize the look, number of AI, AI Weapons at each mission individually (see init.sqf in the server files).

Provided my BE Filters..

Changed the way the AI get weapons and magazines (Now specifed in server init.sqf as  ["Weapon","Magazine"] )

Changed how the AI get their owner to provide player damage.

Removed all items from AI before adding new items to prevent providing items you dont want..

Added a section to add FirstAid Packs and other items...

Added function to make sure AI Missions are a certain distance from each other (Default in init.sqf:  MinDistanceFromMission = 500;)

 

1.3.3 > 1.3.4

Added setOwner script to the AI in spawnvehicles.sqf

 

1.3.2 > 1.3.3

Commented code to help understand what is happening better

Removes some Headless Client testing code

 

1.3.1 > 1.3.2

Fixed issue where Minor/SM1.sqf wouldn't remove marker (Thanks to ilganna)

Removed unnecessary code from spawnvehicles.sqf

 

1.3.0 > 1.3.1

Added the debug folder to zip file

 

1.2.0 > 1.3.0
Updated code for setOwner
Added removeBackpackGlobal for AI (Some would spawn with unwanted items) to remove the backpacks

Fixed issue where specified weapons wouldn't be given to AI, rather default weapons.

 

blck AI Mission v2.0.2.zip

Edited by blckeagls
Link to comment
Share on other sites

  • 2 weeks later...
Getting kicked. What to do??
 
BattlEye Server: Script Log: #0 Riggs (0c90c3bd86f5c20cb4ad63754fc487c8) - #20 " "mpmissions\__CUR_MP.Altis\init.sqf"
12:34:10   if (isDedicated) then {
12:34:10   execVM "\q\addons\custom_server\init.sqf";
12:34:10   } else {
12:34:10   [] spawn {
12:34:10   [] "
12:34:10 Player Riggs kicked off by BattlEye: Script Restriction #20
12:34:10 Player Riggs disconnected.
Link to comment
Share on other sites


13:54:42 Error position: <_owner in _players)) then {
_ownerOnline>3:54:42 Error Undefined variable in expression: _owner
13:54:42 File q\addons\custom_server\AIMission\AI1.sqf, line 40
13:54:42 Error in expression < + [_x];
} foreach playableunits;
if (!(_owner in _players)) then {
_ownerOnline>
 This is the result i get on rpt, any ideas?

Link to comment
Share on other sites

13:54:42 Error position: <_owner in _players)) then {

_ownerOnline>3:54:42 Error Undefined variable in expression: _owner

13:54:42 File q\addons\custom_server\AIMission\AI1.sqf, line 40

13:54:42 Error in expression < + [_x];

} foreach playableunits;

if (!(_owner in _players)) then {

_ownerOnline>

 This is the result i get on rpt, any ideas?

Did you use the newest PBO?

or use my code in another script?

make sure the variables are listed in the private ["_var1","_var2"] etc...

Link to comment
Share on other sites

Can someone plz help me? I`m new to Arma3 Servers. Where in scripts.txt i have to put this?

 

 

thx

You should be able to add it to the bottom of your scripts.txt

I believe it should be:  7 !="mpmissions\__CUR_MP.Altis\init.sqf"

For some reason I dont get kicks for this and I didnt update BE filters

Link to comment
Share on other sites

Is this configured for the Altis Map only?

It is...  To fix it for Chernarus or other maps change this in the SM1 of the Major and Minor missions

_coords = [[6322,7801,0],300,12000,30,0,10,0] call BIS_fnc_findSafePos;

to:

            Center Pos       Range
_coords = [[6322,7801,0],300,12000,30,0,10,0] call BIS_fnc_findSafePos;

For Chernarus this should work:
_coords = [[6322,7801,0],300,5000,30,0,10,0] call BIS_fnc_findSafePos;

In ver 1.2+ i added support to define these in the server init.sqf file..

Link to comment
Share on other sites

Hi blckeagls,

 

thanks for the mission system, it's working good; however I have a little issue: when I complete a mission the marker isn't cleared up...

Any fix I can apply?

 

Thanks!

 

- Michel

Do you have the Debug folder in your mission files?

I'll put the cleanup in script and re-upload files.. Wait for an update in the first post...

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
×
×
  • Create New...