Customizing The Warfare Aircraft Factory Part 1.

Adding Units To A Warfare Aircraft Factory.

arma2 warfare aircraft factory

Aircraft Factory At Warfare HQ

A while back Atharol wrote a comment on the Creating An Airport Factory post asking how to customize the Warfare Aircraft Factory. The Aircraft Factory is where the players  can purchase rotary winged aircraft during a Warfare mission.

To illustrate how to change the units in the Aircraft Factory, I’m going to step through the creation of a simple Warfare mission with a purchasable CH-47 from the BAF Lite addon.

I’m going to try and strip my example down to the basics. To keep things organized I’ll split my explanation into two posts – one covering the mission editor and the second the required scripting.

So here we go with Part 1: the mission editor.

 

Step 1: Insert A Playable Unit

The first thing you have to do is open up the mission editor and insert a player unit. In my example I’m going to insert a USMC Riffleman on Chernaurus. It is important that you have a player unit inserted in the mission editor, because for step 2 I’m going to insert an empty unit. (Empty units are not available unless a player unit is present on the map.)

Select Units (F1) and double click on the map. Change the settings to the following:

Inserting A USMC Rifleman

Side: BLUFOR

Faction: USMC

Class: Men

Unit: Rifleman

By default the Warfare editor module only works with the default Arma II factions (USMC, Russian etc). For this example I’m only going to insert one unit with no custom factions. Again to try and keep things as simple as possible.

 

Step 2:  Insert An Empty Aircraft Factory

Next I’m going to insert an Empty Aircraft Factory.  Make sure you still have Units (F1) selected and double click on the map, but not too close to the rifleman – we don’t want the editor to group the two units together. Note the Warfare module will not reposition the Aircraft factory when the mission starts. Don’t put it too far from the playable rifleman or you may have a bit of a walk when you are testing the mission.

insert aircraft factory

Inserting An Aircraft Factory

Change the settings to the following:

Side: Empty

Class: Warfare Buildings

Unit: Aircraft Factory (USMC)

 

Once the empty Aircraft factory is inserted we can next insert the Warfare module itself.

 

 

 

Step 3: Insert A Warfare Editor Module

Select Modules (F7) and chose the Warfare module from the list. In the Initialization type the following line of code:
BIS_WF_Common SetVariable ["customInitMissionScript","InitMission.sqf"];

This tells the warfare module that we are going to use our own custom mission scripts, the details of which will be in InitMission.sqf.
We will build the InitMission.sqf and our other custom scripts in the next post.

Step 4: Synchronize The Units

I have the basics of my Warfare mission inserted into the editor, now I just need to tell the Warfare module that my rifleman & Aircraft Factory exist. To do this I need to synchronize these two units to the Warfare module by selecting Synchronize (F5). Then I can  click and hold my mouse button  on the rifleman and drag the synchronize line to the warfare module – then letting go of the mouse button. Once I’ve done the same thing with the Aircraft Factory, my mission should look like the following:

warfare_mission_editor

Warfare In The Mission Editor

 

Step 5: Limiting The Module With A Marker

By default the Warfare module will select a random start location on the map and move the player there on mission start. Normally this would be fine, but the module wont move the Aircraft factory.  I could end up having to walk to the other side of the map to test my new factory. Since I have better things to do, I’m going to limit the Warfare module to an area around my factory. To do this I have to insert a specially named marker.

Select Markers (F6) and double click on the map near the aircraft factory. I’m going to choose a rectangular map marker and I’m going to name it:

BIS_WF_InitRegion0

This specially named marker tells the warfare module to only use the built-in map locations that are covered by the marker. Since my marker doesn’t have any locations within it’s boundaries, the module will just spawn my rifleman where he was placed in the editor. As an added bonus, there will be no city locations; so no AI to complicate my testing.

That is all I need in the editor, so I’ll save the mission.

In Customizing The Warfare Aircraft Factory Part 2 I’ll break out notepad and do some custom scripting.

 

Reference

Customizing The Warfare Aircraft Factory Part 2.

Customizing The Warfare Aircraft Factory Part 3.