User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

help with some scripting

Tue Nov 20, 2012 2:54 pm

I'm pretty rubbish at scripting but would really like to clean up one small irritant in my current PoN game.

I captured Massawa from the Ottomans in a war, have 100% MC, it even shows as an Italian colony but the harbour in the province remains Ottoman (& thus Massawa stays as Ottoman according to the F10 screen).

can anyone give me the syntax I can use to write a small event that will bounce ownership from the Ottomans to Italy? Or what I might need to adjust in the trn/save files?

its just I'd really like a concrete gain for 3 years of war ...

ta

Moriety
Major
Posts: 211
Joined: Thu Nov 20, 2008 1:23 pm
Location: London, UK

Tue Nov 20, 2012 4:25 pm

I have exactly the same problems in the region (as Russia), but not from war. Massawa is an S-P owned town, along with several structures. I also have a French town parked in the middle of Ethiopia. The British have a fleet parked in Djibouti despite there being no sea structures. Several provinces in the horn of Africa also have S-P structures. In Afghanistan the Brit's own the Khyber Pass town and MO. All three provinces are illegally owned by them, not me.

A script that you can run to check for illegally owned structures would be great.
"Whether it's the best of times or the worst of times, it's the only time you've got" Art Buchwald, U.S. Journalist and humourist

powloon1
Lieutenant
Posts: 122
Joined: Wed Oct 17, 2012 2:27 pm

Tue Nov 20, 2012 11:14 pm

There is a link on the paradox site where Sagji explains how to do something similar

Remove Add Structures

Basically it looks like you need to remove the structure and recreate it. I tried it with the problem in my game where Austria retained control of the Parma Iron mine and wheat farm after unification.

I used the 2 scripts below (which I added to the Italian unification event file)

Code: Select all

SelectFaction = $AUS
SelectRegion = $Parma

StartEvent = Austria returns iron mines to Italy|1|1|NULL|NULL|$Po|NULL
Actions
 
  SelectRegion = $Parma
  RemoveStructure = ByDefUID $Iron1;RANDOM;SINGLEFAC

  SelectFaction = $ITA
  SelectRegion = $Parma
  CreateStruc
  SetType = $Iron1
  SetName = Italian Feris
  Apply   
 
EndEvent

SelectFaction = $AUS
SelectRegion = $Parma

StartEvent = Austria returns cereal mines to Italy|1|1|NULL|NULL|$Po|NULL
Actions

  SelectRegion = $Parma
  RemoveStructure = ByDefUID $Cereals1;RANDOM;SINGLEFAC

  SelectFaction = $ITA
  SelectRegion = $Parma
  CreateStruc
  SetType = $Cereals1
  SetName = Parma Wheat
  Apply   
 
EndEvent



It seemed to work ok

User avatar
Kensai
Posts: 2712
Joined: Mon Sep 19, 2011 4:54 pm
Location: Freiburg, Germany

Thu Nov 22, 2012 9:05 pm

loki100,

Code: Select all

SelectFaction = $CMN
SelectRegion = $Massawa

StartEvent = Massawa Ownership Change|1|1|NULL|NULL|$Massawa|NULL
Actions
  SelectFaction = $ITA
  SelectRegion = $Massawa
  ChangeRgnOwner = TUR
EndEvent


Bear in mind this will give all Turkish assets of Massawa to Italy, including structures, loyalty and CP. Units will not be given though.
Care to unify Germany as Austria? Recreate the Holy Roman Empire of the 20th Century:
Großdeutschland Mod
Are you tough enough to impersonate the Shogun and defy the Westerners? Prove it:
Shogun Defiance Mod (completed AAR)

User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Thu Nov 22, 2012 9:16 pm

thank you both, I'll run it tomorrow ... then 3 years after conquest it will all be mine .... mine, my precious ...

User avatar
Jim-NC
Posts: 2981
Joined: Wed Feb 25, 2009 4:21 pm
Location: Near Region 209, North Carolina

Thu Nov 22, 2012 9:38 pm

Will you get a ring to go with it? And maybe a fiery mountain? :w00t:
Remember - The beatings will continue until morale improves.
[SIGPIC][/SIGPIC]

User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Fri Nov 23, 2012 8:57 am

Jim-NC wrote:Will you get a ring to go with it? And maybe a fiery mountain? :w00t:


well rather scarily, shortly after I captured it, Vesuvius blew up ....

User avatar
Jim-NC
Posts: 2981
Joined: Wed Feb 25, 2009 4:21 pm
Location: Near Region 209, North Carolina

