Hi!
I've started writing AI scripts for Polish Soviet War scenario. I figured out that mainly I need to use Guard and Offensive scripts, due to my scenario specifics( no Naval Units, no diplomacy no research). However there are few things that remain unclear for me. I wonder if anyone can explain it to me, It would be most appreciated!
In GUARD scripts, there is a position called HOLD.
0 = Do not hold current unit in position, replace with weaker unit if possible
In this line what does it mean "current unit"? It refers to which units? Whole AI managed units on the map? Or units in GOAL POSITION? and "replace"? Refers to which units? It's all a bit messy to understand for me. I did study AI guard scripts for Luddendorf Offensive, but still I am not sure if i understand it right. Maybe somebody can explain it for me?
"No attacking from this position" it means units in GOAL POSITION will not concur any attacks, even if they have enemy units in their zone of control?
#STEAL= Set priority by stealing units from resource positions Does it mean, that if i set STEAL in the scripts, AI will move units from the rear, guarding resource hexes, like mines or cities?
CANCEL and ACTIVATE POSITION as I read both use OR logic, so it means, triggering one of them is enough to make whole script into motion?
Also #LENGTH, what does it mean? It is mentioned in the notes, but not explained at the beginning. What does #LENGTH=1 means?
I've made a short script for Polish forces, first to hold on in KIEV, but if in danger of being flanked, they should withdraw for secondary position to Korosten. I marked them by A and B in order to remember what is first to occur, and what is the latter. Let's have a look:
{
#NAME= Polish Garrison - Kiev Frontline A
#POPUP=
#FLAG= 1
#TYPE= 2
#COUNTRY_ID= 85
#TRIGGER= 100
#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]
#LENGTH= 1
#HOLD= 0
#ADD_HQ= 1
#GOAL_POSITION= 86,52
#GOAL_POSITION= 86,53
#GOAL_POSITION= 87,53
#GOAL_POSITION= 87,54
#GOAL_POSITION= 88,55
#GOAL_POSITION= 88,56
#GOAL_POSITION= 88,57
#GOAL_POSITION= 89,57
#DATE= 1920/05/26
#STEAL= 0
; Set friendly positions:
; 1st Line - Warsaw
#FRIENDLY_POSITION= 18,42
; Set variable conditions:
; 1st Line - Poland politically Allied and not surrendered
#VARIABLE_CONDITION= 85 [2] [100] [0]
; Set tactical conditions:
; 1st Line - Warsaw not tactically threatened (dummy condition)
#TACTICAL_CONDITION= 18,42 [3]
; Dummy position
#ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0]
; Soviet units in position flanking Kiev
; Soviets approaching Fastov, Sokolche, Obuchoviche
OR Kiev taken by Soviets
#CANCEL_POSITION= 85,58 [1,1] [1,1] [1]
#CANCEL_POSITION= 79,61 [1,1] [1,1] [1]
#CANCEL_POSITION= 82,50 [1,1] [1,1] [1]
#CANCEL_POSITION= 88,55 [0,0] [1,1] [1]
}
{
#NAME= Polish Garrison - Korosten B
#POPUP=
#FLAG= 1
#TYPE= 2
#COUNTRY_ID= 85
#TRIGGER= 100
#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]
#LENGTH= 1
#HOLD= 0
#ADD_HQ= 1
#GOAL_POSITION= 74,52
#GOAL_POSITION= 73,52
#GOAL_POSITION= 74,51
#GOAL_POSITION= 71,52
#DATE= 1920/05/26
#STEAL= 0
; Set friendly positions:
; 1st Line - Warsaw
#FRIENDLY_POSITION= 18,42
; Set variable conditions:
; 1st Line - Poland politically Allied and not surrendered
#VARIABLE_CONDITION= 85 [2] [100] [0]
; Set tactical conditions:
; 1st Line - Warsaw not tactically threatened (dummy condition)
#TACTICAL_CONDITION= 18,42 [3]
; Kiev taken by Soviets
#ACTIVATE_POSITION= 88,55 [0,0] [1,1] [1]
; Soviet units in flanking position
; Soviets approaching Ovruch, Zviahel
OR Korosten taken by Soviets
#CANCEL_POSITION= 74,48 [2,2] [1,1] [1]
#CANCEL_POSITION= 67,56 [2,2] [1,1] [1]
#CANCEL_POSITION= 74,52 [0,0] [1,1] [1]
}
My last question is connected with #TRIGGER:
#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 = Reoccurring 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
As I understand TRIGGER is for AI, to express probability that event will occur. I understand it with Partisans. For example there is a trigger for Partisan unit to SPAWN in certain location, with, lets say 25% probability ( #TRIGGER=25), Type 2. Type two until end of the game, each turn there will be chance that partisans will spawn, OR unitil reaching some date limit?
But type 1 in this case mean, it will check every turn, UNTIL the partisan will finally spawn, and will not be checked again?
Type 3 says it will fire only if all other FIELDS are satisfied, what does "fields" mean here? Like VARIABLE CONDITION, yes? So it will check each turn until, date, Variable condition will be fulfilled?
Sorry for stupid questions, but I need to understand it clearly, to plan defensive Plan for Poles. My general scheme for Polish AI will be to withdraw from one position to another, if position "A" (like Kiev in the example above) will be captured OR flanked. Then, Polish troops should advance for another position.
Because now I am not sure, I guess I should make it that position A (Kiev in example) CANCEL POSITION trigger should be at the same time ACTIVATE POSITION trigger for position "B" (Korosten in the example)?
Please help!
Jazon
