AI Rifleman all spawn with the same gun.

Chalk1990

Member
All my rifleman AI spawn with the same weapon if one spawns with a bizon, all spawn with bizons. How do I make it so they all spawn with different guns that I listed in the config file?

I want them to have a variety.

EDIT: All the Snipers spawn with the same weapon as well. I spotted 2 snipers within the same group, and both had DMRs that I enabled in the config file.

Also, can we have a way of setting the percentage chance of the AI using that specific weapon?

For example, I have g36k in my config for squad leaders, I want them to have a 5% chance of spawning with that weapon, so when a player kills them, they'll be rewarded with a rare weapon. IE, I don't want everyone running around Bizons, and G36k's because the AI's random chance selects those 2 guns instead of the others I listed. We need specifics.
 
Confirmed as a bug. Just fixed it.

If you want a low percentage for a specific weapon, you can define your weapons array like this:

Code:
SAR_band_sniper_weapon_list = ["M4A1_Aim","M4A1_Aim","M4A1_Aim","SVD_CAMO","Huntingrifle","Huntingrifle","Huntingrifle","Huntingrifle","Huntingrifle","Huntingrifle"];

This will have a 10% chance to get the SVD, a 30% chance to get the M4A1.

Keep in mind this will only have effect after i released my update that will include these fixes.

Sarge
 
Hey Sarge :)

Any way to define different weapons for a static group?

I'm putting a little camp with lootable goods on the map, and I want it defended by AI with RPG's - So I thought maybe static would be best for this, with some RPG's. Any way to sort this? (I don't want the dynamic guys to have RPG's though...).

Cheers :D

Confirmed as a bug. Just fixed it.

If you want a low percentage for a specific weapon, you can define your weapons array like this:

Code:
SAR_band_sniper_weapon_list = ["M4A1_Aim","M4A1_Aim","M4A1_Aim","SVD_CAMO","Huntingrifle","Huntingrifle","Huntingrifle","Huntingrifle","Huntingrifle","Huntingrifle"];

This will have a 10% chance to get the SVD, a 30% chance to get the M4A1.

Keep in mind this will only have effect after i released my update that will include these fixes.

Sarge
 
not without me doing major adjustments to my code ...

what you can TRY is to put a vehicle with rpgs next to your static AIs, and see if they get those (they might, i saw them looting cars for grenades).

Sarge
 
Cool :)

As a worse case scenario, if I add 2 or 3 AI units in the editor (used to do that before I found your great script!) to compliment the Sarge AI, will they be on the same 'side'? (Eg. If I set some 'East' AI in the editor), will they be okay with the Sarge AI bandits, or will they battle do you think? :D
 
I'd rather just wait for a code update, I don't want to spam my file with the same weapon ID just to increase/decrease the odds of the weapon being used. Couldn't you add a percentage code? like "M4A1_Aim, 25" or similar, 25 being 25% chance of being used.
 
Well, code update will not include that functionality, simply beacuse it will not work.

Either you have a random weapon out of a list of weapons, or theres a completely different logic for weapons.

The point is, Ai are getting only 1 weapon.

so a construct like

["weap1",25],["weap2",75],["weap3",5],["weap4",90]

should do what ? the random chance number will be sth between 0 and 100. everything above 90 = weap 4 ?

everything below 25 = weap 1 ? that one will fail ...

The only way i can think of doing that is setting up a weapons array with the classnames multiplied in there.

With my above suggestion to just copy classnames in your config this can be achieved without a major effort, so that^ll stay like that until i have a creative idea how this could be solved.

Sarge
 
Cool :)

As a worse case scenario, if I add 2 or 3 AI units in the editor (used to do that before I found your great script!) to compliment the Sarge AI, will they be on the same 'side'? (Eg. If I set some 'East' AI in the editor), will they be okay with the Sarge AI bandits, or will they battle do you think? :D

if you set AI in the editor to side east, they "should" be ok with my AI bandits, just give it a try ... cant think of anything that should make em hostile. SARGE AI bandits dont fight other SARGE AI bandits, and if you put them manually, you should be ok as well.
 
So your basically saying there is no way to fix AI using the same weapon. I have a group of 6 soldiers, and all the rifleman in that group spawn with m1014s for example, that's rather dumb. There needs to be a way to make it so if there is more than 1 rifleman/sniper in a group they use different guns than the other ones. Variety is important.
 
Reread my post. I confirmed that the AI classes using the same gun was a bug and was fixed ...
 
Back
Top