Sneakson 1 Posted July 2, 2013 Hey, is there an easy way to select a radius and have enemies randomly spawn in this radius? I thought the modules would work but then I tried spawning Opfor in Agia Marina only 3-4 guys spawn in the very middle even when the radius covers the entire area around Marina. Creating a clump of enemies with spawn radius also works like shit because all except one guy spawns in the default position anyways. Gonna keep experimenting. Share this post Link to post Share on other sites
twisted 128 Posted July 2, 2013 i found this the other day. http://forums.bistudio.com/showthread.php?94646-Random-spawn-positions-for-AI Share this post Link to post Share on other sites
BullyBoii 10 Posted July 2, 2013 put down a marker in the center of where you want the units to spawn _spawnCenter = getmarkerpos "markerName"; _radiusX = **put number here**; _radiusY = **put number here**; _randomX = random _radiusX; _randomY = random _radiusY; _randomPositionSelect = random 9; if (_randomPositionSelect >= 5) then {_randomX = _randomX; _randomY = _randomY}else {_randomX = _randomX - (2*_randomX); _randomY = _randomY- (2*_randomY);}; _spawnPos = [_spawnCenter select 0 + _randomX , _spawnCenter select 1 + _randomY, _spawnCenter select 2]; _group = [_spawnPos, EAST, "GROUPTYPE"] call bis_fnc_spawnGroup; Share this post Link to post Share on other sites
Sneakson 1 Posted July 2, 2013 put down a marker in the center of where you want the units to spawn _spawnCenter = getmarkerpos "markerName"; _radiusX = **put number here**; _radiusY = **put number here**; _randomX = random _radiusX; _randomY = random _radiusY; _randomPositionSelect = random 9; if (_randomPositionSelect >= 5) then {_randomX = _randomX; _randomY = _randomY}else {_randomX = _randomX - (2*_randomX); _randomY = _randomY- (2*_randomY);}; _spawnPos = [_spawnCenter select 0 + _randomX , _spawnCenter select 1 + _randomY, _spawnCenter select 2]; _group = [_spawnPos, EAST, "GROUPTYPE"] call bis_fnc_spawnGroup; And then? Share this post Link to post Share on other sites
BullyBoii 10 Posted July 2, 2013 And then? my fault, i should have explained more 1. Put down a n central marker and give it a name 2. Put down a trigger and give it a condition 3. Open notepad (or a text editor -- not Word) 3a. Copy the above code into notepad 3b. Replace the "markerName" with your marker name in "" 3c. Replace the **number here with a number. I recommend 100 (means the max ditance the unit can spawn from the marker is 100 units away) 3c. Replace the "GROUPTYPE" with the config entry for a group type 4. Save the file as **.sqf 5. In the mission editor place this in the trigger on act. field _nul = [] execVM "yourScriptName.sqf"; 6. Play the mission and watch the enemy spawn Share this post Link to post Share on other sites
froggyluv 2136 Posted July 2, 2013 Also an easy workaround is just to Group a unit with multiple markers -the game will randomly pick which location he spawns at. Share this post Link to post Share on other sites
bangabob 45 Posted July 2, 2013 Check out my eos script. Easy to use and does exactly what you are looking for and more if you want Share this post Link to post Share on other sites
holo89 10 Posted July 4, 2013 rarek is using this Bis fnc randomPos for his invade and annex mission look at this thread which talk about this bis function: http://forums.bistudio.com/showthread.php?154535-BIS_fnc_randomPos-water-out-and-water-quot-in-quot Share this post Link to post Share on other sites