Boernes
Sergeant
Posts: 74
Joined: Tue Feb 28, 2012 11:18 am
Location: Central Europe

changing 'national territory' per script

Thu Jul 19, 2012 3:46 pm

I could need some help with a custom script. I want to create a custom script that changes Siam from being a sovereign nation (101% CP for Siam in every region) into a colony of someone else. I know the command for it, and I'm sure I use it the right way, because it works everywhere else (like exchange of african colonies per script etc). The command is the following:

SelectFaction = $SIA
SetColStatusArea = $Colony_Siam;$colInfluenced


Where I have the choice between: $colUnknown, $colWild, $colUnclaimed, $colInfluenced, $colProtectorate, $colColony, $colVassal, $colDominion, $colOtherNonNat, $colNational
I don't think defining a region is necessary, I tried with and without and it doesnt seem to make a difference.

The problem is that it doesnt work properly. When I tell the game to change Siams colonial status to anything else than national, it refuses to do so. It adds the status of the new owner, but Siams status supercedes it. The script log states that it didnt encounter any problems, thats what leaves me wondering.
Line 761: SelectFaction, selected: Siam
Line 762: SelectRegion, 1127 Bangkok selected (simple mode)
Line 763: SetColonialStatusArea 686 Siam Colonial status set to Influenced territory
Line 764: SelectFaction, selected: Prussia
Line 765: SelectRegion, 1127 Bangkok selected (simple mode)
Line 766: SetColonialStatusArea 686 Siam Colonial status set to Protectorate



When I try to lower Siams CP to anything below 101% (either removing 101 all at once, or at least 20) the log tells me it cant change the CP because it is already at 101%, and I should change the status of the colony/region instead (duh!)

Line 750: SelectRegion, 1127 Bangkok selected (simple mode)
Line 751: [Warning] ChgColonialPen Bangkok no change will be done, as already at 101. Change status instead



At last, just annexing Siam won't help much, it just passes the problem to the new owner, and Siams 101% CP in the capital region even remain. Also I don't want it to be annexed, I wan't it as colony so I can use the according cards

User avatar
Pocus
Posts: 25660
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Fri Jul 20, 2012 9:41 am

Hi,

Right, the code has a loophole. When you set colonial status, lowering it, the code assumes the colonial pen is the max between the current one and the minimum required for the new status... So here it would remains at 101 in fact.

I need to check that, wait for next RC (release candidate) please.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

Boernes
Sergeant
Posts: 74
Joined: Tue Feb 28, 2012 11:18 am
Location: Central Europe

Fri Jul 20, 2012 3:56 pm

Thanks for the reply, I will wait for the RC then. Good to hear it's possible in theory, and being worked on :)

User avatar
Pocus
Posts: 25660
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Jul 23, 2012 10:25 am

I believe another RC will make it rather soon also.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

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

Tue Jul 24, 2012 11:48 am

On a somewhat realted topic -

(1) If part of a Protectorate or Colony is ceded in peace, does the new owner have the same status level etc? Is the disability that only the owner of the capital region can play a card to create a Colony from a Protectorate?

(2) It appears that regions can be shifted from one adjacent colonial area to another (e.g., in a peace treaty) by modding the area definitions in the files to link the regions to the new area. This would be in Africa. Any obvious red flags to this approach?

Boernes
Sergeant
Posts: 74
Joined: Tue Feb 28, 2012 11:18 am
Location: Central Europe

Sat Jul 28, 2012 8:06 pm

Has there been a code-change in the latest RC3?

User avatar
Pocus
Posts: 25660
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Jul 30, 2012 9:16 am

Boernes wrote:Has there been a code-change in the latest RC3?


Yes it should work now.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Pocus
Posts: 25660
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Jul 30, 2012 9:17 am

Sir Garnet wrote:On a somewhat realted topic -

(1) If part of a Protectorate or Colony is ceded in peace, does the new owner have the same status level etc? Is the disability that only the owner of the capital region can play a card to create a Colony from a Protectorate?

(2) It appears that regions can be shifted from one adjacent colonial area to another (e.g., in a peace treaty) by modding the area definitions in the files to link the regions to the new area. This would be in Africa. Any obvious red flags to this approach?


(1) yes. I don't understand the second part, sorry.

(2) should be safe
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

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

Wed Aug 01, 2012 5:46 am

Pocus wrote:(1) yes. I don't understand the second part, sorry.


If part of a protectorate is ceded, and then the owner of most of the protectorate area plays a Colony card in the colonial capital to make the rest of it a Colony - will the ceded area remain a protectorate, become a colony of its other owner, or revert to the owner of the colonial capital (which is the only place a Colony card may be played).

User avatar
Christophe.Barot
Posts: 1138
Joined: Fri Jan 26, 2007 10:55 pm
Location: Paris (France)

Thu Sep 05, 2013 4:25 pm

Pocus wrote:Yes it should work now.


tried that in Egypt, didn't work, but ... there is a Colony_Siam, or Morocco and not a Colony_Egypt (nor Persia, I guess ? , will check)

I'll tinker with database colony and will try the command again

thanks anyway Pocus - hope it works :thumbsup:
[color="#FF0000"]- (ordnance) Your Lordship, sorry to awake you, but The french are at our door !

- Alarm, alarm, how did you let this happen and not awake me ! repel them, counterattack at once !

- err, your Lordship, ahem... French are our allies, Marshal de St Arnaud is expected to attend to a conference with you !

- ahem, well, .... very well ..let them in !

(charge of the light brigade movie)
[/color]

User avatar
Christophe.Barot
Posts: 1138
Joined: Fri Jan 26, 2007 10:55 pm
Location: Paris (France)

Thu Sep 05, 2013 4:33 pm

I have an example of how the system works with split colonies

in a peace treaty China ceded part of Sin kiang , including capital , to me (was too happy to have peace after yearS of unending war without even being able to propose to China - real vast to occupy, believe me - even if it was an awesome training field for Russian generals - Potoliko ended with 5-6-6 and 4-5-5 became rather common, for utter joy of Ottoman and other Serb-hostile Austrians) - when a revolt occurs in one of their remaining Sinkiang provinces, and I take area back from rebels, it belongs to me, else it remains theirs and I can't move there - first to crush revolters annex

Hope it helps you to figure out system process
[color="#FF0000"]- (ordnance) Your Lordship, sorry to awake you, but The french are at our door !

- Alarm, alarm, how did you let this happen and not awake me ! repel them, counterattack at once !

- err, your Lordship, ahem... French are our allies, Marshal de St Arnaud is expected to attend to a conference with you !

- ahem, well, .... very well ..let them in !

(charge of the light brigade movie)
[/color]

Return to “PON Mods”

Who is online

Users browsing this forum: No registered users and 7 guests