What's wrong with this string of scripts?

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
Kossatx
Posts: 97
Joined: Sun Aug 16, 2015 5:48 pm
Location: Spain

What's wrong with this string of scripts?

Post by Kossatx »

Hi, I've made this string of two scripts. The first one (#DECISION= 106) works perfectly, but the second one (#DECISION= 107) don't. I have done a lot of testings, but I can't find any error [&:] The coordinates are ok, and the #TRIGGER value is changed to 100% for testings. Anyone has suggestions about?
;Once Germany is without oil reserves (105) starts oil shortage.
{
#NAME= DE 106 1/2 - Germany oil shortage (Trigger 30%) 1/2
#POPUP=
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 105[1]
#COUNTRY_ID= 45
#TRIGGER= 100
#DISPLAY_ORDER= 0
#DECISION= 106
#MPP_UPDOWN= 0
#MPP_TURNS= 0
#MPP_TEXT=
#NOTES=
#NOTES_POSITION=
#AI_RESPONSE= 100
#AI_RESPONSE_POPUP=
#DATE= 1939/09/02
#TEXT_RGB= 0,0,0
#SHADOW_RGB= 0,0,0
#ALIGNMENT_POSITION= 141,28 [1]
#ALIGNMENT_POSITION= 1,24 [2]
#ALIGNMENT_POSITION= 191,44 [2]
#NATIONAL_MORALE_TRIGGER= 0 [0]
#VARIABLE_CONDITION= 45 [1] [100] [0]
#CONDITION_POSITION= 185,51 [0,0] [0,0] [2] [0]
#CONDITION_POSITION= 185,51 [0,0] [0,0] [0] [0]
}

;Once Germany is without oil reserves (105) starts oil shortage.
{
#NAME= DE 106 2/2 - Germany oil shortage (100%) 2/2
#POPUP=
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 106[1]
#COUNTRY_ID= 45
#TRIGGER= 100
#DISPLAY_ORDER= 0
#DECISION= 107
#MPP_UPDOWN= -90
#MPP_TURNS= 1
#MPP_TEXT= Oil shortage
#NOTES=
#NOTES_POSITION=
#AI_RESPONSE= 100
#AI_RESPONSE_POPUP=
#DATE= 1939/09/02
#TEXT_RGB= 0,0,0
#SHADOW_RGB= 0,0,0
#ALIGNMENT_POSITION= 141,28 [1]
#ALIGNMENT_POSITION= 1,24 [2]
#ALIGNMENT_POSITION= 191,44 [2]
#NATIONAL_MORALE_TRIGGER= 0 [0]
#VARIABLE_CONDITION= 45 [1] [100] [0]
#CONDITION_POSITION= 191,58 [0,0] [0,0] [2] [0]
#CONDITION_POSITION= 191,58 [0,0] [0,0] [0] [0]
}
User avatar
BillRunacre
Posts: 6824
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: What's wrong with this string of scripts?

Post by BillRunacre »

Hi Kossatx

The #CONDITION_POSITION= in the second script are different to those in the first one.

Does DE 106 work if it has the same #CONDITION_POSITION= as DE 105?

If so then it must be that.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
Kossatx
Posts: 97
Joined: Sun Aug 16, 2015 5:48 pm
Location: Spain

RE: What's wrong with this string of scripts?

Post by Kossatx »

Thanks BillRunacre, but the decision 107 even don't work with a dummy "#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]". The #CONDITION_POSITION are different between 106 and 107 because (if I'm not wrong) is not possible to include the four condition position in the same script and obtain the effect I want. If are all together, if one coordinate is true the other three don't have to be. I want at least one option of each pair to be true.
Kossatx
Posts: 97
Joined: Sun Aug 16, 2015 5:48 pm
Location: Spain

RE: What's wrong with this string of scripts?

Post by Kossatx »

