Condition Position trigger for insufficient units?

Post bug reports and ask for help with other issues here.
Post Reply
User avatar
Elessar2
Posts: 1408
Joined: Wed Nov 30, 2016 12:35 am

Condition Position trigger for insufficient units?

Post by Elessar2 »

Want a National Morale loss if not enough units are in a given area. I was aware of this kludgy workaround (from a vanilla Mobilization 2 script):
;REMOVE1941
;
; This Event will apply if the triggers for the Event beneath it aren't met
{
#NAME= 4 Axis Units Near Warsaw From January 1941 (USSR->Allies)
#POPUP=
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#GV= 1[1,100]
#LINK= 0[0]
#LEVEL= 0
#COUNTRY_ID= 116
#TRIGGER= 100
#DATE= 1941/01/01
; 2% mobilization increase towards Allies
#MOBILIZATION= [2,2] [2]
; Set variable conditions:
; 1st Line - Germany politically aligned with Axis and not surrendered
#VARIABLE_CONDITION= 45 [1] [100] [0]
; 2nd Line - Poland politically aligned with Allies and surrendered
#VARIABLE_CONDITION= 85 [2] [100] [1]
; Dummy condition position (always satisfied)
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

;REMOVE1941
;
; This event is to counteract the one above
{
#NAME= 4 Axis Units Near Warsaw From January 1941 (USSR->Axis)
#POPUP=
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#GV= 1[1,100]
#LINK= 0[0]
#LEVEL= 0
#COUNTRY_ID= 116
#TRIGGER= 100
#DATE= 1941/01/01
; 2% mobilization increase towards Axis
#MOBILIZATION= [2,2] [1]
; Set variable conditions:
; 1st Line - Germany politically aligned with Axis and not surrendered
#VARIABLE_CONDITION= 45 [1] [100] [0]
; 2nd Line - Poland politically aligned with Allies and surrendered
#VARIABLE_CONDITION= 85 [2] [100] [1]
; 4 Axis units are within 10 hexes of Warsaw
#CONDITION_POSITION= 188,76 [10,10] [4,4] [1] [0]
}
I had instead tried this (for the National Morale script I am trying to perfect):
; #NAME= French Morale Is Lowered By The Evacuation Of the B.E.F.
Fewer than 4 British units within 24 hexes of Nancy
#CONDITION_POSITION= 283,124 [24,24] [0,3] [2] [112]
Duhh, I had forgotten that "[0,3]" means "at least 0 to 3", not "0 to 3 only, no more, no less." Since I actually had 8 units, the script fired when I didn't want it to. I then tried using a less than arrow at the end of that, but just got an error message for my trouble.

Is the 1st kludgy alternative above the only option? Will the quick "correction" of the National Morale loss by the 2nd script hopefully not have any untoward effects on any other scripts or code?

---

For those playtesters waiting for my scenario, this is why it's taking so long; 4 months of playtesting gone (since the script will keep firing until France hits 0 NM and surrenders). Note 95% of the scripts are just vanilla ones copied over and edited for the new map coordinates, but those 5% that I made, if any have dire errors of this sort, just means going back to Sept 1st, 1939, Groundhog Day style. :cry:
User avatar
Elessar2
Posts: 1408
Joined: Wed Nov 30, 2016 12:35 am

Re: Condition Position trigger for insufficient units?

Post by Elessar2 »

Duhh moment, the arrow needs the brackets: [<] Props to the devs for this new functionality, exactly what was needed. 8-)
User avatar
Elessar2
Posts: 1408
Joined: Wed Nov 30, 2016 12:35 am

Re: Condition Position trigger for insufficient units?

Post by Elessar2 »

If you guys are around this week, got a related question. The 2 German Warsaw-based garrison requirements, one for 1940, the other for 1941 onwards. Does the 1941 one (minimum is 4 units else +2% mobilization for Russia) override the 1940 one (which only needs 2 units, also +2%), or are they cumulative, meaning if you have just 1 unit there it is 2% + 2% = 4% in 1941?
User avatar
BillRunacre
Posts: 6346
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

Re: Condition Position trigger for insufficient units?

Post by BillRunacre »

They are cumulative, so an Axis player who leaves the east empty would be heavily penalized for doing so.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
Post Reply

Return to “Tech Support”