Open main menu

Universal Converter Project Scripting Syntax

Contents

DirectivesEdit

Directives start with # symbol. Directive values defined with #name, #version, #author and #description (or #desc) are written to compiled script code. The #define directive is used to define a constant. Directives must be placed in global space (but not inside global competition block). The #replace directive is used to replace text in the output code. The #blockname directive is used to override block names in the output code.

#name "My Competition"
#version "1.0"
#author "Author"

#define MY_CONSTANT 123
#replace "Original text" "Replacement text"
#blockname "MY_BLOCK_NAME"
Directive Description Parameters
name script name string (script name)
version script version string (script version)
author script author string (script author)
description (desc) additional script description string (script description)
define defines a constant string (constant name), value (only numbers, strings, references and arrays are allowed)
replace replaces one string with another in output code string (search string), string (replacement string)
blockname sets the block name for output code string (block name)
blockstartindex sets the base index for block names in output code number (start index)

Predefined macrosEdit

Definition UCP mode disabled UCP mode enabled
FM07 FM08-12 FM13-14 FM07 FM08-12 FM13-14
__MAX_LEAGUE_TEAMS__ 24
__MAX_POOL_TEAMS__ 9999
__NUM_COUNTRIES__ 207 208 207 208
__NUM_COUNTRIES_EUROPE__ 52 53 52 53 55
__NUM_COUNTRIES_SOUTH_AMERICA__ 10
__NUM_COUNTRIES_NORTH_AMERICA__ 35 34
__NUM_COUNTRIES_AFRICA__ 52
__NUM_COUNTRIES_ASIA__ 45
__NUM_COUNTRIES_OCEANIA__ 10 11

BlocksEdit

Blocks are used to organize relations between competitions. All blocks that are placed inside another block, will become successors for that block.

pool @pool_1 ... {
    league @league_1 ... {} // league_1 is a successor for pool_1, pool_1 is a predecessor for league_1
    league @league_2 ... {} // league_2 is a successor for pool_1, pool_1 is a predecessor for league_2
}

There are several types of blocks:

Block Description
competition (comp) defines a global competition block.
pool creates a pool (DB_POOL)
league creates a league (DB_LEAGUE)
round creates a round (DB_ROUND)
cup creates a cup (DB_CUP) with FA_CUP type
league_cup creates a cup (DB_CUP) with LE_CUP type
super_cup creates a cup (DB_CUP) with SUPERCUP type
group creates a league (DB_LEAGUE) with special naming rules
rounds_grid * creates a grid of rounds (DB_ROUND)
groups * creates a list of leagues (DB_LEAGUE)
pots * creates a pair of main pool (DB_POOL) and pool pots (DB_POOL)
country_level * creates a pair of pool (DB_POOL) and league (DB_LEAGUE)

* Might be implemented in future versions.

Each script should contain global competition (comp) block, to define competition type for competitions. A global competition block must be followed by competition type (enumeration or combined enumeration) or custom competition type name (string).

comp WorldCup {
pool @pool_1 ... {} // pool belongs to WorldCup competition type
}

comp England {
pool @pool_1 ... {} // pool belongs to English domestic competitions
}

comp Asia.ChampionsLeague {
pool @pool_1 ... {} // pool belongs to Asian Champions League competition type
}

comp "TEST" {
pool @pool_2 ... {} // pool belongs to custom international competition type with name "TEST"
}

comp Europe "TEST" {
pool @pool_2 ... {} // pool belongs to custom coninental (European) competition type with name "TEST
}

}

Custom competition types may be used for testing purposes; there's a limit of 10 custom competition types per UCP script.

InheritanceEdit

In addition, when one block is placed in another, it gets same competition level and league level (in case if block is a league). This can be overriden with level (for all competitions) and league_level (for leagues) options.

pool level 2 ... {
    league ... {} // league has competition level 2 and league level 2
}

KeywordsEdit

GeneralEdit

level

Competition level. Allowed values: from 1 to 16.

teams

