Jump to content
Sign in to follow this  
McArcher

AI units taking weapons and magazines from corpses and crates

Recommended Posts

At my mission's start all playable units don't have any weapons and magazines with them (they must take them from crates or from dead bodies). I want to make a mission more realistic and don't want to create weapons "from air". Can I somehow tell AI units to search the boxes and dead bodies and take weapons from there?

I know, we don't have functions to get the cargo of vehicles in Arma2, so I don't know how to make a script that will take 1 weapon from crate (I know only how to giva a weapon to unit).

This idea came to me when I saw injured units going to Field Hospital as soon as I have built it near them. I thought that they will also search objects for food....sorry, for weapons ? :D

Please help me, how can I implement such feature. Thank you.

Share this post


Link to post
Share on other sites

Check out the mods listed below - they both add the capability to take weapons/ammo from bodies (I don't think they work with crates) but at least it's half of what you want!

VFAI - very focused mod that will add some of the features you want.

GL4 - Does a lot more than what you need, but you can also disable items you don't want.

Share this post


Link to post
Share on other sites
What you need is:

- TakeWeapon/TakeMagazine

for corpses you could his weapons and his magazines (weapons unit and magazines unit) and then use takeweapon/takemagazine. :)

For crates it is the only way, I think.

But for corpses, I like already written addons (economizes much time :D )

Share this post


Link to post
Share on other sites

VFAI has still some flaws, I'm using it too. I contacted Victor and he told me as soon as he got some time he would improve the script. I'm using VFAI in my campaign still WIP. There are still config errors showing up which is a spoiler.

regards

nettrucker

Share this post


Link to post
Share on other sites

Ok, thanks, I will be checking for updates.

---------- Post added at 20:00 ---------- Previous post was at 19:45 ----------

If only we had functions to get cargo of vehicles... oh, BIS, BIS...

Share this post


Link to post
Share on other sites

hm... with VFAI, my AI units have default weapons at start of the game (without VFAI, they had none, I cleared them with a script).

Don't understand why...

---------- Post added at 03:53 ---------- Previous post was at 03:46 ----------

and also a lot of

Error: sample vops_s_environmental\light_sea.wss with unsupported sample frequency: 48000

appear :)

Share this post


Link to post
Share on other sites

Not clear on the default weapons issue, but that error looks like it comes from VOPsound.

Share this post


Link to post
Share on other sites
Not clear on the default weapons issue, but that error looks like it comes from VOPsound.

I second that. The error comes from VOP sound, clearly to see in the beginning of the error messagge.

regards

Share this post


Link to post
Share on other sites
Not clear on the default weapons issue, but that error looks like it comes from VOPsound.

I run a script at the start of the game. This script removes weapons from AI players and players. But using VFAI, AIs have weapons at game start. That's what I meant. VFAI somehow overrides it and gives them weapons? How to disable this? Haven't found such code in VFAI's script.

---------- Post added at 16:23 ---------- Previous post was at 16:21 ----------

P.S. And also weapons are must be removed by that script with a eventhandler (after a respawn) and also for JIP, but with VFAI this doesn't work.

Share this post


Link to post
Share on other sites

Ah... you should probably talk to the mod author about that. He's probably tieing into the init events himself and you'd probably need to wait until he's done his thing before running your script to undo it. Even then it may break the mod.

Since you seem to have such a specific need in mind, you can always dePBO the mod and have a look at how he does the scrounge for weapons and ammo and build your own script using just the parts you need or even block the section where he adds weapons and recompile the pbo.

Share this post


Link to post
Share on other sites

hm... that's very strange, but now AIs work as they should when I removed 1 feature from my misson. (When I groupped all playable units at each side (east and west) to 1 group game became crazy)

---------- Post added at 20:22 ---------- Previous post was at 20:21 ----------

how can I make my mission require this addon/mod? how can i prevent running it without this addon? I mean VFAI.

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  

×