Create campaign

From UFO:AI

Please see the talk page.

Contents

General

UFO:AI has built-in support for several campaigns in singleplayer mode. You can choose the campaign you want to play for every new game.

Syntax and semantic

If you want to add your own campaign you should be aware of the syntax and the semantic of each variable in UFO-Scripts/campaign.ufo.

Campaign definition

name of the campaign - mark via _ as first char for being translateable.
campaign description - mark via _ as first char for being translateable.
which team? alien or human
this is an equipment definition that defines which weapons are available at the beginning of this campaign
how many soldiers at beginning of the campaign
how many scientists at beginning of the campaign
how many workers at beginning of the campaign
how many medics at beginning of the campaign
how many ugvs at beginning of the campaign
which market should be used - the market is an equipment definition that defines which weapons are buyable via market
how many credits the player has at the beginning
which map should be used?
Is this campaign visible in campaign-menu?
Campaign date
initial stage - see #Stages

Example

campaign main
{
	name		"_Standard Campaign"
	text		"_txt_standard_campaign"
	team		human
	soldiers	12
	difficulty	0
	equipment	campaign_player
	market		campaign_market
	credits		4000000
	map		map_earth
	visible		true
	date		"2048 0 7"
	firststage	intro
}

Stages

You can define a stage by several stagesets - see #Stagesets for more information about this.

  • set [setname]: Stageset name (see below)
setname is the name or id for the firststage var at #Campaign definition

Example

stage intro
{
	set first
	{
		seq			intro
		delay		"0 1 0"
		frame		"0 3 0"
		missions	"farm"
		number		1
		expire		"0 3 0"
		quota		0
	}
	set terror_only
	{
		needed		first
		delay		"0 0 1"
		frame		"0 10 0"
		expire		"0 3 0"
		missions	"africa_excavation bunker mine mart italy japan oriental"
		quota		6
		nextstage	ufos_are_coming
	}
	set stop
	{
		needed		terror_only
		delay		"0 20 0"
		endstage	intro
	}
}

Stagesets

Each stage can contain several stage sets.

the missions strings - seperated with white space
number of missions that needs to be played to deactivate the stage set and, perhaps, start another set and/or stage
the sequence id to play at stageset activation
the whole stageset to activate after the current set is done
commands that are executed at stageset activation
works like quota, except that the missions only needs to appear on geoscape (no need to play them)

Example

set terror_only
{
	needed		first
	delay		"0 0 1"
	frame		"0 10 0"
	expire		"0 3 0"
	missions	"africa_excavation bunker mine mart italy japan oriental"
	quota		6
	nextstage	ufos_are_coming
}

Missions

As mentioned in the Stagesets section of this howto you can add missions to each set. The syntax is already described in: Adding a new mission

Links

project-navigation