#CONDITION

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
El_Condoro
Posts: 613
Joined: Sat Aug 03, 2019 4:35 am

#CONDITION

Post by El_Condoro »

I would like to check if NO MORE than 2 units of a country are within 2 hexes of a hex. I cannot get it to work, though. Is this the correct way?

#CONDITION_POSITION= x,y [2,2] [0,2] [2] [112]

My understanding is that if there are no units, 1 unit or 2 units of country_id 112 within 2 hexes of x,y the script will fire (all other criteria met). With 3 or more units, the script won't fire.
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: #CONDITION

Post by The Land »

ORIGINAL: El_Condoro

I would like to check if NO MORE than 2 units of a country are within 2 hexes of a hex. I cannot get it to work, though. Is this the correct way?

#CONDITION_POSITION= x,y [2,2] [0,2] [2] [112]

My understanding is that if there are no units, 1 unit or 2 units of country_id 112 within 2 hexes of x,y the script will fire (all other criteria met). With 3 or more units, the script won't fire.

While the documentation suggests it might work this way, I don't believe it does. The 'maximum' just doesn't seem to do anything.

If you look at the scripts in game that increase mobilisation if there are less than X units present - there are in fact 2 scripts, one that increases mobilisation if there are more than 0 units, and another one that counteracts the first precisely if there are X or more units.


1985 Red Storm mod - Beta testing!

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

RE: #CONDITION

Post by El_Condoro »

Yes, I think you're right and I've used that approach as a workaround for another script that I use in my campaign. I just did a test with a #CONDITION with units [0,1] - it fired on 0 and 1 as expected but also on 2, so the maximum is not working.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
El_Condoro
Posts: 613
Joined: Sat Aug 03, 2019 4:35 am

RE: #CONDITION

Post by El_Condoro »

I am wondering if a developer can confirm that #CONDITION_POSITION is working as intended and, if not, whether it can be corrected in an update. It would be such a handy thing if the minimum worked as described. Cheers.
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: #CONDITION

Post by The Land »

ORIGINAL: El_Condoro

I am wondering if a developer can confirm that #CONDITION_POSITION is working as intended and, if not, whether it can be corrected in an update. It would be such a handy thing if the minimum worked as described. Cheers.

since the WW2 title have events which work around the fact it doesn't work, I think we can be confident they know about it ;)
1985 Red Storm mod - Beta testing!

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

RE: #CONDITION

Post by El_Condoro »

I'm sure they know about it but I was hoping it could be made a bit simpler than this workaround.

Goal: show a popup spy report when a city has less than 2 units guarding it.

Workaround:
I have set up a kind of work area in a corner of the map where trade cities are for convoys. It's inaccessible in the game.
1. Set a hex on the work area with ownership of the spying country (Allies)
2. A dummy DE fires on the Axis turn (#AI= 4) that fires a territory.txt entry to change the ownership of the hex to the spying country (this is to make sure if things change with the number of units of 2+ that the popup will not fire)
3. A dummy DE fires on the Allied turn (#AI= 3) to test the number of units present and fires a territory.txt entry to change the ownership of the hex to the spied-on country (Axis) if 2+ units are present in the city
4. The popup fires when the hex has #ALIGNMENT_POSITION of Allied (i.e. the dummy DE in 3. does not fire because there are less than 2 units present)

I am basically using a hex and territory.txt as a toggle.

It works but it's messy!
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
BillRunacre
Posts: 6890
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: #CONDITION

Post by BillRunacre »

#CONDITION_POSITION= x,y [2,2] [0,2] [2] [112]

The above will fire at different times, sometimes when no units are present, sometimes when 1 is present, and other times when 2 are present.

There isn't currently a way to get a script to fire if there are less than a certain number of units present.

But you can have an event fire if there are a specific number of units present, whether that be 0, 1 or more.

For example, this will only fire if there are 3 British units within the range specified:

#CONDITION_POSITION= x,y [2,2] [3,3] [2] [112]
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
pzgndr
Posts: 3789
Joined: Thu Mar 18, 2004 12:51 am
Location: Delaware

RE: #CONDITION

Post by pzgndr »

ORIGINAL: BillRunacre
There isn't currently a way to get a script to fire if there are less than a certain number of units present.

In a way, there is. I have an East Front garrison requirement for German units in Poland prior to DOW. Basically a check for having a unit on/adjacent to 4 hexes along the Russian border, all at least 2 hexes apart. So if there are not 4 units at the border then an adverse mobilization script triggers. So some clever applications of the #CONDITION_POSITION can possibly achieve the intended goal.
Bill Macon
Empires in Arms Developer
El_Condoro
Posts: 613
Joined: Sat Aug 03, 2019 4:35 am

RE: #CONDITION

Post by El_Condoro »

Thanks, Bill. The workaround I mentioned seems to do the trick well (DE sets territory, which is used by various #ALIGNMENT_POSITION checks). The reading I made of the min,max [0,2] was that the script would be definite in its search of between 1-2, not random of 0, 1 or 2.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
Post Reply

Return to “Scenario Design and Modding”