I'm trying to edit scenarios where the AI defends from the relative safety of a sandbag bunker and the first attempts have been frustrating.
After some Googling I found some old threads in several discussion forums. All good information, most of it beyond my grasp. So, I'm settling for a relatively simple way to get the enemy AI within the bunkers and them to stay there.
First off, a clarification. I'm no expert ArmA 2 mission editing. The editing tools for ArmA 2's engine are very powerful. From the most humble trigger, passing through elaborate scripts that use a specific programming syntax, all the way to full blown script modules that you plug into the mission to get new and exciting AI behaviors not present in the out of the box version of the game. ArmA 2's editor is a dream and I can only wish to have more time some day to just scratch the surface. So for those readers out there who are capable of displaying the latest news, the real time value of their portfolio or the local weather in a billboard of a Takistani town, this post will be rubbish.
Here is what I want to do. I have placed a 4 men Takistani infantry section in two bunkers that overlook an abandoned gas station. Each Takistani infantryman is set to "Special=None" (this means no formation of any sort). A US infantry man will run across the gas station, from cover to cover. I want the Takistanis to fire from their bunkers. The scenario is a test, don't make too much out of it
First try: fire, movement and failure
|The setup. The Takistani men (red circles) are overlooking the gas station. Note the blue circle: that's the US infantryman. He will move northwest to the next covered position.|
|A close up of the Takistani's start position. Those orange things are bunkers.|
|As soon as the scenario starts, the Takistanis move out of their bunkers. The quickly adopt a default "vee" formation. Even when the special field of each soldier is set to "none" (as opposed to "in formation"). Fails.|
|But wait, there is more! Right after seeing the American, the Takistanis move two hombres ahead to hunt him down. It's like the bunkers were built just for shade. Fails.|
Second try: the Takistanis stay ... blind!
|In the next setup I removed those pale blue lines that establish the command structure (compare with previous setup close up image).|
|And yes, the Takistanis stay in the bunkers at the start of the mission. Success?|
|The sight of the American spooks the Takistanis and they hit the dirt to never rise again. Can't shoot what you can't see. Fail.|
|The Takistanis sudden love for mother earth prompts the American soldier for some good old fish-in-a-barrel shooting. Fail.|
Third try: fire without movement
|That line of code made the Takistanis to start, stay and fire at/from the bunkers. Success.|
|Well, you can always find a way around the system. In this screenshot, I sneaked through dead ground. Very quietly. The AI noticed me only after I blew out this guy's head.|
In conclusion, I'm going to be using what I learnt to set up the enemy AI within bunkers. There are several other possible ways to do it. Some work great, others not so. For example, some people use the following piece of code in the initialization field of the AI units: this disableAI "move". This piece of code freezes ANY type of movement, including rotating towards a threat, but it can be useful in some limited situations. Other very popular piece of code in the initialization field is doStop this. So far I didn't see any difference between this last piece of code and just removing the blue lines of command. But I may be wrong. Ideas for further exploration, that's for sure.