Variable Condition question, would this work?

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
User avatar
Lothos
Posts: 1251
Joined: Tue May 23, 2006 8:22 pm

Variable Condition question, would this work?

Post by Lothos »

Does anyone know if a command like this would work?

; - Italy - ??? - War - Surrendered
#VARIABLE_CONDITION= 59 [0] [100] [1]

Basically, would this cause the decision to fire if Italy surrendered regardless of what faction they belong to?

There are decisions that fire based off Italy surrendering, the problem is some of those decisions do not fire if Italy surrenders to the Axis instead of the Allies. This is how Italy ends up switching sides sometimes.

This decision is supposed to fire after they surrendered but before they are liberated (if they can be liberated, it depends on who they surrendered to)

I am trying to avoid writing duplicate decisions.
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: Variable Condition question, would this work?

Post by El_Condoro »

I don't think it would work because if they have surrendered they will also be either Allied [2] or Axis [1] and never Neutral [0] as they are in the condition.

Could you use a check DE chain - (A) checks for surrender to Allies (59 [1] [100] [1]); then (B) #LINK= A[0] checks for surrender to Axis (59 [2] [100] [1]), then all other scripts check for #LINK= B[0 or 1]? If it doesn't change, then DE check B is not needed. #LINK= A[0 or 1] will be enough. If it does change, (a #TYPE= 2 check), then (B) would be needed in case Italy is actually mobilized and not surrendered.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
Lothos
Posts: 1251
Joined: Tue May 23, 2006 8:22 pm

Re: Variable Condition question, would this work?

Post by Lothos »

El_Condoro wrote: Sun Dec 31, 2023 11:18 pm I don't think it would work because if they have surrendered they will also be either Allied [2] or Axis [1] and never Neutral [0] as they are in the condition.

Could you use a check DE chain - (A) checks for surrender to Allies (59 [1] [100] [1]); then (B) #LINK= A[0] checks for surrender to Axis (59 [2] [100] [1]), then all other scripts check for #LINK= B[0 or 1]? If it doesn't change, then DE check B is not needed. #LINK= A[0 or 1] will be enough. If it does change, (a #TYPE= 2 check), then (B) would be needed in case Italy is actually mobilized and not surrendered.
The only way to do it is to have literally two identical chains remember the VARIABLE check uses an AND for each statement and not OR
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: Variable Condition question, would this work?

Post by El_Condoro »

That's right and why the A and B checks would be needed. I'm not sure how often Italy is likely to change sides or surrender in your mod but individual DE scripts might be quicker.
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”