WAI - Giving AI AT/AA Weapons

Rick167

Member
Hey folks,

I'm trying to give an AI group that spawns in missions AT/AA weapons. Unfortunately, they always spawn with absolutely nothing.

Here are the various lines I used in the mission's SQF files:

[[_position select 0,_position select 1,0],1,"Random","at",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","aa",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","RPG7V",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","Strela",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","ai_wep_launchers_AT",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","ai_wep_launchers_AA",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","5",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group; // I made a custom AI gear # 5 in the config.

[[_position select 0,_position select 1,0],1,"Random","ai_gear5",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group; // I made a custom AI gear # 5 in the config.

None of those lines worked. Every time the mission AI spawned, that particular group ran around unarmed.

Perhaps I have to give them a primary weapon plus the launcher? How would I script that? Any ideas would be appreciated.

Thanks!
 
First, you should always paste code in the code box that way it is easier to read
Code:
[[_position select 0,_position select 1,0],1,"Random","at",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","aa",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","RPG7V",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","Strela",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","ai_wep_launchers_AT",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","ai_wep_launchers_AA",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

[[_position select 0,_position select 1,0],1,"Random","5",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group; // I made a custom AI gear # 5 in the config.

[[_position select 0,_position select 1,0],1,"Random","ai_gear5",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group; // I made a custom AI gear # 5 in the config

Second, In those arrays, if you look in the mission example you'll notice that when you assign AA or AT to a group of AI that it needs to be bracketed with the weapon selection.
Code:
[[_position select 0, _position select 1, 0],_num,"extreme",["random","at"],4,"random","bandit","random",["bandit",150],_mission] call spawn_group;

Also, have a look in your config and make sure that the
Code:
ai_wep_launchers_AT
ai_wep_launchers_AA
arrays are correct and have valid classnames.
 
So, I did the string two different ways. No joy.

[[_position select 0, _position select 1, 0],_num,"extreme",["random","at"],4,"random","bandit","random",["bandit",150],_mission] call spawn_group;

[[_position select 0, _position select 1, 0],_num,"extreme",at",4,"random","bandit","random",["bandit",150],_mission] call spawn_group;

My config contains:

ai_wep_launchers_AT = [["RPG7V","PG7V"]];
ai_wep_launchers_AA = [["Igla","Igla"]];

Sorry for not using the code feature- my OpenDayZ's forum theme doesn't let me read any of the text on the formatting bar.

Still no weapons. First string gave them regular guns and no AT, second string they ran around unarmed.

Any ideas? =\
 
if you want to put something in a code box simply type the word code in brackets [ ] in front of all of the text and then the word code in brackets again but with a slash in front of the word but inside the brackets [/]
I will show you using another word so it isn't formatted

[bode] Instead of using the word code I used bode so it doesn't format. [/bode]

Im sorry if I was unclear. That line I pasted was an example from the mission example that can be found within the WAI folder. You weren't supposed to just copy paste that line. It was only to demonstrate how that array should look. You should use the similar lines that are within the mission file to see exactly how that line should look just make sure those are properly bracketed.
Here is an example from one of my missions.
Code:
[[_position select 0,_position select 1,0],3,"Hard",["Random","AT"],4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;

Also, these arrays are for the weapon only, not the magazine.
Code:
ai_wep_launchers_AT
ai_wep_launchers_AA

The code will automatically pair the correct magazine with the gun. So if you only want them to use the RPG7v and the igla just make it look like
Code:
ai_wep_launchers_AT = [["RPG7V"]];
ai_wep_launchers_AA = [["Igla"]];
 
I should have known better. I've been away from this too long.

I replicated that line with the parameters you listed for the weapon and launcher. Still no joy. The guys who are supposed to carry AT only have regular small arms.

Code:
[[_position select 0,_position select 1,0],4,"hard",["Random","at"],4,"Random","Hero","Random","Hero",_mission] call spawn_group;

Updated config code to:

Code:
        ai_wep_launchers_AT            = [["RPG7V"]];
        ai_wep_launchers_AA            = [["Igla"]];
 
Can you paste one of the missions you're trying to get to work here?
Are you getting any RPT errors?
What version of WAI are you using? What game mod is your server running?
 
ill have to take a look when I have a bit more time.. have you heavily edited yours? Have you tried downloading a fresh copy of the latest WAI version and just trying to get an AA or AT unit on there?
I would do that and see if it works. If you do then you know there's something wrong with your files.
 
Back
Top