What is the difference between these two script statements?

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

What is the difference between these two script statements?

Post by DarkHorse2 »

#CONDITION_POSITION= 188,76 [10,10] [4,4] [1] [0] [<]

and...

#CONDITION_POSITION= 188,76 [10,10] [0,3] [1] [0]

Are these equivalent?
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: What is the difference between these two script statements?

Post by El_Condoro »

First one:
Triggers if 4+ Axis units come within 10 hexes of 188,76.

Second one:
Triggers if 0-3 (the value is random) Axis units are within 10 hexes of 188,76.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Re: What is the difference between these two script statements?

Post by DarkHorse2 »

Sincerely appreciate your response. :!: :!: :!:

Given the lack of any other, I can only guess that nobody else knows?

But how could they?

The game manual and the script templates are completely lacking any detail on it.

And given the 1500+ occurances of #CONDITION_POSITION in 1939 SOE, I can't see this "randomness" even being used.

:roll:
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Re: What is the difference between these two script statements?

Post by DarkHorse2 »

found one here, and of course, lacking meaningful comments:

Code: Select all

{
#NAME= Egyptian Nationalists Rise Up Against The British As The Axis Approach Cairo
#POPUP= <<TAG_30>>
#IMAGE=
#SOUND= coup.ogg
#FLAG= 1
#TYPE= 1
#AI= 0
#LEVEL= 0
; Set global variable condition to always trigger (dummy value)
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 45
#FLAG_ID= 36
#TRIGGER= 50
#SEASON_FLAG= 0
#DATE= 1940/01/01
#MAP_POSITION= 208,126 [1,3] [0,1] [-10,-30] [2] [0]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#VARIABLE_CONDITION= 36 [2] [100] [0]
#VARIABLE_CONDITION= 45 [1] [100] [0]
; Axis within range of Cairo
#CONDITION_POSITION= 208,126 [3,3] [1,2] [1] [0]
}
and here:

Code: Select all

{
#NAME= USSR Siberian Reserves
#POPUP= <<TAG_80>>
#IMAGE= siberian.png
#SOUND= transport_movement.ogg
#FLAG= 1
#TYPE= 1
#AI= 0
#LEVEL= 0
; Set global variable condition to always trigger (dummy value)
#GV= 1[1,100]
; Set link value to always trigger (dummy value)
#LINK= 0[0]
#COUNTRY_ID= 116
#TRIGGER= 55
#PRIVATE= 0
#DISPLAY_TURN= 0
#FULL_RESEARCH= 1
#DATE= 1941/12/01
#FAILSAFE_DATE= 1942/05/01
#DESTINATION_RESOURCE= 243,66
#VARIABLE_CONDITION= 116 [2] [100] [0]
#CONDITION_POSITION= 227,35 [2,3] [1,2] [1] [0]
#CONDITION_POSITION= 225,54 [2,3] [1,2] [1] [0]
#CONDITION_POSITION= 221,65 [2,4] [3,5] [1] [0]
#CONDITION_POSITION= 224,77 [2,3] [1,2] [1] [0]
#CONDITION_POSITION= 225,88 [2,3] [1,2] [1] [0]
#CONDITION_POSITION= 235,101 [2,3] [1,2] [1] [0]
#CONDITION_POSITION= 234,85 [3,5] [2,4] [1] [0]
#CONDITION_POSITION= 257,58 [3,5] [1,2] [1] [0]
#UNIT= 0 [10] [1] [Zhukov]
#UNIT= 0 [10] [1] []
#UNIT= 4 [10] [1] []
#UNIT= 4 [10] [1] []
#UNIT= 4 [10] [1] []
#UNIT= 5 [10] [1] []
#UNIT= 5 [10] [1] []
#UNIT= 5 [10] [1] []
#UNIT= 14 [10] [1] []
#UNIT= 14 [10] [1] []
#UNIT= 26 [10] [1] []
#UNIT= 27 [10] [1] []
#UNIT= 29 [10] [1] []
#UNIT= 30 [10] [1] []
}

Found one when German units approach Paris and a couple more times in Operation Sealion.

So, out of 1500+ occurrences, this randomness is used maybe 5 times... and in those cases it most likely could have been implemented using #TRIGGER instead.
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: What is the difference between these two script statements?

Post by El_Condoro »

In my campaign, I never use it. Now that [<] has been introduced, there doesn't seem to be any need for it.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
BillRunacre
Posts: 6606
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

Re: What is the difference between these two script statements?

Post by BillRunacre »

It is rarely used, but for instance in the case of the Siberians it is to reduce the opportunities for gamey Axis play, as the variability makes it much harder for them to play the system and avoid triggering them.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Re: What is the difference between these two script statements?

Post by DarkHorse2 »

Seems like the script templates are in need of some love with better explanations for these statements.

Been working on something locally, but it is still a work-in-progress....

Code: Select all

