Jump to content
Sign in to follow this  
alexluthor

AI not using weapons

Recommended Posts

Hello guys, I’m wondering if you could help me with a certain mission.

The concept revolves around the evacuation of American civilians from a city soon to be overtaken by the enemy. Only American civilians are to be rescued and this causes the civilians left behind to revolt.

I want to simulate this revolt by having two or three citizens draw weapons on the players, who portray the American soldiers. For this to work I have to tackle two problems:

A. Turning a couple civilians to the enemy side

B. Making them draw concealed weapons

Problem A was taken care by making the civilians join an enemy unit with a soldier with a higher ranking then the civilians. This turns the group into enemy soldiers.

I tried to solve problem B by creating a trigger which had an addweapon command in its activation field. I wanted to simulate the fact that the civilians had a pistol concealed and adding the trigger while in mission simulated this effect.

The problem, though, is that the civilian do not shoot the players, he stands his ground and just watches me. He only picks his pistol if I wound him first.

If I give the civilian a rifle, he waits a couple seconds and eventually seems to shoot my player. But I think it would be a hard pill to swallow for the guy to hide an assault rifle within his jacket.

If I add the code in the initialization field of the unit, the unit keeps the pistol in his hand, thus, spoiling the surprise effect, but at least it shoots his pistol.

I have no idea how to solve it, can anyone help please.

Thanks in advance,

Alex

Share this post


Link to post
Share on other sites

This works for me placed in a trigger, what spoils it though is the stupid civs keep going prone.

Also put the skill slider to max.

MAN addMagazine "7Rnd_45ACP_1911";MAN addWeapon "Colt1911"; MAN selectWeapon "Colt1911"  ;

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Hey man, thanks a lot. It worked. I think that maximizing the skill slider is what did the trick. thanks again.

Share this post


Link to post
Share on other sites

_group = createGroup east;
[_civilianname] joinsilent _group;

If you put that in a trigger, along with the addweapon command, as soon as blufor enters the trigger, civilians will pick up arms and engage blufor. Blufor will recognize as enemy civilians and engage back. And there is no need to link them to any OPFOR units. I've tried to accomplish this a few different ways, and I found that this is the best way. Other ways I tried, it was hit or miss, how, or when, or even IF a armed civilian would open up on blufor troops, and someways made blufor recognize civilians as enemy even if they were unarmed. Doing it this way the AI responsiveness to each other is top notch. Just as if those civs were actually opfor units, but only if they have a gun in hand.

Also here is a good addweapon script, which makes it easier to add weapons and supplies (like binocs and such) to units without having to find classnames for weapons and ammo types.

this comes right out of an on act: box of a blufor present trigger I have synched too a group of 3 civilians using the above addweapon script:

[civ6,["AA12_PMC",3,2],["RPG7V",3,3],["Makarov",4],"Binocular"] exec "cly_addweapon.sqs"; [civ7,["M4A1",2]] exec "cly_addweapon.sqs"; [civ8,["M4A1",2]] exec "cly_addweapon.sqs";t1=createGroup east; [civ6] joinsilent t1; [civ7] joinsilent t1; [civ8] joinsilent t1;

Edited by Rail82

Share this post


Link to post
Share on other sites

Thanks Rail82, not having to link the unit to another AI unit is actually much better : ) In order for it to work tough, I had to use createCenter first.

Here's the code I'm using in the activation field of a trigger. The civilian character is a rocker, hence the name.

HQ = createCenter East; HQ1 = createGroup East; [bon_Jovi] joinsilent HQ1; Bon_Jovi addMagazine "7Rnd_45ACP_1911"; Bon_Jovi addWeapon "Colt1911"; Bon_Jovi selectWeapon "Colt1911";

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

×