Page 1 of 1

Scripts location

Posted: Tue Nov 30, 2021 4:30 pm
by ncc1701e
Where are the scripts located? The one that contains things like:

//Axis control surrounding hexes cut off Leningrad
$SuppressPort
if_Date=1/1/1939
lifespan=continuous
//Supplying Road of life
//Kabozha
xyControl=192,75,Axis
//Leningrad port
xyArea=186,77,2
$End

I would like to understand what is programmed in terms of production when the Ural factories are coming online.

RE: Scripts location

Posted: Wed Dec 01, 2021 4:52 pm
by ncc1701e
Yeah, I find them:

//USSR moves factories
$GiveResource
if_Date=8/1/1941
xyControl=206,59,Allies
actionCountry=4
lifespan=once
xyArea=206,59,30
addReportTo=Allies
text=Soviet rails factories away from key industrial areas reducing production by 5.
$End

//USSR moves factories
$GiveResource
if_Date=9/1/1941
xyControl=233,73,Allies
actionCountry=4
lifespan=once
xyArea=199,57,28
addReportTo=Allies
text=Soviet rails factories away from key industrial areas reducing production by 5.
$End

//USSR moves factories
$GiveResource
if_Date=3/15/1942
xyControl=233,73,Allies
actionCountry=4
lifespan=tillTrigger
xyArea=237,74,62
addReportTo=Allies
text=Soviet railed factories come online in the Urals.
$End

//USSR moves factories
$GiveResource
if_Date=6/15/1942
actionCountry=4
lifespan=tillTrigger
xyArea=240,76,60
addReportTo=Allies
text=Soviet railed factories come online in the Urals.
$End

RE: Scripts location

Posted: Fri Dec 10, 2021 12:13 am
by ncc1701e
The way I am reading it, all events will be executed separately. Is there a way to tell that one event may happen if another event was previously executed?

For example, if the Germans captures factories before their move, they can't be moved in the Urals.

RE: Scripts location

Posted: Sat Dec 11, 2021 1:46 pm
by stjeand
From what I am reading...and let me pull just one of the pieces...
Hopefully this is what you are looking for:


This says IF the Russian own Voronezh on 8/1/41 remove the 5 point factory for the hex.
IF the Axis own it do nothing.

ONLY the Allies will get the message that the factory was railed away on the turn it is removed.

//USSR moves factories
$GiveResource
if_Date=8/1/1941
xyControl=206,59,Allies (Voronezh)
actionCountry=4
lifespan=once
xyArea=206,59,30
addReportTo=Allies
text=Soviet rails factories away from key industrial areas reducing production by 5.
$End


This one is broken but...what do I know...
This says if the Russians own a rail line in the Urals (233,73) remove the 5 point factory in Kursk
Should be if the Russians own Kursk (199,57) then remove the factory.
IF the Axis take Kursk before it does not matter...the factory apparently will be removed.

//USSR moves factories
$GiveResource
if_Date=9/1/1941
xyControl=233,73,Allies
actionCountry=4
lifespan=once
xyArea=199,57,28 (Kursk)
addReportTo=Allies
text=Soviet rails factories away from key industrial areas reducing production by 5.
$End

ONLY the Allies will get the message that the factory was railed away on the turn it is removed.


Basically 7 months later a factory shows up in 233,74 IF the Russians still own 233,73.
This is a 10 point factory.
So the Russians dismantle a 5 point factory and build a 10 point factory.
Nice.

//USSR moves factories
$GiveResource
if_Date=3/15/1942
xyControl=233,73,Allies
actionCountry=4
lifespan=tillTrigger
xyArea=237,74,62
addReportTo=Allies
text=Soviet railed factories come online in the Urals.
$End

9 months after Kursk was moved a factory shows up in 240,76...
This is a 20 point factory.
So the Russians dismantle a 5 point factory and build a 20 point factory.
Really nice.

//USSR moves factories
$GiveResource
if_Date=6/15/1942
actionCountry=4
lifespan=tillTrigger
xyArea=240,76,60
addReportTo=Allies
text=Soviet railed factories come online in the Urals.
$End




NOW an interesting fact...IF the Russians do not remove the factories...it does not matter. They still get the new ones in the Urals.
IF the Germans capture the factory before it moves...they get the factory points BUT the Russian one in the Urals will still be built.

