Jump to content

AI MISSIONS?


Diceman

Recommended Posts

Got ai to spawn, markers to show. The ai now turns, shoots, runs and then gets deleted after ~7 seconds. Thought I had this nailed. Oh well, back to the drawing board. At least a box of loot spawns. However:

_crate = createVehicle ["Box_NATO_Wps_F",[(DMS_Cords select 0) - 1, DMS_Cords select 1,0],[], 0, "CAN_COLLIDE"];
clearWeaponCargo _crate;
clearMagazineCargo _crate;

Doesn't seem to delete it's content. Perhaps it's the box itself that's designed to contain loot.

How does your time/cleanup script look like do you have called twice with the timer so maybe it loops ?

Link to comment
Share on other sites

i see.. Hey how about adding this to AI script that goes with the Loot spawn but in a seperate call.

 

for example ..

 

_buildCIV=

[

    "Land_whatever",

    "Land_whatever"

];

 

items_spawn=

[

     ["gun"],
    ["anothergun"]

];

 

    randomitems =
    {
        _position = _this;
        _selectedgroup = (floor(random(count items_spawn)));
        _weapon = items_spawn select _selectedgroup select 0;
        { deleteVehicle _x; } forEach nearestObjects [_position,["groundWeaponHolder"],0.3]; 
        _weaponholder = createVehicle ["groundWeaponHolder", _position, [], 0, "CAN_COLLIDE"];
        _weaponholder addItemCargoGlobal [_weapon, 1];
        if((count((items_spawn) select _selectedgroup)) > 1) then {
            _mag = items_spawn select _selectedgroup select ((floor(random((count(items_spawnt select _selectedgroup) - 1)))) + 1);
            _weaponholder addMagazineCargoGlobal [_mag, 1];
        };
        _weaponholder setPos _position;
    };

  

----

 

raising the loot where you want loot to spawn for example.. would it work ? (im still a noob at this... but anyhow that is why im asking)

Link to comment
Share on other sites

I posted the following to the bug report forum. At this point I think there is something up with the server, possibly an unintended artifact of the admin tools or core ai code.

 

 

1. Personal Testing Server

2. Arma3 1.3.6, EPOCH 2.5.1

3. Adding static AI encounters

 

-Attempting to add additional AI results in the server conducting cleanup within 7-30secs of the AI spawning

-Additionally, AI spawned will target and engage a player, but the player is in 'god' mode and takes no damage from their weapons.

-Killing the AI results in a corpse that contains lootable items.  Dead bodies and associated gear remain after the cleanup.

 

I have attempted to locate a publicvariable that may need to be set to dodge the cleanup, but the cleanup script itself does not look to evaluate for such a variable.

 

I examined the logic for the UAV encounters, and did set the 'EPOCH_TEMPOBJ_PVS' variable but that did not seem to do the trick either.

 

I am attempting to add the ai through the execVM of a script located in the mpmissions 'init.sqf' file

Link to comment
Share on other sites

well the cleanup deletes everything not in its "lists", so from a general programming point of view you either;

1. disable epoch cleanup some how

2. add units you spawn to the cleanup safe lists (ailist etc)

3. make units that cleanup cannot find somehow??

Really what else can possibly be done?

Link to comment
Share on other sites

you could post something obvious

I really dont get where your coming from? I haven't even tried adding AI so I do not know any solution yet, these are only my ideas from a programming background, though I do not know SQF very well yet.

One of these must be possible surely? (albeit not disabling cleanup as is against rules, and ofc modifying it i didnt put on list also because of rules).

Link to comment
Share on other sites

/* 

Finds random spot in radius of center map, bla bla bla marker 
@FileOverlordCreatorofAllMasterCommanderAlphandtheOmega: Defent

*/
	private ["_pos","_centerPos"];
	
	_centerPos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
	_pos = [getMarkerPos "center",4000,20000,10,0,25,0] call BIS_fnc_findSafePos;
	DMS_Cords = _pos;
	diag_log format ["DMS: Pos found at: [%1] - markers spawning!",_pos];
	// wait with script till pos is found
	waitUntil {_pos};
	DMS_Main = createMarker ["DMS_Main", DMS_Cords];
	DMS_Main setMarkerColor "ColorRed";
	DMS_Main setMarkerShape "ELLIPSE";
	DMS_Main setMarkerBrush "Grid";
	DMS_Main setMarkerSize [150,150];
	diag_log format ["DMS: Mission starting at %1",_pos];
	sleep 4;
	
	publicVariable "DMS_Cords";
	_aispawn = [DMS_Cords,80,6,6,1] execVM "Scrip\path\to\file.sqf";//AI Guards
	

Here is my marker script, it also finds a random spot. If you're interested in how works. I will change this a lot since it's not optimized and it does not have any timers.

 

I might share the rest of my (4) files if I feel like it. Who knows when that is.

Link to comment
Share on other sites

