Problem (bug or voluntary situation ?) in unit scripts
Posted: Sat Oct 03, 2026 1:37 pm
Working on a "unit script" in my modding work, I noticed that editor script does refuse absolutly the value 2 in this line:
#TYPE=
Each time I set 2, it reports an error
Each time I set 0,1 or 3 : no any problem
To be sure, I opened the vanilla campaign Storm Europe, I registered it under a new name, then I opened the unit script of the campaign and in the first script (reproduced below), and I changed 1 to 2 for #TYPE=
My unic modification was to change "1" in "2" for the line #TYPE= , I did not change anything else
Result was same like in my own campaign : Editor did report a script error and did not accept "2"
I noticed that in all vanilla units scripts, the line #TYPE= has never the value = 2
Is it a bug or a voluntary situation ? I don't know, I report it in case of utility
Perhaps, is it not a bug, but a voluntary decision to exclude 2 as value for unit scripts ? In this case, It should be good to inform users about this restriction
The actual documentation for unit scripts do not give any alert about that : the doc text is that (like all other scripts):
#TYPE= Values range [0, 3];
; With all other fields satisfied will this be:
; 0 = Single check regardless if #TRIGGER is satisfied
; 1 = Multiple check until #TRIGGER is satisfied
; 2 = Reoccuring check until end of game
; OR
; Once the #DATE field is satisfied:
; 3 = Event fires once if all other fields are satisfied, else it will not fire. Either way, event will be removed never to be looked at again
REPRODUCTION OF VANILLA UNIT SCRIPT (The first in UNITS SCRIPT)
This version has no any problem
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; UK Decision Events
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;REMOVE1941
{
#NAME= DE 100 - The Large Destroyer Triomphant Serves As A Light Cruiser In The UK
#POPUP= <<TAG_1>>
#IMAGE= triomphant.png
#SOUND=
#FLAG= 1
#TYPE= 1
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 100[1]
#COUNTRY_ID= 112
#TRIGGER= 50
#PRIVATE= 0
#DISPLAY_TURN= 0
#FULL_RESEARCH= 0
#DATE= 1940/09/01
#FAILSAFE_DATE= 1948/01/01
#DESTINATION_RESOURCE= 136,69
#DESTINATION_RESOURCE= 137,80
; UK politically aligned with Allies and not surrendered
#VARIABLE_CONDITION= 112 [2] [100] [0]
; Dummy condition position (always satisfied)
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
#UNIT= 39 [5] [0] [FNFL Triomphant]
}
But if I just change 1 to set 2, I obtain a error report in editor, with this below version (that is exactly the same, except I set 2 in place of 1 in the concerned line #TYPE= )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; UK Decision Events
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;REMOVE1941
{
#NAME= DE 100 - The Large Destroyer Triomphant Serves As A Light Cruiser In The UK
#POPUP= <<TAG_1>>
#IMAGE= triomphant.png
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 100[1]
#COUNTRY_ID= 112
#TRIGGER= 50
#PRIVATE= 0
#DISPLAY_TURN= 0
#FULL_RESEARCH= 0
#DATE= 1940/09/01
#FAILSAFE_DATE= 1948/01/01
#DESTINATION_RESOURCE= 136,69
#DESTINATION_RESOURCE= 137,80
; UK politically aligned with Allies and not surrendered
#VARIABLE_CONDITION= 112 [2] [100] [0]
; Dummy condition position (always satisfied)
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
#UNIT= 39 [5] [0] [FNFL Triomphant]
}
#TYPE=
Each time I set 2, it reports an error
Each time I set 0,1 or 3 : no any problem
To be sure, I opened the vanilla campaign Storm Europe, I registered it under a new name, then I opened the unit script of the campaign and in the first script (reproduced below), and I changed 1 to 2 for #TYPE=
My unic modification was to change "1" in "2" for the line #TYPE= , I did not change anything else
Result was same like in my own campaign : Editor did report a script error and did not accept "2"
I noticed that in all vanilla units scripts, the line #TYPE= has never the value = 2
Is it a bug or a voluntary situation ? I don't know, I report it in case of utility
Perhaps, is it not a bug, but a voluntary decision to exclude 2 as value for unit scripts ? In this case, It should be good to inform users about this restriction
The actual documentation for unit scripts do not give any alert about that : the doc text is that (like all other scripts):
#TYPE= Values range [0, 3];
; With all other fields satisfied will this be:
; 0 = Single check regardless if #TRIGGER is satisfied
; 1 = Multiple check until #TRIGGER is satisfied
; 2 = Reoccuring check until end of game
; OR
; Once the #DATE field is satisfied:
; 3 = Event fires once if all other fields are satisfied, else it will not fire. Either way, event will be removed never to be looked at again
REPRODUCTION OF VANILLA UNIT SCRIPT (The first in UNITS SCRIPT)
This version has no any problem
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; UK Decision Events
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;REMOVE1941
{
#NAME= DE 100 - The Large Destroyer Triomphant Serves As A Light Cruiser In The UK
#POPUP= <<TAG_1>>
#IMAGE= triomphant.png
#SOUND=
#FLAG= 1
#TYPE= 1
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 100[1]
#COUNTRY_ID= 112
#TRIGGER= 50
#PRIVATE= 0
#DISPLAY_TURN= 0
#FULL_RESEARCH= 0
#DATE= 1940/09/01
#FAILSAFE_DATE= 1948/01/01
#DESTINATION_RESOURCE= 136,69
#DESTINATION_RESOURCE= 137,80
; UK politically aligned with Allies and not surrendered
#VARIABLE_CONDITION= 112 [2] [100] [0]
; Dummy condition position (always satisfied)
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
#UNIT= 39 [5] [0] [FNFL Triomphant]
}
But if I just change 1 to set 2, I obtain a error report in editor, with this below version (that is exactly the same, except I set 2 in place of 1 in the concerned line #TYPE= )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; UK Decision Events
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;REMOVE1941
{
#NAME= DE 100 - The Large Destroyer Triomphant Serves As A Light Cruiser In The UK
#POPUP= <<TAG_1>>
#IMAGE= triomphant.png
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 100[1]
#COUNTRY_ID= 112
#TRIGGER= 50
#PRIVATE= 0
#DISPLAY_TURN= 0
#FULL_RESEARCH= 0
#DATE= 1940/09/01
#FAILSAFE_DATE= 1948/01/01
#DESTINATION_RESOURCE= 136,69
#DESTINATION_RESOURCE= 137,80
; UK politically aligned with Allies and not surrendered
#VARIABLE_CONDITION= 112 [2] [100] [0]
; Dummy condition position (always satisfied)
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
#UNIT= 39 [5] [0] [FNFL Triomphant]
}