RE: Scripts location

Posted: Mon Dec 13, 2021 4:54 pm
by ncc1701e
ORIGINAL: stjeand

NOW an interesting fact...IF the Russians do not remove the factories...it does not matter. They still get the new ones in the Urals.

Yes this is my point. All events will fired. It seems an event A can't be a trigger for an event B.

Let's say the Germans are fast and captured the factory. The factory can't go to the Urals since it is captured.

RE: Scripts location

Posted: Tue Dec 14, 2021 12:34 pm
by AlvaroSousa
I forgot to set event flags for those. Thanks.

RE: Scripts location

Posted: Sun Dec 26, 2021 2:45 pm
by ncc1701e
ORIGINAL: AlvaroSousa

I forgot to set event flags for those. Thanks.

Could you please show me an example of the event code to do these flags?

Also, do I have to navigate inside the editor to do this? Or, can I just change the _events.txt file in a notepad or equivalent?

Thanks

RE: Scripts location

Posted: Sat Jan 01, 2022 4:41 pm
by ncc1701e
I really see nothing linked to events in the graphical interface of the editor. If I am modifying the _events.txt file with a text editor, will it load automatically the next time the scenario is loaded / played?

RE: Scripts location

Posted: Sun Jan 02, 2022 1:01 pm
by ncc1701e
Oh I find this option:

File/Quit -> Load All Scripts (lower right) -> Save

I will try with notepad a simple event.

RE: Scripts location

Posted: Sun Jan 02, 2022 3:05 pm
by stjeand
FYI...copy the event file to the new scenario directory...then Load All Scripts.

That will load the new event file.

RE: Scripts location

Posted: Mon Jan 03, 2022 6:25 pm
by ncc1701e
ORIGINAL: ncc1701e

ORIGINAL: AlvaroSousa

I forgot to set event flags for those. Thanks.

Could you please show me an example of the event code to do these flags?

I think I get it.

//USSR moves factories
$GiveResource
if_Date=9/1/1941
xyControl=233,73,Allies
actionCountry=4
lifespan=once
xyArea=199,57,28
addReportTo=Allies
text=Soviet rails factories away from key industrial areas reducing production by 5.
flag=1
$End

//USSR moves factories
$GiveResource
if_Flag=1
xyControl=233,73,Allies
actionCountry=4
lifespan=tillTrigger
xyArea=237,74,62
addReportTo=Allies
text=Soviet railed factories come online in the Urals.
$End

The question is about number. Is there an unlimited range for it?

flag=number ― if the script succeeds the flag number will be set to true

RE: Scripts location

Posted: Sat Jan 08, 2022 5:25 pm
by ncc1701e
One more question, is it possible for a given flag number to be used in several other events? Looks like I can't find an example of flag usage in the Europe 1939 scenario.

RE: Scripts location

Posted: Thu Jan 27, 2022 3:07 pm
by AlvaroSousa
There was a mistake int he scripts. They are fairly simple

### AUTO moves factories still in Soviet control The xyControl value was incorrect. Fixed in the update.
### This has the effect of denying Germany some resources.

//USSR moves factories
$GiveResource
if_Date=8/1/1941
xyControl=206,59,Allies
actionCountry=4
lifespan=once
xyArea=206,59,30
addReportTo=Allies
text=Soviet rails Voronezh factories away from key industrial areas reducing production by 5.
$End

//USSR moves factories
$GiveResource
if_Date=9/1/1941
xyControl=199,57,Allies
actionCountry=4
lifespan=once
xyArea=199,57,30
addReportTo=Allies
text=Soviet rails Kursk factories away from key industrial areas reducing production by 5.
$End

###THESE 2 add new factories in the rear regardless of what was moved up front.

//USSR moves factories
$GiveResource
if_Date=3/15/1942
xyControl=233,73,Allies
actionCountry=4
lifespan=tillTrigger
xyArea=237,74,62
addReportTo=Allies
text=Soviet railed factories come online in the Urals.
$End

//USSR moves factories
$GiveResource
if_Date=6/15/1942
actionCountry=4
lifespan=tillTrigger
xyArea=240,76,60
addReportTo=Allies
text=Soviet railed factories come online in the Urals.
$End