Cascading scripts

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
User avatar
mroyer
Posts: 1286
Joined: Sun Mar 06, 2016 12:27 pm

Cascading scripts

Post by mroyer »

In general, is there a way to "cascade" scripts; i.e., trigger a second script if and only if a first script is triggered? I seem to recall someone somehow using Decision scripts (or something like that) to accomplish this, but I can't get my head around that logic at the moment.

Thanks for any thoughts,
-Mark R.
User avatar
crispy131313
Posts: 2125
Joined: Fri Nov 29, 2013 11:37 pm

RE: Cascading scripts

Post by crispy131313 »

Of course that is essentially how decision events work, the decision event is triggered and the subsequent events fire.

Here is an example from my mod of how a string of decisions work:

Decision 1: Germany creates a financial/facilitator relationship with Switzerland (Fall 1939) - Result Switzerland Swings Axis
Decision 2: (only fires if DE 1 = Yes, and Switzerland remains Axis leaning) Germany strengthens relationship with Portugal (Winter 1939) - Result Portugal Swings Axis
Decision 3: (only fires if DE 2 = Yes, France is surrendered, and Switzerland and Portugal remain Axis leaning) Germany establishes a trade agreement with Portugal (Summer 1941) - Result Trade Agreement established
Decision 4: (only fires if DE 3 = YES, and France is surrendered, Spain is Axis active or Axis leaning, Portugal is Allied or Axis leaning but not active, and Switzerland is Axis leaning) - Result MPP transferred to Germany (this is a matrix of different scenarios of which only 1 or none will fire on the given turn) (Winter 1941, re-checked each turn thereafter)
Decision 5: (only fires if DE 3 = YES) and DE 2 conditions are still present) Result - UK tries to reduce Axis influence in Swtizerland (Late Winter 1942)
Decision 6: (only fires if DE 1 = YES, and if Switzerland is Axis leaning) Result - UK tries to reduce Axis influence in Portugal (Spring 1942)
Decision 7: (only fires if DE 1 = YES, and Switzerland is Allied leaning) - Result - UK severes Axis relations permanently (Anytime)
Decision 8: (only 50% chance of auto firing if DE 7 = YES) - Result - Switzerland seizes German Gold reserves resulting in MPP loss (Anytime)
Decision 9: (only fires if DE 8 = Auto Fires) - Germany Declares war on Switzerland to re-seize German Gold (Anytime)
Decision 10: (only fires if DE 9 = YES) - German re-seizes German Gold (re-gains lost MPP) if Switzerland surrenders (Anytime)
Decision 11: (only fires if DE 1 = YES, and Switzerland is Axis leaning) - Result German establishes trade agreement with Switzerland (Fall 1940)
Decision 12: (only fires if DE 12 = YES and Switzerland is Axis leaning) - Result - Continuously checked event resulting in MPP gain for Germany

Fall Weiss II - SC3 Mod
tm.asp?m=4183873

User avatar
mroyer
Posts: 1286
Joined: Sun Mar 06, 2016 12:27 pm

RE: Cascading scripts

Post by mroyer »


Nice Crispy, thanks for that - very interesting.

For my case, I was actually trying to figure out how to trigger a non-decision script to when another non-decision script is triggered. I thought someone had figured out a way to twist a decision script into effect for this, but perhaps I'm mistaken.

Here's an example of the sort of thing I'm trying to accomplish:
A nation surrenders because a surrender script is triggered. That event then triggers a national moral script for another nation to reduce it's morale.

-Mark R.
Post Reply

Return to “Scenario Design and Modding”