/* 

Finds random spot in radius of center map, bla bla bla marker 
@FileOverlordCreatorofAllMasterCommanderAlphandtheOmega: Defent

*/
	private ["_pos","_centerPos"];
	
	_centerPos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
	_pos = [getMarkerPos "center",4000,20000,10,0,25,0] call BIS_fnc_findSafePos;
	DMS_Cords = _pos;
	diag_log format ["DMS: Pos found at: [%1] - markers spawning!",_pos];
	// wait with script till pos is found
	waitUntil {_pos};
	DMS_Main = createMarker ["DMS_Main", DMS_Cords];
	DMS_Main setMarkerColor "ColorRed";
	DMS_Main setMarkerShape "ELLIPSE";
	DMS_Main setMarkerBrush "Grid";
	DMS_Main setMarkerSize [150,150];
	diag_log format ["DMS: Mission starting at %1",_pos];
	sleep 4;
	
	publicVariable "DMS_Cords";
	_aispawn = [DMS_Cords,80,6,6,1] execVM "Scrip\path\to\file.sqf";//AI Guards
	

Here is my marker script, it also finds a random spot. If you're interested in how works. I will change this a lot since it's not optimized and it does not have any timers.

 

I might share the rest of my (4) files if I feel like it. Who knows when that is.

 

I think everyone has that part made lol 

Link to comment
Share on other sites

/* 

Finds random spot in radius of center map, bla bla bla marker 
@FileOverlordCreatorofAllMasterCommanderAlphandtheOmega: Defent

*/
	private ["_pos","_centerPos"];
	
	_centerPos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
	_pos = [getMarkerPos "center",4000,20000,10,0,25,0] call BIS_fnc_findSafePos;
	DMS_Cords = _pos;
	diag_log format ["DMS: Pos found at: [%1] - markers spawning!",_pos];
	// wait with script till pos is found
	waitUntil {_pos};
	DMS_Main = createMarker ["DMS_Main", DMS_Cords];
	DMS_Main setMarkerColor "ColorRed";
	DMS_Main setMarkerShape "ELLIPSE";
	DMS_Main setMarkerBrush "Grid";
	DMS_Main setMarkerSize [150,150];
	diag_log format ["DMS: Mission starting at %1",_pos];
	sleep 4;
	
	publicVariable "DMS_Cords";
	_aispawn = [DMS_Cords,80,6,6,1] execVM "Scrip\path\to\file.sqf";//AI Guards
	

Here is my marker script, it also finds a random spot. If you're interested in how works. I will change this a lot since it's not optimized and it does not have any timers.

 

I might share the rest of my (4) files if I feel like it. Who knows when that is.

 

It would be nice if you helped to make missions for people. I wish you success in creating a mission. You will succeed.

Link to comment
Share on other sites

/* 

Finds random spot in radius of center map, bla bla bla marker 
@FileOverlordCreatorofAllMasterCommanderAlphandtheOmega: Defent

*/
	private ["_pos","_centerPos"];
	
	_centerPos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
	_pos = [getMarkerPos "center",4000,20000,10,0,25,0] call BIS_fnc_findSafePos;
	DMS_Cords = _pos;
	diag_log format ["DMS: Pos found at: [%1] - markers spawning!",_pos];
	// wait with script till pos is found
	waitUntil {_pos};
	DMS_Main = createMarker ["DMS_Main", DMS_Cords];
	DMS_Main setMarkerColor "ColorRed";
	DMS_Main setMarkerShape "ELLIPSE";
	DMS_Main setMarkerBrush "Grid";
	DMS_Main setMarkerSize [150,150];
	diag_log format ["DMS: Mission starting at %1",_pos];
	sleep 4;
	
	publicVariable "DMS_Cords";
	_aispawn = [DMS_Cords,80,6,6,1] execVM "Scrip\path\to\file.sqf";//AI Guards
	

Here is my marker script, it also finds a random spot. If you're interested in how works. I will change this a lot since it's not optimized and it does not have any timers.

 

I might share the rest of my (4) files if I feel like it. Who knows when that is.

 

 

 

 

if(!isServer) exitWith {};

markerready = true;

missionrunning = false;

_startTime = floor(time);

_result = 0;

while {true} do

{

    _cnt = {alive _x} count playableUnits;

    _currTime = floor(time);

    if((_currTime - _startTime >= DMS_mission_timer) AND (!missionrunning)) then {_result = 1};

    

    if(missionrunning) then

    {

        _startTime = floor(time);

    };

    

    if((_result == 1) AND (_cnt >= 1) AND (markerready))  then

    {

        clean_running_mission = False;

        _mission = DMS_missions call BIS_fnc_selectRandom;

        execVM format ["Script\path\to\missions\%1.sqf",_mission];

        missionrunning = true;

        diag_log format["DMS: Starting Mission %1",_mission];

        _startTime = floor(time);

        _result = 0;

    } else {

        sleep 60;

    };    

};

 

something like this ? starttime in config ofc right?

Link to comment
Share on other sites

Great input guys, but I think all of this code is already out there for Arma2.  Game logic code is all the same.  The hurdles we are having are specific to the EPOCH mod.

 

If anyone has figured out the AI cleanup, and/or the player god mod issue please let me know.

Link to comment
Share on other sites

I really don't know if there is a way to spawn ai without being able to edit the server files. I have tried tons of different ways and nothing works. Work around for vehicles and crates and all that good stuff but any attempt to work around the clean up for the ai just will not work. I see that a few people say that they have figured it out and if they did, great for them, but until I actually see some working script or something to show that they have actually figured it out I really don't think its possible and im going to but this on stop for now until we can edit the files more freely.

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...