Jump to content
thirith

How to automatically generate enemies in a specified area

Recommended Posts

For the mission I'm currently working on, I'd like to create areas where you might bump into enemies without placing the enemy units by hand. Is there a module that allows for this, ideally with a number of parameters (e.g. enemy types, group size, likelihood of enemies spawning when players are in the area)? Alternatively, is there a script or similar that does this sort of thing well?

Share this post


Link to post
Share on other sites

I am enjoying Engima's Patrolled Areas:  http://typesqf.no-ip.org/cpack/details/Engima.PatrolledAreas

 

It is only available through the TypeSQF editor, but it's easy to do.

 

Install TypeSQF:  http://typesqf.no-ip.org/

In the TypeSqf editor, open the CPack Console and type in the following:

Install Engima.PatrolledAreas

You can also install his excellent Civilians and Traffic scripts the same way:

Install Engima.Civilians
Install Engima.Traffic

 

  • Like 3

Share this post


Link to post
Share on other sites

Oh, and both Patrolled Areas and Traffic can run in multiple instances, so you can set up different configurations for different areas, as well as for different factions. The only problem I have had is with AI drivers going out of their way to run over pedestrians/foot patrols.

Share this post


Link to post
Share on other sites

Not much can be done about AI drivers mowing down pedestrians, that's an Arma thing. Bohemia forgot to issue the AI drivers licenses.

  • Like 1
  • Haha 2

Share this post


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

Bohemia forgot to issue the AI drivers licenses.

:yeahthat:.....lol!

  • Like 1
  • Haha 2

Share this post


Link to post
Share on other sites
20 hours ago, AZCoder said:

Not much can be done about AI drivers mowing down pedestrians, that's an Arma thing. Bohemia forgot to issue the AI drivers licenses.

I don't know how many hours I lost trying to get AI to just drive through an intersection in A2. Not a unique story either, I'm sure!

  • Like 2

Share this post


Link to post
Share on other sites
21 hours ago, AZCoder said:

Not much can be done about AI drivers mowing down pedestrians, that's an Arma thing. Bohemia forgot to issue the AI drivers licenses.

 

You can give the "bystanders" an event handler that disables the damage from certain vehicles. They still get run over, it's just that they won't die or take any damage from them. (May need some rewriting to fit specific needs, right now it's just for drivers from the same side.)

 

	_unit addEventHandler ["HandleDamage", {
		_unit = _this select 0;
		_driver = _this select 3;
		if (vehicle _driver != _driver AND side _driver == side _unit) then {
			0
		} else {
			_this select 2
		}
	}];

 

  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, Fiddi said:

 

You can give the "bystanders" an event handler that disables the damage from certain vehicles. They still get run over, it's just that they won't die or take any damage from them. (May need some rewriting to fit specific needs, right now it's just for drivers from the same side.)

 


	_unit addEventHandler ["HandleDamage", {
		_unit = _this select 0;
		_driver = _this select 3;
		if (vehicle _driver != _driver AND side _driver == side _unit) then {
			0
		} else {
			_this select 2
		}
	}];

 

 

You forgot


_driver setDamage 1;

Gotta set an example for the other drivers that there are consequences!

 

  • Like 2
  • Haha 1

Share this post


Link to post
Share on other sites

Another option. Create some enemies and place them at an out of the way place. Create a trigger. When the trigger fires, have the trigger transport some or all of the soldiers into the trigger area.

 

And arrange it so that they appear at random locations within that trigger area.

.

 

Share this post


Link to post
Share on other sites

@Harzach  does this make the Mission have  dependencies like mods? Does the editor have any vechicle patrols can you access it from the Eden editor ? Is this new I never seem this before.

Share this post


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

@Harzach  does this make the Mission have  dependencies like mods? Does the editor have any vechicle patrols can you access it from the Eden editor ? Is this new I never seem this before.

 

It's an interesting alternative to EOS/ALIVE/DAC/etc. but no - it's just a script system. You can get the Civilian and Traffic scripts from Armaholic, but Patrolled Areas is only available through TypeSQF. I don't know why, but that's the choice Engima has made and I respect it. TypeSQF is essentially a text editor like Notepad++ only with native SQF support, project management, and more. It's very lightweight (<700KB) and definitely worth a look, even if you end up using it only to grab Patrolled Areas.

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

×