db’s Twitter Digest for 2010-08-23 to 2010-08-29

How To Setup ArmA’s Built In Support System.

Using the Support Waypoint in ArmA.

Arma AI Refuel Truck

Player Refueling

ArmA has a built in support system which will allow players and AI to call for support from other AI. Now I’m not talking combat support here, I’m talking about support from a medic, or other support vehicle. (fuel, repair or ammo truck)

This basic support system can be implemented in the mission editor simply without any scripting.

A Support System Without Scripting

The best thing about the built-in ArmA support system is the setup. It’s dead simple with no scripting or configuration. Yet it’s quit powerful. The AI will automatically call for support, then the appropriate group will move to the AI’s location, provide the requested support and wait for further calls. All done in the mission editor with just a unit placement and waypoint.

Valid Support Units

For a group of units to be valid for a support request the group must contain one of the following: a medic, ambulance, fuel, ammo or repair vehicle. The group can contain other units but note that all units will dismount from vehicles when they arrive at the support location. The units will stay dismounted until another support call requires them to travel to meet a support request.

As an example I’m going to insert a fuel truck into a mission.

ArmA fuel truck editor

Inserting a refuel truck

The Support Waypoint

The support waypoint type is what causes the editor placed units to respond to support calls. Without this waypoint, HQ will just radio back “Negative” to any requests made.

Where you place the support waypoint depends on the design of the mission you are building. You can have additional waypoints before and/or after the support waypoint, or just the support waypoint by itself. For my missions I tend to place the support unit well back of the combat area and a single support waypoint near where I place the unit.  For example:

Arma refuel Support Waypoint

Support Waypoint

Another thing I like to do is add a few additional units to the support group. I do this because the AI will make support requests regardless of the combat situation. By beefing up the support group I give them a fighting chance.

Arma Refuel Support Group

Refuel Support Group

In the above screenshot I’ve added an unarmored humvee and two additional riflemen to my support group. I’ve set the refuel truck’s rank as the highest to make sure it is the group leader. I do this just to make sure the rest of the group tags along on the support request. Also note that there is no point in having armored units in the support group. The crewmen will just dismount and fight on foot when they get to the support area.

Arma Support Group

Arma Support Group

Player Called Support

Now my refuel support group is ready for both the AI and player to call upon. The player can call support through the command menu -> Call support option. Note that once the player is done with the support group they must release the group with command menu -> Call support -> Done. The AI will not respond to support requests until the player releases the group in this manner.

Arma Support Done

Support Done

Reference

Biki Waypoint Types
Arma Manual – Support units

db’s Arma Sandbox Translated.

I’ve Added Translated Pages To My Arma Blog.

I’ve used Google translate to take my all English blog and give it a more international appeal. Now you can take my badly written English and have Google poorly translate it into the language of your choice. Or at least into the language represented by the flags on the right in the Translator section of the sidebar.

If you don’t see your language there leave me a comment or send me an email & I’ll see if it is available.

Arma Failed Insertion

Arma Failed Insertion

Thanks,

db

db’s Twitter Digest for 2010-08-16 to 2010-08-22

Dynamic AI Creator Editor Placed Objects & JCOVE.

How To Use Units Placed In the Editor With DAC 2.0 and JCOVE.

So far I’ve concentrated on setting up my mission with random units generated by the DAC script. But what if you wanted to place units using the editor and then have the DAC script control their behavior and have them interact with the other DAC created units?
Glad you asked.

Inserting Units in the Editor

The first thing you will need to do is insert the units into the mission using the mission editor. I’m going to continue building on my existing DAC JCOVE mission, which last time I had added artillery support for the AI.

Just for jun I’m going to insert a civilian unit, but have the unit join up DAC as an insurgent. To do this I’m going to have to do some funny business in the editor to get JCOVE to treat the unarmed civilian as an insurgent, then I’ll do a bit of scripting to integrate my editor placed unit with DAC.

How to Create Civilian Insurgents

The first step is to insert a civilian man. I chose Iraqi Elder 1 and click ok.

Inserting a Civilian in the editor

Inserting a Civilian in the editor

The next step is to insert an insurgent; any Independent unit will do, it doesn’t matter. Before I click ok, I slide the Probability of presence: slide bar all the way to the left. This tells JCOVE that on each mission start there is a 0% probability of this unit being present. Next I set the Rank nice and high to Colonel then click OK.

Inserting an Independent unit in the editor

Inserting an Independent unit in the editor

So now I have two placed units in the editor, one civilian and one independent. Next I chose F2 group and join the two units into one group by clicking and dragging the mouse. The screenshot below shows you what I end up with; an independent and civilian in the same group.

Independent and civilian in the same group

Independent and civilian in the same group.

The civilian man inherits the side, behavior etc. of the group leader, the Independent Colonel, who will never appear in the mission. Next step, a bit of scripting to join my elderly civilian to DAC.

Embedding Editor placed units into DAC

Now for the scripting. first I double click on my elderly man in the editor and insert the following script into his Initialization field:

this setcaptive true;elder = group this;deleteWaypoint [elder,0];
  • this setcaptive true; This tells the AI that the unit is a captive & not a threat. If you don’t include this bit of code the BLUFOR AI will shoot our elderly unarmed man on sight.
  • elder = group this; Here I’m creating a global variable elder which I’ll use to reference the this unit’s group.
  • deleteWaypoint [elder,0]; DAC will not allow any editor placed objects with waypoints to be embedded into DAC. Even though we didn’t give the elder group any waypoints, every editor placed group is automatically assigned a waypoint at it’s starting location. This line of code will delete that initial waypoint 0 from the elder group.

At this point you’re done with the editor, so save the mission and alt-tab to your desktop. Navigate to your mission folder, open up your mission’s Init.sqf and look for the following line of code:

waituntil{DAC_Basic_Value == 1};

This line of code stops the execution of the init.sqf script until DAC is done initializing. Any code placed after this line will be executed after DAC gets initialized, so I stick the next bit of code on the next line:

 [elder,1,[op1,op2],5,2,2,[0,1,1],0] spawn DAC_fInsertGroup;

This is the code to insert my unit into DAC. The parameters are:

  • elder: name of the group I want to insert
  • 1: tells DAC that this is an infantry unit
  • [op1,op2] : my previously created OPFOR zones that elder will grab waypoints from
  • 5: number of waypoints to assign to this group
  • 2: side the unit belongs to – Independent
  • 2: behavior config I’m using
  • [0,1,1] DAC options – [Group Reduction off, Corpse Delete on, Call support on]
  • 0 : event config, which I’m not using

Now if I’ve done everything right, no typos etc. I should have a nice elderly man who will keep an eye out for BLUFOR, call up some DAC friends for support any maybe call an artillery strike or two onto the player.

Reference

Example mission used in post Morning Sweep v1_5
deleteWaypoint
setCaptive
waitUntil