I can't solve this string of two scripts [&:] While the first one (#DECISION= 106) triggers ok, the second one (#DECISION= 107) never triggers even though "#CONDITION_POSITION= 191,58 [0,0] [0,0] [2] [0]" or "#CONDITION_POSITION= 191,58 [0,0] [0,0] [0] [0]" are true. Anyone has any idea about this?
User avatar
BillRunacre
Posts: 6824
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: What's wrong with this string of scripts?

Post by BillRunacre »

If you remove DE 107's link to DE 106, does it then fire?
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
Kossatx
Posts: 97
Joined: Sun Aug 16, 2015 5:48 pm
Location: Spain

RE: What's wrong with this string of scripts?

Post by Kossatx »

Yes, it works if there is no "DE 106" link, but then the string sequence disappears [:(] I don't understand why the "DE 106" link breaks the string [&:]
Kossatx
Posts: 97
Joined: Sun Aug 16, 2015 5:48 pm
Location: Spain

RE: What's wrong with this string of scripts?

Post by Kossatx »

I've found why "DE 107" didn't fire. If I change "#TYPE= 2" to "#TYPE= 1" in "DE 106", then "DE 107" fires. I guess there is any incompatibility with "#TYPE= 2" events when included in a string of scripts. If what I say is ok, then I'm not sure if is possible to mod the "Oil shortage" event as I want. How can I write is necessary to fire an event these two conditions must be true every turn?

Condition A. One of these options must be true:
#CONDITION_POSITION= 185,51 [0,0] [0,0] [2] [0]
#CONDITION_POSITION= 185,51 [0,0] [0,0] [0] [0]

Condition B. And one of these two options must also be true:
#CONDITION_POSITION= 191,58 [0,0] [0,0] [2] [0]
#CONDITION_POSITION= 191,58 [0,0] [0,0] [0] [0]
User avatar
BillRunacre
Posts: 6824
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: What's wrong with this string of scripts?

Post by BillRunacre »

Hi Kossatx

What is the relevance of there being no Allied units at these locations?

Could this be done instead by adding them to the #ALIGNMENT_POSITION= as being in Axis hands?
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
Kossatx
Posts: 97
Joined: Sun Aug 16, 2015 5:48 pm
Location: Spain

RE: What's wrong with this string of scripts?

Post by Kossatx »

I don't know how to fire the event saying "if positions A and B aren't in Axis hands", so I've used the "CONDITION_POSITION" command to say "if positions A and B are in neutral or allied hands". If I'm not wrong, only one of the "CONDITION_POSITION" commands included in an script must be true to fire, that's the reason I divided them in two pairs:

For DE 106:
#CONDITION_POSITION= 185,51 [0,0] [0,0] [2] [0]
#CONDITION_POSITION= 185,51 [0,0] [0,0] [0] [0]

For DE 107:
#CONDITION_POSITION= 191,58 [0,0] [0,0] [2] [0]
#CONDITION_POSITION= 191,58 [0,0] [0,0] [0] [0]

Maybe there is a better way to do it, but I don't know [&:]
User avatar
BillRunacre
Posts: 6824
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: What's wrong with this string of scripts?

Post by BillRunacre »

If you add more #ALIGNMENT_POSITION= to the first Decision then you can do that, as there can be more than one of those in the script.

Then you won't need the second Decision, at least that's what I'm thinking from looking at this.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
Kossatx
Posts: 97
Joined: Sun Aug 16, 2015 5:48 pm
Location: Spain

RE: What's wrong with this string of scripts?

Post by Kossatx »

But if I write more than one "ALIGNMENT_POSITION" they will be read with AND logic, so if I write this it has no sense... not? Is not possible a place to be occupied by Allies and neutrals [&:]

#ALIGNMENT_POSITION= 191,58 [2]
#ALIGNMENT_POSITION= 191,58 [0]
User avatar
BillRunacre
Posts: 6824
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

RE: What's wrong with this string of scripts?

Post by BillRunacre »

If the neutral is pro-Allied then it should still work with a setting of 2

It may be that you could use two different scripts, one for when place X is Allied but Y is Axis, another for when both are Allied, etc.
Follow us on Twitter: https://twitter.com/FurySoftware

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

Return to “Scenario Design and Modding”