Jump to content
Sign in to follow this  
bangabob

Enemies follow players?

Recommended Posts

Hello everybody.

I have experience using DAC and other AI spawning scripts.

Context

Making a mission involving players travelling anywhere on the map.

These players should have enemy AI near them at all times.

Problem

1.Placing enemies all over the map can cause map lag.

2.Placing DAC spawn triggers on every part of the map will take forever

I know about the DAC option to make the DAC area follow a player. However, AI units might lag behind the players.

Any help is appreciated

Share this post


Link to post
Share on other sites
Making a mission involving players travelling anywhere on the map.

These players should have enemy AI near them at all times.

Lag. You should rethink your mission concept, since it's flawed.

Use DAC on Utes or something if you want highly concentrated zombies (you're doing a zombie mission aren't you?) but not on one of the larger maps.

Share this post


Link to post
Share on other sites

No. No Zombies here. Its gotta be possible by using the activate and deactivate DAC zone thing though

Share this post


Link to post
Share on other sites

Using DAC you can populate a map fully. I went up to around 650 units plus Civies on Lingor. Was SP though, and very few other scripts running.

Edit: I'm not saying you should do that. Was more of a stress test. But you can get to a pretty much totally populated map by caching units, as long as you don't have players wandering on their own all over the map.

Share this post


Link to post
Share on other sites
Zargmount features AI constantly closing in on players, but it's some pretty complicated stuff and hard coded to the map in some ways but the basic concept should be the same. It's also surprisingly low stress on the server. 100-200 guys and no lag (well, making sure you're not using the currently broken beta).

Share this post


Link to post
Share on other sites

Yup, Zargmout has a pretty nice script to spawn patrols.

It also has one big drawback though: enemy groups will respawn in compounds you've just cleared less than a minute ago. Which kinda makes you want to throw your beer through your monitor at times.

Share this post


Link to post
Share on other sites

Okay. I will check the Zargmout mission out. Any tips on extracting to for use with another map ect?

Share this post


Link to post
Share on other sites
Okay. I will check the Zargmout mission out. Any tips on extracting to for use with another map ect?

dePBO it, put it in your My Doc Mission folder, load it up In-game, see how he did things. To try on different map, just Merge it.

Share this post


Link to post
Share on other sites

In Zargmout, you might want to look at rejpatrol.sqf for the spawning. Pretty nice but maybe not the part that really interests you.

To have them come at you, he actually use a pretty simple trick: he reveals each playable unit to each enemy group at all times. See the eaware.sqf.

Share this post


Link to post
Share on other sites

A simple "hunter" script is no problem. I made a dynamic hunter script months ago, where a group of foes were constantly movingto my position. Here' s a similar script I made, as I can't find the old hunter script.Maybe you could take somethings out of that to work with. I'll see if I can't find the other one.

///////////////////////////////////
//                               //
//                               //
//        PARASQUAD ROE          //
//                               //
//                               //
///////////////////////////////////

/*
File: PDroe.sqf

Author: ***1cem@n***

Description:
        sets the ROE of the parasquad based on distance from the enemy player leader (S1)


Parameters:
 none

       Called from:
        paraDrop.sqf - _transgroup waypoint2 (wp2)
                                       ^   ^   ^
                                 null = [] spawn PDroe;


*/

if (isServer) then {

if (leader parasquad distance support_veh < 25) then {

   Parasquad setBehaviour "aware";
   Parasquad setCombatMode "yellow";
   Parasquad setSpeedMode "Full";
   Parasquad setFormation "wedge";
   //hint"initializing parasquad roe...";
              };

if (alive leader parasquad) then {

  while {leader parasquad distance leader xray > 10} do {

                  {_x doMove getPos leader xray} foreach units ParaSquad;

                  sleep 2;

                  {_x reveal Player} foreach list trig2;

                            sleep 2;

        if (leader parasquad distance leader xray < 125 && leader xray distance leader parasquad > 100) then {

                            leader parasquad doTarget leader xray;
                            leader parasquad fire ["SmokeShellMuzzle", "SmokeShellMuzzle", "SmokeShell"];

                                                                               };
                                         sleep 1;  

                         if (leader parasquad distance leader xray < 100 && leader xray distance leader parasquad > 85) then {

                                                leader parasquad doTarget s1;
                                                leader parasquad fire ["HandGrenadeMuzzle", "HandGrenadeMuzzle", "HandGrenade_east"];

                                                                                             };
                                                                 sleep 1;

                                               if (leader parasquad distance leader xray < 100) then {

                                                            Parasquad setBehaviour "combat";
                                                            Parasquad setCombatMode "RED";
                                                            Parasquad setSpeedMode "full";
                                                            Parasquad setFormation "wedge";
                                                            //hint"combat roe";

                                                                          } 
                                                                          else
                                                                          {

                                                            Parasquad setBehaviour "aware";
                                                            Parasquad setCombatMode "yellow";
                                                            Parasquad setSpeedMode "normal";
                                                            Parasquad setFormation "wedge";
                                                            //hint"aware roe";               

                                                      };

                                                sleep 2;      

                };


 } 
  else
 {
  exitWith
 };

                 waitUntil {leader parasquad distance leader xray > 25};
                 null = [] spawn PDRoe

} 
else
{exitWith};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×