Jump to content
Sign in to follow this  
Junker

Ai civi's pick up weapons

Recommended Posts

im making a mp mission with UCE (Middle East units) addons and what i want to do is when they get shot a civi near by will pick up his weapon and start shooting at the players, is it possible to do and how confused.gif

Share this post


Link to post
Share on other sites

Well, if you group them to a unit belonging to a fighting side, like a soldier from West, East or Resistance, and then remove that soldier, they will be on that side. And that will make them fight. But I'm not sure if that's what you want?

Share this post


Link to post
Share on other sites

tried already they just lie there acting dumb sad.gif thnx anyway wink.gif

Share this post


Link to post
Share on other sites

Disclaimer- I've not tested this yet, but if the engine allows us to do scripting commands with dead things it should work..

Name the soldier that's gonna die (say, sol01) and the civvy (say, civ01). You need a trigger with "NOT (alive sol01)" in it's condition field. In the trigger's onactivation field put:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> [] exec "grabgun.sqs" <span id='postcolor'>

Now fire up notepad and type the following (or cut-and-paste):

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> civ01 domove sol01

@ unitready civ01

removeallweapons sol01

civ01 addmagazine ak47

civ01 addmagazine ak47

civ01 addmagazine ak47

civ01 addmagazine ak47

civ01 addweapon ak47

<span id='postcolor'>

Save the file as an "any" type, not as a ".txt" type and give it the name grabgun.sqs. Put it in the folder that was created when you saved your mission.

Now, if you've grouped him as was suggested by iNeo, when UCE boy pops his clogs, the civvy should run up to the corpse, the corpse's weapons will disappear and the civ will have a brand-new shiny AK. Change the weapon and ammo names to get whatever weapon the soldier was toting, and there you go. Remember that civs have only 4(?) ammo slots though.

Share this post


Link to post
Share on other sites

I think the easiest way is to put the civ's init.field

this addweapon "ak47";

this addmagazine "ak47";

this addmagazine "ak47";

this addmagazine "ak47";

Then group it with an eastern leader and put the leader's probablity of presence to 0%. Now the civ has a gun and mags and he will shoot and get shooted by west and and there isn't any eastern officer. I think that helps wink.gif .

Share this post


Link to post
Share on other sites

And... if you want your civ's to act like civ's (wandering aimlessly tounge.gif ) then you might need in civ init;

civ1 setCaptive True and when your soldier is killed...a trigger. In the condition; Not (Alive soldier1) and in the on activation; civ1 setCaptive False You could also add abunch of doMove, doTarget, doFire....throw it all in a script with addWeapon (like above) when your soldier dies.. hope this helps... smile.gif

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  

×