Search the Community
Showing results for tags 'ai behaviour'.
Found 3 results
pierremgi posted a topic in ARMA 3 - MISSION EDITING & SCRIPTINGHello all, Here is a little script enabling AIs for rearming when out of ammo. If I'm right, the vanilla behavior is: - AI leaders sometimes order their AI subordinates for rearming at crates (probably only simple crates/vehicles with accurate magazines). Anyway they don't succeed in that (or barely). What I experienced is AIs running after vehicles, AIs stuck, AIs disobeying... If you have better experience on that, please share. - as playing leader of AIs, you can order your units to rearm at... known abandoned weapons, crates,... no matter if you don't know where they are and how far. The list can be looooong (as a day without bread) , and the, totally useless. you can see you AI crossing the map without few chance for actually rearming. Well, I'm trying here another approach, in this way: - first of all, I limit the script to AIs with played leader. (Just avoiding too many codes on server, but feel free to test what ever units you want); - only AI units owning a primary weapon are concerned: No player, no tourist; - When the AI has less than 10 remaining shots in its primary weapon, if magazines or weapons can be picked, within 100 m of the unit (anytime), the AI will move and pick them up. The possibilities and priorities are: - Any object stated as Arsenal (virtual crates/ vehicles with arsenal code...), is scouted as priority 1. That means the AI will reload at this object, with compatible mags, no matter the content of the arsenal crate/vehicle. At this time, and possibly for ever, I don't make any filter about possible limitation on arsenal. That means any enemy (concerned AI) can rearm at any arsenal. - The priority 2 is crates/vehicles fitted with compatible mags. The rearm action on a crate can empty it. This action is the standard behavior of Arma's engine. If you want more, see module! Anyway, the mags can be inside uniforms, vests, backpacks inside the crate or the vehicle. Not so bad. - the priority 3 is friendly fallen corpses... There is neither arsenal, nor crate but some fellows are lying on ground with compatible mags. That's the last chance for AI to keep their actual primary weapon; - the last priority (4) is any weapon found on ground, inside crate or vehicle. This weapon is different from the original. If several choices, the AI will pick one at random... At this time, I don' have filter for all possible cases and skills of AIs... It's just out of my scope. anyway this weapon can be inside a backpack, inside a crate... I added a mandatory mag for this weapon as I don't want the AIs out of ammo, then picking a weapon, out of ammo then... in a boring cycle. Furthermore, at this time, the abandoned weapon is deleted. Note 1: Vehicles are considered as crates if engine off! Note 2: You can stop an AI (stop order), so he will not continue his search for mags or weapons (but he will not fight without ammo). Of course, as I'm scripting also for my mod: MGI Advanced Modules, I added a Rearm Module enabling more possibilities: - You can easily choose different units (to be upgraded perhaps); - When your AI rearms, the secondary weapon (if any) is refilled in tube (so 1 shot). The AI receives up to 3 first aid kit and hand grenades or smokes. The AI grabs also up to 6 grenades for GL if any. - the rearm and switchweapon vanilla actions are replaced by animations (same ones) and custom scripts avoiding vanilla inventory (too many mags, no grenades, poor fak) Known limitations: - the hand guns are not treated at all; - the GL and launchers are treated in module, but only in case of low primary weapon ammo which stays the triggering factor; Compatible for MP (the treated units are local on each PC/Server), compatible with mods. Depending on mods, you can experience some little difference: - compatibles mags means... compatible mags and some vanilla mags can be used instead of specific ones, for arsenal. I'm not responsible of these choices. - on the other hand, there are several "FirstAidKit" along with mods. Some of them keep the class name and modify the aspect, some of them modify the whole stuff (for nuts,imho). Your AI can receive firstAidKit instead of "blabla_holyKitofTheGreatesModEverWritten" . They will not make difference, and you'll see that if you pick items on dead AI fellow. Have fun! Version: 28 / 07/ 21 in init.sqf
Hi, I thought i'd try asking this question over in this part of the forums as i've had no luck elsewhere. I'm trying to work out how to get AI units to stay where i have placed them in the Eden Editor? At the moment, every time i launch my scenario, the AI units move from their positions, presumably to try and stay in formation? Is there anyway to disable this behaviour, or command the units to stay at the locations i have placed them? Where they are moving around freely at the moment is making it very difficult to set up my scenario in a way that i am happy with... Any help would be immensely appreciated! Regards.
Hi, First question here, i'm trying to work out how to get AI units to stay where i have placed them in the Eden Editor? At the moment, every time i launch my scenario, the AI units move from their positions, presumably to try and stay in formation? Is there anyway to disable this behaviour, or command the units to stay at the locations i have placed them? Where they are moving around freely at the moment is making it very difficult to set up my scenario in a way that i am happy with... Any help would be immensely appreciated! Regards.