Jump to content

Script question about unit proximity


Recommended Posts

I was looking at scripts in the default 1939 scenario (v1.05a) trying to figure out how they work. The type that test for units in/near a certain location are confusing. The #CONDITION_POSITION lines have a (min range,max range) argument of (1,1) which seems to me would exclude units that are IN the test location. IE, shouldn't the range test be (0,1) instead?

examples:

; Axis abandon Soviet frontier positions resulting in an additional

; 3-5% increase in USSR activation towards Allies

{

#NAME= Warsaw/Konigsberg Garrisons in 1941 (USSR->Allies)

#POPUP=

#FLAG= 1

#TYPE= 2

#AI= 0

#COUNTRY_ID= 4

#TRIGGER= 75

#DATE= 1941/01/01

; 3-5% activation increase towards Allies

#ACTIVATION= [3,5] [2]

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

; Axis have no units in or adjacent Warsaw OR

#CONDITION_POSITION= 95,15 [1,1] [0,0] [1] [0]

; Axis have no units in or adjacent Konigsberg

#CONDITION_POSITION= 94,12 [1,1] [0,0] [1] [0]

}

; Axis have limited Soviet border positions resulting in a

; 3-7% increase in USSR activation towards Allies

{

#NAME= Soviet Border Garrisons in 1941 (USSR->Allies)

#POPUP=

#FLAG= 1

#TYPE= 2

#AI= 0

#COUNTRY_ID= 4

#TRIGGER= 75

#DATE= 1941/01/01

; 3-7% activation increase towards Allies

#ACTIVATION= [3,7] [2]

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

; Axis have no units in or adjacent this border position OR

#CONDITION_POSITION= 97,14 [1,1] [0,0] [1] [0]

; Axis have no units in or adjacent this border position OR

#CONDITION_POSITION= 97,16 [1,1] [0,0] [1] [0]

}

Link to comment
Share on other sites

IIRC, the range variable is just that - variable. So [1,1] means "take a range of between 1 and 1" (i.e. always 1), whereas [2,4] means "each turn, take a range of between 2 and 4" (so one game someone might be at range 4 for many turns and not trigger the condition, whilst the next game it triggers on the first turn). Range zero is always included.

EDIT: The unit variable is the same. Say you want to send units towards Moscow without triggering the Siberians (unit variable [3,5]), you will always trigger them with 5 or more units, maybe trigger them with 3 or 4 and never trigger them with 2.

Link to comment
Share on other sites

Originally posted by Bromley:

[1,1] means "take a range of between 1 and 1" (i.e. always 1

If that's true, then the condition would not be triggered with a unit in range 0, would it ? IT's odd...

Originally posted by Bromley:

triggering the Siberians (unit variable [3,5]), you will always trigger them with 5 or more units

Darn ! when I saw this post, I checked the scripts and for USSR readiness it said [6,8] around Warshaw. I hoped I could get away with placing *9* units there, hehe.
Link to comment
Share on other sites

Originally posted by TaoJah:

If that's true, then the condition would not be triggered with a unit in range 0, would it ? IT's odd...

Range zero is always included.
I wasn't explaining too well last night. If it's [2,4] the game, each turn, randomly chooses a number between 2 and 4 (inclusive)= x. The range, for that turn, then becomes 0->x. Next turn the same thing happens but x is recalculated. Same for the number of units allowed within that range before the condition is satisfied.

That explains why, for example, sometimes the Siberians trigger and sometimes, with the exact same unit placements, they don't.

Darn ! when I saw this post, I checked the scripts and for USSR readiness it said [6,8] around Warshaw. I hoped I could get away with placing *9* units there, hehe.
It's not a big problem as the range on that condition is only 1, so you can still cram a lot of units up on the border off Russia, especially if Romania is on board. Just to confirm, [6,8] would mean that 5 units would be 100% safe.

Merry Christmas!

Link to comment
Share on other sites

Hmmm... So 6-8 means it takes randomly 6, 7 or 8 and then the condition is filled if you have 6, 7 8 or more units. So with 6 units, there is a 33% chance it will execute, 66% chance with 7 units and 100% with 8 or 9 units.

What a nifty way to do things !

Link to comment
Share on other sites

×
×
  • Create New...