Sign in to follow this  
[AI] Stalker

dms HOW DO I MANUALLY SET AI SPAWN LOCATIONS?

18 posts in this topic

So I looked into fn_SpawnAIGroup_MultiPos (used in static mission) and fn_SpawnAIGroup (used in random bandit missions) which both end up calling fn_SpawnAISoldier in the end.

This is what I think is happening...

fn_SpawnAIGroup (used in random bandit missions) takes _pos as an argument. But _pos is the randomly chosen mission center best I can tell. It loops through ai count number of times and because all of the ai are showing their position as _pos it randomly places them around that point.

Consequently, fn_SpawnAIGroup_MultiPos has no way to handle relative positioning. In this function each individual position is passed to the ai creation function. As seen in static missions, it will take pure positions on the map.

Also, you are passing FIVE center positions, _pos, values at the end ( _AISoldierSpawnLocations+[_pos,_pos,_pos,_pos,_pos], ) where the comment I found says to just pass three (_AISoldierSpawnLocations+[_pos,_pos,_pos],            // Pass the regular spawn locations as well as the center pos 3x). FYI, this is only for static missions, although, in walking down the above functions I found no practical use for these three (or five in your case) extra passes of _pos for anything other than spawning a few extra ai, or for somehow handling if your ai count (in static missions) is greater than you specified ai count. In this case it would randomly spawn the remaining ai randomly around the center of the mission.

Hope all of this makes sense and maybe helps some.

Share this post


Link to post
Share on other sites

I used this kind of thing in a couple of bandit missions just using:

 

Quote

_group =
[
[[(_pos select 0)+3,(_pos select 1)-3,0],[(_pos select 0)+(10+(random 20)),(_pos select 1)+(10+(random 20)),0]], // Position AI in tent + 2nd squad
_AICount, // Number of AI
_difficulty, // "random","hardcore","difficult","moderate", or "easy"
"sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher]
_side // "bandit","hero", etc.
] call DMS_fnc_SpawnAIGroup_MultiPos;

if it helps

Share this post


Link to post
Share on other sites
Advertisement
13 hours ago, red_ned said:

I used this kind of thing in a couple of bandit missions just using:

 

if it helps

Works for 2 positions off center pos only.

Any more and it does not seem to work.

Any ideas?

Share this post


Link to post
Share on other sites
14 hours ago, lords8n said:

Consequently, fn_SpawnAIGroup_MultiPos has no way to handle relative positioning. In this function each individual position is passed to the ai creation function. As seen in static missions, it will take pure positions on the map.

Not true. 

See above with Red's post. Specifically i use relative position here

Spoiler

_group =
[
    [[(_pos select 0)+4,(_pos select 1)+12,0],[(_pos select 0)-10,(_pos select 1)-5,0]],                  
    _AICount,                // Number of AI
    _difficulty,            // "random","hardcore","difficult","moderate", or "easy"
    "AINC_assault",                 // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher]
    _side                     // "bandit","hero", etc.
] call DMS_fnc_SpawnAIGroup_MultiPos;


And this works.

Share this post


Link to post
Share on other sites
14 hours ago, lords8n said:

Also, you are passing FIVE center positions, _pos, values at the end ( _AISoldierSpawnLocations+[_pos,_pos,_pos,_pos,_pos], ) where the comment I found says to just pass three (_AISoldierSpawnLocations+[_pos,_pos,_pos],

That comment is simply explaining that EACH _Pos reference in that line will result in 1 AI being spawned at that position. That is all it means. You can do it with 1. Or you can do it with 100. Makes no difference.

Share this post


Link to post
Share on other sites

you tried: call DMS_fnc_SpawnAIGroup_MultiPos;

it worked with relative positions for me but you could try adding up spawns with _group1 _group2 etc, just remember to add private variables and also in the trigger win/clean up/AI count section

 

Share this post


Link to post
Share on other sites
Advertisement

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.