Number of teams in competition. Allowed values: for a pool - from 1 to 9999, for a league - from 2 to 24, for a round and a cup - from 2 to 128. Can be followed with teams array (team IDs in hexadecimal format) or team IDs string (a string with team IDs separated with , symbol.

subs

Number of substitutions allowed in competition. Allowed values: from 0 to 7.

index

Explicitly defines competition index. Allowed values: from 0 to 32767.

use_end_of_entry (use_eoe)

A single keyword. Forces to use END_OF_ENTRY instruction.

PoolEdit

relegation

A single keyword. Marks pool as a relegation part.

sorting

Pool sorting.

constraints

An array of references or a single reference to constraint competition(s). Can contain 3 references at max.

allow_res

A single keyword, used to allow reserve teams in a pool.

RoundEdit

relegation

A single keyword. Marks round as a relegation part.

two_legs (second_leg)

A single keyword. Second leg flag.

no_flags

A single keyword. Disables all flags which were set by default (extra_time and penalties).

replay

A single keyword. Replay flag.

extra_time

A single keyword. Extra-time flag.

penalties (penalty)

A single keyword. Penalties flag.

silver_goal

A single keyword. Silver goal flag.

golden_goal

A single keyword. Golden goal flag.

without_away_goal

A single keyword. Without away goal flag.

matchdays

First season matchday or matchdays array. Allowed array element values: from 1 to 730.

matchdays2

First season matchday or matchdays array. Allowed array element values: from 1 to 730.

bonuses

Round bonuses array. May consist of 2 or 4 elements.

CupEdit

drawing

Delay in weeks between round matches and cup drawing.

template

Cup template.

matchdays

First season matchdays array. Allowed array element values: from 1 to 730. May contain arrays.

matchdays2

First season matchdays array. Allowed array element values: from 1 to 730. May contain arrays.

format

Cup format.

bonuses

Cup bonuses array. May consist of 2 or 4 elements. May contain arrays.

LeagueEdit

relegation

A single keyword. Marks league as a relegation part.

league_level

League level. Allowed values: from 1 to 16.

rel

Number of relegated teams. Allowed values: from 0 to 5.

rel_indoor

A single keyword. Indoor flag.

rel_reserve

A single keyword. Reserve flag.

take_points

A single keyword. Take points flag.

sorting

Sorting type.

rounds

Number of rounds. Allowed values: from 1 to 4.

type

League round type.

attendance (att)

League attendance multiplier. Allowed values: from 0 to 250.

transfers (trn)

League transfer market multiplier. Allowed values: from 0 to 250.

matchdays

First season matchdays array. Allowed array element values: from 1 to 730.

matchdays2

Second season matchdays array. Allowed array element values: from 1 to 730.

bonuses

League bonuses array. Must contain 4 elements.

fixtures

League fixtures array.

eu_age_limit

Age limit for non-EU players. Allowed values: from 18 to 31.

eu_max_signs

Max non-EU players signs. Allowed values: from 0 to 20.

transferflags

Transfer flags.

loanflags

Loan flags.

otherflags

Other flags.

NumbersEdit

Only positive integer numbers are supported. Hexadecimal numbers are supported (such numbers must start with "0x" prefix).

2D NumbersEdit

2D Numbers are used to represent a pair of numbers. The syntax is following:

A:B

where A is a first number and B is a second number.

EnumerationsEdit

Continent
Continent Description
Europe Europe
NorthAmerica North America
SouthAmerica South America
Africa Africa
Asia Asia
Oceania Oceania
International All continents
Country (not a complete list)
Competition type Description
England
France
Germany
Italy
Spain
...
Competition type
Competition type Description
ChampionsLeague
UefaCup
Toyota
EuroSuperCup
WorldClubChamp
UIC
QualiWC
QualiEC
WorldCup
EuroCup
U20WorldCup
ConfedCup
CopaAmerica
ICC UCP Season Patch special competition type
EuroNLQ UCP Season Patch special competition type
EuroNL UCP Season Patch special competition type
YouthChampionsLeague UCP Season Patch special competition type
Continental1 UCP Season Patch special competition type
Continental2 UCP Season Patch special competition type
NamCup UCP Season Patch special competition type
NamNL UCP Season Patch special competition type
NamNLQ UCP Season Patch special competition type
AsiaCup UCP Season Patch special competition type
AsiaCupQ UCP Season Patch special competition type
OfcCup UCP Season Patch special competition type
AfricaCup UCP Season Patch special competition type
AfricaCupQ UCP Season Patch special competition type
U20WCQ UCP Season Patch special competition type
U17WC UCP Season Patch special competition type
U17WCQ UCP Season Patch special competition type
U21EC UCP Season Patch special competition type
U21ECQ UCP Season Patch special competition type
U19EC UCP Season Patch special competition type
U19ECQ UCP Season Patch special competition type
U17EC UCP Season Patch special competition type
U17ECQ UCP Season Patch special competition type
Olympic UCP Season Patch special competition type
OlympicQ UCP Season Patch special competition type
Custom1 Custom competition type for custom competition name
Custom2 Custom competition type for custom competition name
Custom3 Custom competition type for custom competition name
Custom4 Custom competition type for custom competition name
Custom5 Custom competition type for custom competition name
Custom6 Custom competition type for custom competition name
Custom7 Custom competition type for custom competition name
Custom8 Custom competition type for custom competition name
Custom9 Custom competition type for custom competition name
Custom10 Custom competition type for custom competition name
Pool sorting
Sorting Description
None
Indoor
NatUEFA5
MapNorthSouth
MapWestEast
MapLeague
Nationality
BestTabPos
CountryStrength
UEFA5Shuffle
Random
Last16 (ChampionsCupLast16)
NorthSouth
ChampionsCupGroup
PrevPointsDiff
Continent
DrawWorldCup
DrawEuroCup
CopaAmerica
League sorting
Sorting Desritption
GoalDiff (GD)
Goals (G)
DirectMatches (DM)
Round type
Round type Desritption
None
Quali
Quali2
Quali3
PreRound1
Round1
Round2
Round3
Round4
Round5
Group1
Group2
Last16
Quarterfinal
Semifinal
Final
Final3rdPlace
Cup template
Cup template Description
FA_Germany
FA_England
FA_France
FA_Spain
FA_Italy
LeagueCup_Germany
LeagueCup_England
LeagueCup_France
CC_FA_Germany_32_1
CC_FA_Germany_32_2
FA_Scotland
LeagueCup_Scotland
LeaguecupDiv2And3
ConferenceCup
Supercup1Leg
Supercup2Leg
FriendlyMatch
Tournament4Teams
RelegationSwitherland
RelegationEngland3
FA_Cup_Small
CC_FA_Germany_128
CC_FA_Germany_64
CC_FA_Germany_32_3
CC_FA_Germany_64_32
Team type
Team type Description
First
Reserve
YouthA
YouthB

Combined enumerationsEdit

For continental competition types, combined enumerations may be used. They consist of continent name and competition type name:

comp Europe.ChampionsLeague ... {}

StringsEdit

Strings start and end with " symbol.

Strings are used to name competitions.

cup "Cup Name" ... {}

Strings may contain escape characters \" and \n, for example:

"Text is \"quoted\""

CommentariesEdit

There are 2 types of commentaries: single-line and multi-line.

Single-lineEdit

Single-line commentaries start with // symbols.

get( @pool_1 ) // comment

Multi-lineEdit

Multi-line commentaries start with /* symbols and end with */ symbols.

get( @pool_1 ) /* multi-
               line comment */ 

ReferencesEdit

References are used to refer specific competitions. A reference starts with @ symbol. When a competition is defined, it can be assigned with some reference name. Then, other competitions may refer to this competition with a reference.

pool @pool_1 ... {}
league ... {
    get( @pool_1 )
}

Special referencesEdit

There are 3 special reference types: @this, @prev and @next. @this is used to refer to a current competition. @prev is used to refer to all predecessor competitions. @next is used to refer to all successor competitions.

Direct referencesEdit

Direct references can't be declared, their names consists of competition region, competition type and competition index (joined with _ symbol). They are an equivalent of competition IDs in original FIFA Manager scripting syntax. Direct references start with @@ symbols.

getWinner( @@Europe_ChampionsLeague_22 )

ArraysEdit

Arrays are used to hold multiple values. An array starts with [ symbol and ends with ] symbol. Arrays may store numbers, strings, references and arrays (thus, multi-dimensional arrays are possible). Array elements are separated with , symbol.

RangesEdit

A range is a special syntax to define an array. The syntax is following:

[A-B^C]

where A - range start (inclusive), B - range end (inclusive), C - range step (optional). Ranges may be combined with an usual array syntax. See examples in the following table.

Array declaration Resulting array elements
[1-3] 1, 2, 3
[1-7^3] 1, 4, 7
[1,3,5-7] 1, 3, 5, 6, 7

Ranges work only with numbers.

Repeated valuesEdit

If there are 2 or more same values stored in an array continuonosly, they can be represented with a following syntax:

[A*B]

where A - value, B - values count. Repeated values may be combined with an usual array syntax.

Repeated values expression may be followed with optional modificator:

[A*B+C] - repeat A value B times, and each time add C value.
[A*B-C] - repeat A value B times, and each time substract C value.
Array declaration Resulting array elements
[3*4] 3, 3, 3, 3
[5*3+1] 5, 6, 7
[10*4-2] 10, 8, 6, 4

Repeated values work only with numbers.

SortingEdit

A sorting operator allows to apply a special sorting for array elements. This operator starts with % symbol. Possible sorting types are:

Sorting operator Description
%r reverse sorting
%x cross sorting
%rx reversed cross sorting

Examples:

Array declaration Resulting array elements
[1,2,3,4 %r] 4, 3, 2, 1
[1,2,3,4 %x] 1, 3, 2, 4
[1,2,3,4 %rx] 2, 4, 1, 3

InstructionsEdit

Command name Parameters Description
buildCounter assessment position
reserveAssessmentTeams assesment position (array is allowed), number of reserve spaces
buildUEFA5 assesment position (array is allowed), number of reserve spaces
getChamp competition reference (array is allowed)
getEuropeanAssessmentTeams assesment position (array is allowed), league table position, number of teams
getUEFA5Tab assesment position (array is allowed), league table position, number of teams
fillAssessmentReserves -
getUEFA5SureTab assesment position (array is allowed), unknown
getChampOrRunnerUp competition reference (array is allowed)
getUEFA5SureUIC assesment position (array is allowed), unknown
getTabXToY league reference (array is allowed), table start position, number of teams
getTabSureXToYZ league reference (array is allowed), table start position, table end position, number of teams
getTabLevelXToY league level (array is allowed), table start position, number of teams
getTabSpare -
getTabLevelStartXToY league level (array is allowed), table start position, number of teams
getEuropeanAssessmentCupwinner assesment position (array is allowed)
getUEFA5ChampOrFinalist assesment position (array is allowed), competition reference (array is allowed)
getWinner round reference (array is allowed)
getLoser round reference (array is allowed)
getPool pool reference (array is allowed), pool start position, number of teams
getNatUEFA5WithHost assesment position (array is allowed)
getNatUEFA5WithoutHost assesment position (array is allowed)
getNatSouthAmerica country id (continent id and array are allowed)
getNatAmerica -
getNatAfrica -
getNatAsia -
getNatOceania -
getHost -
getInternationalTabLevelXToY country id (continent id and array are allowed), league level, start position, number of teams
getInternationalSpare country id (continent id and array are allowed), number of teams
getRunnerUp competition reference (array is allowed)
getTabLevelIndoor league level (array is allowed), table start position, number of teams
getRelegatedTeams league reference (array is allowed)
getInternationalTeams country id (continent id and array are allowed), number of teams
getCCFaWinner competition reference (array is allowed)
getCCSpare -
getChampCountryTeam competition reference (array is allowed)
getRandomNationalTeam continent id (array is allowed), number of teams
changeTeamTypes team type
getFairnessTeam number of teams
copyLeagueData league reference
getNationalTeam country id (continent id and array are allowed)
getNationalTeamWithoutHost country id (continent id and array are allowed)
shuffleTeams -
get pool or league or round reference (array is allowed), [position=All], [numTeams=1]
getBottom pool or league reference (array is allowed), [position=All], [numTeams=1]
getAll pool or league or round reference (array is allowed), [position=1]
getBottomAll pool or league reference (array is allowed), [position=1]
getFromTo pool or league or round reference (array is allowed), start position, end position
getBottomFromTo pool or league or round reference (array is allowed), start position, end position

Cup formatEdit

Cup format consists of a single round description or of an array of round descriptions. A round description is a special set of flags.

The syntax for round description is following:

(Number of matches)[Match duration][-Restrictions][+Number of new teams]
  • Number of matches:
    • 1 - One leg
    • 2 - Two legs
    • R - Replay
  • Match duration:
    • E - extra time
    • P - penalties
    • G - golden goal
    • S - silver goal
  • Restrictions:
    • P - no premier-league teams
    • S - no shuffle
    • A - without away goal

Examples:

Round flag Decoding
2EP 2 matches, with extra time, with penalties
RG-PS 1 match with possible replay, with golden goal rule, without premier-league teams, without teams shuffle
1EP+8 1 match, with extra time, with penalties, with 8 new teams in the round

BonusesEdit

Domestic leagueEdit

League (continental/international)Edit

[Match bonus, Match win bonus, Match draw bonus, Total TV bonus]

All match bonuses (Match bonus * Number of matches) are paid at the start.

RoundEdit

[Total bonus, Round winner bonus, UnusedĀ ?, Total TV bonus]

CupEdit

Special symbolsEdit

PredecessorEdit

Used to explicitly define predecessors (one reference or an array of references). This type of predecessor works in two directions - so the competition will become a successor for declared predecessor competitions.

pool @pool_2 <- @pool_1 ... {} // pool_1 is predecessor for pool_2, pool_2 is successor for pool_1

SuccessorEdit

Used to explicitly define successors (one reference or an array of references). This type of successor works in two directions - so the competition will become a predecessor for declared successor competitions.

pool @pool_1 -> [@pool_2, @pool_3] ... {} // pool_2 and pool_3 are successors for pool_1, pool_1 is predecessor for pool_2 and pool_3

Weak PredecessorEdit

Used to explicitly define predecessors (one reference or an array of references). This type of predecessor works only in one direction. The competition won't become a successor for declared predecessor competitions.

pool @pool_2 <~ @pool_1 ... {} // pool_1 is predecessor for pool_2

Weak SuccessorEdit

Used to explicitly define successors (one reference or an array of references). This type of successor works only in one direction. The competition won't become a predecessor for declared successor competitions.

pool @pool_1 ~> [@pool_2, @pool_3] ... {} // pool_2 and pool_3 are successors for pool_1

ToolsEdit

ScriptStudio - basic implementation of Universal Converter Project scripts editor.