Page 1 of 1
Global Variable
Posted: Mon Jan 18, 2021 8:10 pm
by Robert24
Good afternoon,
Or logic is used with the below [:D]
Can someone point to a previous Forum answer for using Global Variables in scripts?
Is there an explanation with some detail?
Is there an example in the campaign game scripts?
Thanks in advance!
-Robert
RE: Global Variable
Posted: Tue Jan 19, 2021 5:12 pm
by BillRunacre
Hi Robert
The rescue of Mussolini uses these, as if GV 6 is between 1 and 90 he will be rescued, but if it is 91-100 then he won't be.
Another relates to the attempt to capture Dakar.
I've pasted the POP UP scripts relating to Mussolini here so you can use their example as inspiration for whatever you're cooking up! [:)]
; Operation Oak:
; Historical date of event was 1943/09/12
; Images - Wikipedia Commons (Public Domain)
{
#NAME= DE 621 - Otto Skorzeny Rescues Mussolini
#POPUP= <<TAG_23>>
#MESSAGE=
#IMAGE= skorzeny_raidsuccess1.png, skorzeny_raidsuccess2.png, skorzeny_raidsuccess3.png
#SOUND=
#FLAG= 1
#TYPE= 1
#AI= 4
#LEVEL= 0
#GV= 6[1,90]
#LINK= 621[1]
#COUNTRY_ID= 45
#TRIGGER= 100
#PRIVATE= 0
#DISPLAY_ORDER= 1
#DISPLAY_TURN= 1
#DISPLAY_STYLE= 0
#MESSAGE_STYLE= 0
#DATE= 1941/01/01
#TEXT_RGB= 255,255,255
#SHADOW_RGB= 0,0,0
#MAP_POSITION= 94,50
;Set Alignment Position (Berlin)
#ALIGNMENT_POSITION= 101,36 [1]
#VARIABLE_CONDITION= 45 [1] [100] [0]
; Dummy condition position (always satisfied)
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
; Operation Oak:
; Historical date of event was 1943/09/12
; Images - Wikipedia Commons (Public Domain)
{
#NAME= DE 621 - Otto Skorzeny's Mission To Rescue Mussolini Failed
#POPUP= <<TAG_24>>
#MESSAGE=
#IMAGE= skorzeny_raidfailure.png
#SOUND=
#FLAG= 1
#TYPE= 1
#AI= 4
#LEVEL= 0
#GV= 6[91,100]
#LINK= 621[1]
#COUNTRY_ID= 45
#TRIGGER= 100
#PRIVATE= 0
#DISPLAY_ORDER= 1
#DISPLAY_TURN= 1
#DISPLAY_STYLE= 0
#MESSAGE_STYLE= 0
#DATE= 1941/01/01
#TEXT_RGB= 255,255,255
#SHADOW_RGB= 0,0,0
#MAP_POSITION= 94,50
;Set Alignment Position (Berlin)
#ALIGNMENT_POSITION= 101,36 [1]
#VARIABLE_CONDITION= 45 [1] [100] [0]
; Dummy condition position (always satisfied)
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
RE: Global Variable
Posted: Wed Jan 20, 2021 12:44 am
by Robert24
Great stuff Bill! [:)]
I had never asked and just worked around GVs.
Would a GV function with a third script? For example…
#NAME= DE 150 III Corps Arrives In Egypt
#GV= 5[1,33]
#NAME= DE 150 III Corps Arrives In UK
#GV= 5[34-66]
#NAME= DE 150 III Corps Arrives In India
#GV= 5[67-100]
-Robert
RE: Global Variable
Posted: Wed Jan 20, 2021 8:08 am
by BillRunacre
Yes, there are some like that in our WWI game. There could be more than 3 if needed. Potentially 100 in theory but I've never thought to use that many... not yet anyway! [:D]
RE: Global Variable
Posted: Wed Jan 20, 2021 12:04 pm
by Robert24
Well, this is good news Bill - Thank you!