This article shows some trick about adding domestic cups in external script files. It includes examples for the ScriptStudio script editor, but the output code (original FIFAM script format) is included too.
In the UCP Season patch there's no way to edit database in the regular way, which also means that there's no way to edit domestic competitions. On the other hand, it's possible to edit continental and international competitions, because they are stored in external script files in the "script" folder. These external scripts are a bit different from scripts in .sav files (Editor database files). But the most important thing that domestic competitions can be placed in these files too!
As an example, we will create a new cup in Germany, where U-18 teams of Bundesliga and Bundesliga 2 teams will play in 6 rounds. Talking more specific, we need to create a cup (DB_CUP) wit type of League Cup (LE_CUP) in Germany (country ID 21). As said before, the format for scripts in external files is different, so we need to do something to "enable" that format. This done in this way: we write a competition as a part of WorldCup (so it will use format for external files), but we also replace the generated signature of created competition ("255, WORLD_CUP") in the output code with the desired one ("21, LE_CUP"). It's also important that we need to use cup indexes from 1 to 3, because the index 0 can't be used (the competition { XX, LE_CUP, 0 } is always deleted before the country database is read). In the example we use index 1 for the cup.
Display All
The output code is following:
Display All
And finally, we need to add this code to some of external script files. I'm going to add it into ConfedCup.txt. By default, there's a space for 10 competitions in that file (the first line in the file), and only 6 of them are used. I want to add the code to the end of the file, so I need to use "%INDEX%CONFED_CUP7" header for my competition. Knowing this, I can slightly modify the code by adding 2 lines at the beginning:
Display All
So now the output code will transform to:
Display All
Now we can add this code at the end in ConfedCup.txt.
Display All
The in-game result:
In the UCP Season patch there's no way to edit database in the regular way, which also means that there's no way to edit domestic competitions. On the other hand, it's possible to edit continental and international competitions, because they are stored in external script files in the "script" folder. These external scripts are a bit different from scripts in .sav files (Editor database files). But the most important thing that domestic competitions can be placed in these files too!
As an example, we will create a new cup in Germany, where U-18 teams of Bundesliga and Bundesliga 2 teams will play in 6 rounds. Talking more specific, we need to create a cup (DB_CUP) wit type of League Cup (LE_CUP) in Germany (country ID 21). As said before, the format for scripts in external files is different, so we need to do something to "enable" that format. This done in this way: we write a competition as a part of WorldCup (so it will use format for external files), but we also replace the generated signature of created competition ("255, WORLD_CUP") in the output code with the desired one ("21, LE_CUP"). It's also important that we need to use cup indexes from 1 to 3, because the index 0 can't be used (the competition { XX, LE_CUP, 0 } is always deleted before the country database is read). In the example we use index 1 for the cup.
C Source Code
- #name "Germany U-19 Cup"
- #replace "{ 255, WORLD_CUP" "{ 21, LE_CUP" // replace WorldCup ID with German Cup ID
- comp WorldCup { // we use "WorldCup" mode to enable cup format for continental/international scripts
- league_cup index 1 "DFB-Junioren-Vereinspokal" teams 36 /* generate 6 matchdays (every week (7 days)) */ matchdays [20-55^7] {
- format [1EP+8,1EP+28,1EP,1EP,1EP,1EP] // 8 teams playing pre-round, 32 teams in knockout stage (28+4)
- getTabLevelXToY(1, 1, 24) // get all teams on level 1 (Bundesliga)
- getTabLevelXToY(2, 1, 24) // get all teams on level 2 (Bundesliga 2)
- changeTeamTypes(YouthA) // change teams to youth A (u-18)
- }
- }
The output code is following:
Brainfuck Source Code
- ; ----------------------------------------------------
- ; Compiled with ScriptStudio v0.4.3
- ; ----------------------------------------------------
- ; Germany U-19 Cup
- ; ----------------------------------------------------
- 1
- ; ----------------------------------------------------
- ; "DFB-Junioren-Vereinspokal" ( @@WorldCup_0 )
- ; ----------------------------------------------------
- %INDEX%WORLD_CUP0
- DB_CUP
- { 21, LE_CUP, 1 }
- DFB-Junioren-Vereinspokal
- 36,6,6
- %INDEX%MATCHDAYS
- 20,27,34,41,48,55
- 20,27,34,41,48,55
- %INDEXEND%MATCHDAYS
- %INDEX%ROUNDINFO
- 0,5,8,8,0,4,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 1,6,32,28,4,20,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 2,12,16,0,20,28,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 3,13,8,0,28,32,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 4,14,4,0,32,34,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 5,15,2,0,34,35,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- %INDEXEND%ROUNDINFO
- 3
- 0
- 0
- 0
- 3
- GET_TAB_LEVEL_X_TO_Y
- 0
- 1
- 24
- GET_TAB_LEVEL_X_TO_Y
- 1
- 1
- 24
- CHANGE_TEAM_TYPES, 2 ; YouthA
- %INDEXEND%WORLD_CUP0
- ; ----------------------------------------------------
C Source Code
- #name "Germany U-19 Cup"
- #replace "{ 255, WORLD_CUP" "{ 21, LE_CUP" // replace WorldCup ID with German Cup ID
- #blockstartindex 7 // we will add the code to ConfedCup.txt, where 7 is the next free id for competition
- #blockname "CONFED_CUP" // we will add the code to ConfedCup.txt
- comp WorldCup { // we use "WorldCup" mode to enable cup format for continental/international scripts
- league_cup index 1 "DFB-Junioren-Vereinspokal" teams 36 /* generate 6 matchdays (every week (7 days)) */ matchdays [20-55^7] {
- format [1EP+8,1EP+28,1EP,1EP,1EP,1EP] // 8 teams playing pre-round, 32 teams in knockout stage (28+4)
- getTabLevelXToY(1, 1, 24) // get all teams on level 1 (Bundesliga)
- getTabLevelXToY(2, 1, 24) // get all teams on level 2 (Bundesliga 2)
- changeTeamTypes(YouthA) // change teams to youth A (u-18)
- }
- }
Brainfuck Source Code
- ; ----------------------------------------------------
- ; Compiled with ScriptStudio v0.4.3
- ; ----------------------------------------------------
- ; Germany U-19 Cup
- ; ----------------------------------------------------
- ; "DFB-Junioren-Vereinspokal" ( @@WorldCup_0 )
- ; ----------------------------------------------------
- %INDEX%CONFED_CUP7
- DB_CUP
- { 21, LE_CUP, 1 }
- DFB-Junioren-Vereinspokal
- 36,6,6
- %INDEX%MATCHDAYS
- 20,27,34,41,48,55
- 20,27,34,41,48,55
- %INDEXEND%MATCHDAYS
- %INDEX%ROUNDINFO
- 0,5,8,8,0,4,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 1,6,32,28,4,20,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 2,12,16,0,20,28,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 3,13,8,0,28,32,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 4,14,4,0,32,34,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- 5,15,2,0,34,35,BEG_1ST_LEG| BEG_WITH_EXTRA_TIME| BEG_WITH_PENALTY,0,0,0,0
- %INDEXEND%ROUNDINFO
- 3
- 0
- 0
- 0
- 3
- GET_TAB_LEVEL_X_TO_Y
- 0
- 1
- 24
- GET_TAB_LEVEL_X_TO_Y
- 1
- 1
- 24
- CHANGE_TEAM_TYPES, 2 ; YouthA
- %INDEXEND%CONFED_CUP7
- ; ----------------------------------------------------
C Source Code
- %INDEXEND%CONFED_CUP6
- ; ------------------------------------------------------------------ // <------- oriignal script ending
- ; ---------------------------------------------------- // <------- our code
- ; Compiled with ScriptStudio v0.4.3
- ; ----------------------------------------------------
- ; Germany U-19 Cup
- ; ----------------------------------------------------
- ; "DFB-Junioren-Vereinspokal" ( @@WorldCup_0 )
- ; ----------------------------------------------------
- %INDEX%CONFED_CUP7
- DB_CUP
- // ...
- // ... the rest of the code ...
- // ...
- %INDEXEND%CONFED_CUP7
- ; ----------------------------------------------------


The post was edited 4 times, last by Dmitry ().