Why Is My Warfare Mission Freezing Arma II?

Arma II Warfare Start

Arma II Warfare Start

The Warfare Mission Was Killing My Arma II.

When I say killing, I mean Arma was showing “Not Responding”  in the task manager. It would just sit there and I would have to click end task and start over. After much beating of my head against the wall, pulling out of hair and gnashing of teath, I finally figured out what I was doing wrong. I actually wasn’t doing anything wrong.

Let me explain.

How I was Building My Warfare Missions

What I had done is extracted the example missions out of the Warfare module and I had been using them as a template. I was reusing everything but the mission.sqm. Everything was working fine with Arma II ver. 1.05 and then I upgraded to ver. 1.07.

My warfare experiments would start to load and then just sit there at “Receiving”. My old machine was acting kind of wonky so I replaced it, installed Combined Operations and all was well again.
I didn’t give it much thought, but then like a fool I installed the latest patch. I fired up my warfare mission and it froze my Arma just like before. Thinking myself clever I thought

“Well they must have changed the Warfare Module, so I must be doing things the old way.”

I unpboed the new patched Warfare module and grabbed the example missions. I started up the basic example mission and … it hung my Arma. Ok, so that proved it’s not me screwing things up, but I still had no idea what was wrong.  I blamed BIS at this point and figured I would have to patiently wait for them to fix what they broke in the next patch.

Starting Over – A Clean Warfare Mission

warfare mission editor

Warfare In The Mission Editor

Then one day this week, while I was trying to avoid real work, I opened up an empty stock Arma II map. I plopped down a rifleman, and a Warfare module. I synced them together, pressed preview and the mission worked. So it wasn’t the Warfare module! One of the example mission’s files was hanging up.

I grabbed the Init.sqf out of the example mission and dropped it into my test mission. I loaded my test mission and it worked.

Next I grabbed the Description.ext,  dropped it into my test mission and it worked too.

The last file I grabbed was InitJIPcompatible.sqf. I dropped it into my test mission, loaded it up and it hung. Success – of a sort. You see the InitJIPcompatible.sqf provided in the example mission is empty. There is nothing in it, so I’m not sure why Arma would hang. Anyway the moral of the story is:

An Empty InitJIPcompatible.sqf will hang your Arma II ver. 1.07 Warfare Mission.

Random City Ownership In The Arma II Warfare Module.

How To Set City Ownership With Random Start Locations.

Last week I played with setting City ownership in the Warfare module using location game logics synchronized to individual cities. If you are using random start locations static city ownership at the start may not be what you want for your mission. The Warfare module offers a way to set City ownership to the cities closest to your random starting location.

Using Scripts To Set City Ownership

Most Warfare variables and scripts are run at the start of the mission. To overide the Warfare modules default values you will have to build a customInitMissionScript. In the mission editor in the Warfare module’s Initialization field paste the following code:

BIS_WF_Common SetVariable ["customInitMissionScript","InitMission.sqf"];

This will tell the module to call "InitMission.sqf". Here in the InitMission is where you call your custom scripts to setup the Warfare module. Note that you can’t set any variables etc. in the InitMission file as they will be overwritten when the module starts.

Setting Warfare Variables: customInitCommonScript

In your InitMission file you will see a line of code that sets the variable  "customInitCommonScript". I’ve changed it to "Init_common.sqf".

BIS_WF_Common SetVariable ["customInitCommonScript","Init_common.sqf"];

This tells the Warfare module to call my script "Init_common.sqf" to initialize values and scripts common to both the client and server.

Init_common For Common Things

Finnally here in my custom Init_common.sqf I can set my values for City ownership.

BIS_WF_MissionDefaultSide = Civilian;
BIS_WF_Constants SetVariable["EASTSTARTINGTOWNSRATIO",0.2];
BIS_WF_Constants SetVariable["WESTSTARTINGTOWNSRATIO",0.2];

What the code means in my example:

  1. BIS_WF_MissionDefaultSide: City ownership will start out as civilian
  2. “EASTSTARTINGTOWNSRATIO”,0.2: 20% of the available cities will be owned by the east at mission start
  3. “WESTSTARTINGTOWNSRATIO”,0.2: 20% of the available cities will be owned by the west at mission start

Setup this way the Warfare Module will set city ownership to the cities nearest to your starting positions.

Resources:

Sample InitMission

db’s Twitter Digest for 2010-09-20 to 2010-09-26

Setting City Ownership in the Arma II Warfare Mission.

How to Change City Ownership at the Start of a Custom Warfare Mission.

By default the Arma II Warfare Module sets town or city ownership at the start of the mission. If you would like to change who controls a city at the start of your custom Warfare mission this can be done either with Game Logics or Scripts.

Using Game Logics to Set City’s Ownership

If you are building a Warfare mission on a custom map and have already created cities using game logics, then the easiest way of setting city ownership is by using an additional Location Game Logic. See Cities with the Arma II Warfare Module for an example on how to build cities/towns with Game Logics.

To set a City Location’s side you will need to insert another Location Logic. To do this first press F1 for Units, then double click on the map to insert a unit. In the Insert Unit dialog box you would set the following:

  • Side: Game Logic
  • Class: Locations
  • Unit: Owner (Blufor), Owner (Civilian), Owner (NAPA), Owner (Opfor)

Note that if you insert the Game logic too close to the City Logic the editor will automatically group the two objects with a light blue (cyan) line. You do not want this! If this happens to you either delete the unit and try inserting the unit again a little further away or un-group the units. To un-group units press F2, click on the unit, hold your mouse button down, then drag the group line to an empty spot on the map and let go of your mouse button.

Once you have your Location Logic inserted press F5 for Synchronize. Click and hold your mouse down on your Location logic; drag your mouse to the City Location Logic and release your mouse button. The editor should look something like this:

arma2 warfare city ownership

Setting City Ownership in the Editor

Now when my custom Warfare missions starts that city will be automatically owned by the West.

If you have many towns that you wish to set ownership to, scripting may be a quicker way to go about this. I plan on exploring that in the future.

db’s Twitter Digest for 2010-09-13 to 2010-09-19