Scripts location

Moderator: AlvaroSousa

Post Reply
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

Scripts location

Post 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.
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post 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
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post 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.
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
stjeand
Posts: 2702
Joined: Sun Jan 10, 2021 1:14 pm
Location: Aurora, NC

RE: Scripts location

Post 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.
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post 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.
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
AlvaroSousa
Posts: 12124
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: Scripts location

Post by AlvaroSousa »

I forgot to set event flags for those. Thanks.
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post 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
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post 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?
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post by ncc1701e »

Oh I find this option:

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

I will try with notepad a simple event.
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
stjeand
Posts: 2702
Joined: Sun Jan 10, 2021 1:14 pm
Location: Aurora, NC

RE: Scripts location

Post by stjeand »

FYI...copy the event file to the new scenario directory...then Load All Scripts.

That will load the new event file.
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post 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
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
ncc1701e
Posts: 10725
Joined: Tue Oct 29, 2013 7:50 pm
Location: Utopia Planitia Fleet Yards

RE: Scripts location

Post 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.
Chancellor Gorkon to Captain James T. Kirk:
You don't trust me, do you? I don't blame you. If there is to be a brave new world, our generation is going to have the hardest time living in it.
User avatar
AlvaroSousa
Posts: 12124
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: Scripts location

Post 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
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
Post Reply

Return to “MODS and Scenarios”