; Basic structure for a popup event:
; {
; #NAME=  Event name 
;         (this will be shown as a selectable event under an OPTIONS screen within the game)
;
; #POPUP= Event popup text 
;         (this will be displayed when the event occurs)
;
; #MESSAGE= Event text
;         (was added so that modders can now manually add in text to be shown with an entry for the #IMAGE field)
;
; #IMAGE= Event image that will be displayed when event occurs
;         PNG images must be 736x418 or 368x418 pixels, see 'Extras' folder for sample images and frames
;         Multiple pictures can be used by using a ',' to separate them
;         Format: picture1.png, picture2.png, picture3.png, picture4.png
;
; #SOUND= Event sound that will be displayed when event occurs
;         Multiple sounds can be used by using a ',' to separate them
;         Format: sound1.mp3, sound2.mp3, sound3.mp3, sound4.mp3
;
; #FLAG= Value range [0, 1]
;        Event default state:
;        0 = Disabled
;        1 = Enabled
;
; #TYPE= Value range [0, 3]
;        Event check type, with all other fields satisfied:
;        0 = Single check, on or after #DATE 
;            (ignores #TRIGGER)
;        1 = Multiple checks, on or after #DATE, until #TRIGGER is satisfied
;        2 = Multiple checks, on or after #DATE, until end of game (*** not valid for UNIT events ***)
;            (not removed from event queue)
;        3 = Single check, only on #DATE
;
; #AI= Value range [0, 6]
;        0 = Event fires whenever all fields are satisfied for any game type
;        1 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Axis
;        2 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Allied
;        3 = Event fires whenever all fields are satisfied, for any game type, and only when the AI is Axis in Single Player, 
;            or on Allied Multiplayer turns
;        4 = Event fires whenever all fields are satisfied, for any game type, and only when the AI is Allied in Single Player 
;            or on Axis Multiplayer turns
;        5 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Axis in Single Player, 
;            or for AI controlled Axis majors on Axis human player turns
;        6 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Allied in Single Player,
;            or for AI controlled Allied majors on Allied human player turns
;
; #LEVEL= Value range [-1, 4]
;       What minimum skill level, as selected from the AI difficulty level screen in game, with this event apply to?
;       -1 = a script that should only fire for AI friendly controlled majors on your turn
;        0 = Green
;        1 = Novice
;        2 = Intermediate
;        3 = Veteran
;        4 = Expert
;
; #GV=   Does the event activate based on the Global Variable values assigned?
;        Ten random Global Variables are assigned at the start of the campaign, each with a value between [1,100]
;        Format: GV [min, max]
;                GV range [1,10] (one of the ten global variables)
;                min,max range [1,100] 
;
;        Example A - #GV= 1[1,100] will always trigger because Global Variable #1 will always have a value between [1,100]
;        Example B - #GV= 4[71,100] will trigger 30% per game
;
; #LINK= Does the event activate based on the Link values assigned?
;        A campaign can have up to 1100 Decision events and is referenced by other events via this parameter
;        Format: decision[response]
;                decision range [1, 1100]
;                response range [0, 1]
;                   0 = NO
;                   1 = YES
;
;        Example A - #LINK= 0[0] will always trigger as formal DECISION events can only be from 1-1100
;        Example B - #LINK= 1[0] will trigger whenever #DECISION= 1 is not accepted
;        Example C - #LINK= 3[1] will trigger whenever #DECISION= 3 is accepted
;
; #TRIGGER=     Value range [0, 100]
;               Percentage chance that the event will occur
;
; #COUNTRY_ID=  Value range [0, 120]
;               Country ID that is the owner of this event
;               (use #COUNTRY_ID= 0 for generic popup)
;
; #PRIVATE= Value range [0, 1] 
;         Should the event remain private to the side receiving it?
;         0 = False
;         1 = True
;
; #DISPLAY_ORDER= Value range [0, 2]
;         Turn phase to display this popup event:
;         0 = End of Turn
;         1 = Beginning of Turn
;         2 = Deployment Phase (#DATE is ignored)
;
; #DISPLAY_TURN= Value range [0, 2]
;         Player turn to display this popup event:
;         0 = Any
;         1 = Axis Turn
;         2 = Allied Turn
;
; #DISPLAY_STYLE= What type of display style for the #POPUP banner text area?
;                 0 = default style, simple text with small national flags relative to #COUNTRY_ID on either side of text 
;                     (this default can be used with #MESSAGE body text and/or #IMAGE and #SOUND)
;                 1 = major header, larger text with no national flags on either side of text 
;                     (only if #IMAGE used, otherwise will default to default style = 0)
;              2.xx = mouse hover popup style where xx refers to the sprite index of the symbol_sprites.png file that will 
;                     be shown at #MAP_POSITION.
;                     More than one #MAP_POSITION can be set for #DISPLAY_STYLE = 2.xx
;                     (e.g. 2.24 indicating the 24th sprite in the symbol_sprites.png file).
;                     (#TRIGGER and #DISPLAY_ORDER is ignored)
;                     Display of symbol sprite will follow the logic of the POPUP event:
;                       if #DISPLAY_TURN and #AI = 0, 
;                           show on all player turns.
;                       If #DISPLAY_TURN value > 0,  
;                           show on Axis or Allied turns, 
;                       #PRIVATE= 1 can be used to hide the display of the symbol sprite when 'Hide/Show Map Info' is disabled in game.
;
; #MESSAGE_STYLE=       Value range[0, 3]
;                       What type of #MESSAGE body style will be shown?
;                       0 = default style (no large national flags or symbols shown in the #MESSAGE body text area)
;                       1 = large national flag in upper right corner relative to #COUNTRY_ID
;                       2 = large national flag in upper right corner w/ national symbol shown in upper middle of the 
;                           #MESSAGE body text area
;                       3 = #MESSAGE body text will be displayed in the bottom half w/ large national flag in lower left 
;                           bottom half as well 
;
; #DATE=                Date that must be satisfied for event to occur
;                       Format: yyyy/mm/dd or yyyy/mm/dd [=]
;                           if [=] is used, only applies for year specified.
;
; #TEXT_RGB=            Text color for the decision event
;                       Format: red_clr, green_clr, blue_clr
;                       clr range [0, 255]
;
; #SHADOW_RGB=          Shadow color for the decision event text 
;                       (NOT USED IN SC3)
;
; #MAP_POSITION=        Position that the POPUP event will center over when the event fires.
;                       (Can be left blank)
;
; #ALIGNMENT_POSITION=  Position control event requirement:
;                       Format: x,y [0..2]
;                           0 = Neutral
;                           1 = Axis
;                           2 = Allied
;
; #VARIABLE_CONDITION=  Variable conditions event requirement
;                       Format: country_id [alignment] [mobilization%] [surrendered_flag]
;                           country_id range [1, 120]
;                           alignment range [0, 2]
;                               0 = Neutral
;                               1 = Axis
;                               2 = Allied
;                           mobilization range [0, 100]
;                           surrendered_flag range [0, 1]
;                               0 = False
;                               1 = True (has surrendered)
;
; #CONDITION_POSITION=  Map positions that will serve to trigger the event as well as distance and
;                       number of Axis/Allied unit ranges as specified by 'alignment' flag
;                       Format: x,y [min_range, max_range] [min_units, max_units] [alignment] [aligned_country_id] OR
;                               x,y [min_range, max_range] [min_units, max_units] [alignment] [aligned_country_id] [<]
;                           range = RND(min_range,max_range)
;                           units = RND(min_units,max_units)
;                           alignment range [0, 2]
;                               0 = Neutral
;                               1 = Axis
;                               2 = Allied
;                           aligned_country_id range [0, 120]
;                               0 = Any country (uses alignment above)
;
; } 
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: What is the difference between these two script statements?

Post by El_Condoro »

That looks good. One piece of information that is critical and only appears in the notes after these is whether the condition uses AND or OR logic. That would be useful for the notes themselves, I think.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
The Land
Posts: 940
Joined: Fri Feb 19, 2010 4:58 pm

Re: What is the difference between these two script statements?

Post by The Land »

El_Condoro wrote: Wed Aug 02, 2023 1:23 pm First one:
Triggers if 4+ Axis units come within 10 hexes of 188,76.

Second one:
Triggers if 0-3 (the value is random) Axis units are within 10 hexes of 188,76.
I always assumed that the [0,3] meant it triggered if greater than or equal to 0 and less than or equal to 3 units were in that distance, but that for some reason it didn't work.

Oh well, you live and learn!
1985 Red Storm mod - Beta testing!

Always wanted to play a "Cold War goes hot" scenario? Come and join in!
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: What is the difference between these two script statements?

Post by El_Condoro »

So did I.

[4,4] (<] (with the other conditions) can be used now.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
Lothos
Posts: 1255
Joined: Tue May 23, 2006 8:22 pm

Re: What is the difference between these two script statements?

Post by Lothos »

The Land wrote: Mon Aug 07, 2023 4:59 pm
El_Condoro wrote: Wed Aug 02, 2023 1:23 pm First one:
Triggers if 4+ Axis units come within 10 hexes of 188,76.

Second one:
Triggers if 0-3 (the value is random) Axis units are within 10 hexes of 188,76.
I always assumed that the [0,3] meant it triggered if greater than or equal to 0 and less than or equal to 3 units were in that distance, but that for some reason it didn't work.

Oh well, you live and learn!
I always had issues with using ranges in the engine. They never seem to work the way I think it will and most of the time never fire so I always use fixed numbers.

So instead of 0,3 I would put 3,3 which basically says if their is 3 or more units then the statement is true.

If it is the distance field then again instead of 0,8 I always use 8,8 which means anything that is 8 hexes or less away then do this.
Post Reply

Return to “Scenario Design and Modding”