Sat Nov 24, 2012 4:41 am

loki100 wrote:well rather scarily, shortly after I captured it, Vesuvius blew up ....


:rofl: mere coincidence I'm sure.
Remember - The beatings will continue until morale improves.

[SIGPIC][/SIGPIC]

czert2
Brigadier General
Posts: 427
Joined: Sun May 06, 2012 1:33 am

Sat Nov 24, 2012 12:27 pm

i did this event :

SelectFaction = $CMN
SelectRegion = $Sonla

StartEvent = Soula Ownership Change|1|1|NULL|NULL|$Sonla|NULL
Actions
SelectFaction = $RUS
SelectRegion = $Sonla
ChangeRgnOwner = FRA

EndEvent

SelectFaction = $CMN
SelectRegion = $Hanoi
StartEvent = Hanoi Ownership Change|1|1|NULL|NULL|$Hanoi|NULL
Actions
SelectFaction = $RUS
SelectRegion = $Hanoi
ChangeRgnOwner = FRA

EndEvent

SelectFaction = $CMN
SelectRegion = $Thanh Hoa
StartEvent = Thanh Hoa Ownership Change|1|1|NULL|NULL|$Thanh Hoa|NULL

SelectFaction = $RUS
SelectRegion = $Thanh Hoa
ChangeRgnOwner = FRA

EndEvent

it was meaned to fix problem france still controling regions after i have 100MC here and are my colonys. I named it xxx.sct and copied undes events folder and event dont fire, what i did wrong ?

User avatar
Jim-NC
Posts: 2981
Joined: Wed Feb 25, 2009 4:21 pm
Location: Near Region 209, North Carolina

Sat Nov 24, 2012 8:12 pm

Did you add the script name to the 1850 GC.sct? This the main controlling script, and any scripts you add need to be in there. It can be found in the events folder as well.
Remember - The beatings will continue until morale improves.

[SIGPIC][/SIGPIC]

czert2
Brigadier General
Posts: 427
Joined: Sun May 06, 2012 1:33 am

Sat Nov 24, 2012 9:16 pm

Hehehe, no :) . Have no idea it is needed here too, OTOH it is logical, since is here many files for many campaigns.

czert2
Brigadier General
Posts: 427
Joined: Sun May 06, 2012 1:33 am

Sun Nov 25, 2012 7:39 pm

After adding them to corect file, only hanoi changed ownership, ohers two not, and yes i notited and fixed typo, it was sonla instead of soula :) .

User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Sun Nov 25, 2012 9:48 pm

czert2 wrote:After adding them to corect file, only hanoi changed ownership, ohers two not, and yes i notited and fixed typo, it was sonla instead of soula :) .


well looking at your syntax, the Hanoi event is the only one with no gaps, not got a clue if that is relevant, but its the only obvious difference between them?

Moriety
Major
Posts: 211
Joined: Thu Nov 20, 2008 1:23 pm
Location: London, UK

Mon Nov 26, 2012 12:35 pm

Kensai wrote:loki100,

Code: Select all

SelectFaction = $CMN
SelectRegion = $Massawa

StartEvent = Massawa Ownership Change|1|1|NULL|NULL|$Massawa|NULL
Actions
  SelectFaction = $ITA
  SelectRegion = $Massawa
  ChangeRgnOwner = TUR
EndEvent


Bear in mind this will give all Turkish assets of Massawa to Italy, including structures, loyalty and CP. Units will not be given though.


Thank you Kensai!!
I managed to change the three stuck provinces by putting this script into a random Russian scenario file (Politics I think).
I'm so glad the cities involved have changed ownership.....at last! :)
"Whether it's the best of times or the worst of times, it's the only time you've got" Art Buchwald, U.S. Journalist and humourist

czert2
Brigadier General
Posts: 427
Joined: Sun May 06, 2012 1:33 am

Tue Nov 27, 2012 4:44 pm

loki100 wrote:well looking at your syntax, the Hanoi event is the only one with no gaps, not got a clue if that is relevant, but its the only obvious difference between them?

after more looking at it i found that i lacked Actions between start event and select faction,after adding it worked.

User avatar
Sir Garnet
Posts: 935
Joined: Sat Jul 16, 2011 8:23 pm

Fri Nov 30, 2012 12:39 pm

I have the same problem in the Congo with a Belgian flag flying over my colony and blocking colonial actions. I was looking for something that changes the flag without changing their structures (which they may be disinclined to agree to though I think I am entitled to the flag).

Return to “Pride of Nations”

Who is online

Users browsing this forum: No registered users and 11 guests