Sherman
Corporal
Posts: 44
Joined: Sat Feb 02, 2013 3:55 am

How do I increase the number of military police units

Sat Mar 16, 2013 3:20 pm

I'm playing the US and it seems odd to me that I am am limited to the same number of police units as I had playing S-P and Japan.

If I wanted to be really neat I could have events over time that would increase the number.

But I know zero about scripting and such.

Sherman
Corporal
Posts: 44
Joined: Sat Feb 02, 2013 3:55 am

Thu Mar 21, 2013 9:08 pm

anyone?

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

Thu Mar 21, 2013 9:49 pm

There is a command that will change the number of units you can recruit. Unfortunately, I don't know it. I can try to do some research on it. Kensai is much better about writing scripts than I am.
Remember - The beatings will continue until morale improves.
[SIGPIC][/SIGPIC]

Sherman
Corporal
Posts: 44
Joined: Sat Feb 02, 2013 3:55 am

Thu Mar 21, 2013 11:35 pm

well, after much poking around in the wacky wiki, I found: ChangeUnitPool = $uni_USA_Inf0; 5

But I still haven't been able to find where I would put the script to run it, what other syntax would be needed to make it a complete script, what particular string to define military police, so on, and so forth.

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

Thu Mar 21, 2013 11:45 pm

Sherman wrote:well, after much poking around in the wacky wiki, I found: ChangeUnitPool = $uni_USA_Inf0; 5

But I still haven't been able to find where I would put the script to run it, what other syntax would be needed to make it a complete script, what particular string to define military police, so on, and so forth.


this is a script I wrote to give Italy a full range of colonial options:

SelectFaction = $ITA
StartEvent = Increase_Outposts|1|1|NULL|NULL|NULL|NULL

Actions

ChangeStrucPool = $Outpost;85
ChangeStrucPool = $ChiefBribing;45
ChangeStrucPool = $ChiefTreaty;56
ChangeStrucPool = $ChiefTerritory;40
ChangeStrucPool = $Missionary;200
ChangeStrucPool = $Merchants;200
ChangeStrucPool = $Tradepost;200
ChangeStrucPool = $Road;200
ChangeStrucPool = $Telegraph;200
ChangeStrucPool = $School;200
ChangeStrucPool = $Vaccination;50
ChangeStrucPool = $Sanitation;50
ChangeStrucPool = $Immigrants;100
ChangeStrucPool = $Society;50
ChangeStrucPool = $Protectorate;50
ChangeStrucPool = $Colony;50
ChangeStrucPool = $Stake;30

EndEvent


So all you need to do is to replace the core with your desired change, obv make the faction USA, give it a name that makes sense. Pop it into ons of the US event files, run the forceevent routine and off you go. I'd delete the event after it fires as otherwise it is just another thing the game engine checks on the turn processing routine.

for the rest of the info poke around in the Gamedata directory, you'll find the code for USA MP units there
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

Sherman
Corporal
Posts: 44
Joined: Sat Feb 02, 2013 3:55 am

Fri Mar 22, 2013 12:27 am

Ok, here's how I translate what I get from your post:

SelectFaction = $USA
StartEvent = ?Any_Name_I_like|1|1|NULL|NULL|NULL|NULL?

ChangeUnitPool = $uni_USA_?Pol?0; 20

EndEvent

How does one run the force event routine? Is there a separate manual that describes this? Or, where on the wacky wiki would I even begin to look for such information? And there are rather a lot of files in the game data directory to poke around in. I have found three files looking like:

UID = 1162
Alias = uni_USA_Pol_Pol1850
NationTag = USA
Name = Military Police Rgt
ShortName = Police Rgt
Text = $uni_txt_CMN_Police
Color = $colUSAMain
ModelType0 = $mdl_USA_Pol1850|1
TechAutoUpg = $uni_USA_Pol_Pol1870
FamilyType0 = $famService|1
CmdCost = 1
Pillage = 0
BuildRule = $recCity
BuildWeight = 0
Area = $Recruit_USA
CustomNames = 1st Veterans Reserve Corps|2nd Veterans Reserve Corps|3rd Veterans Reserve Corps|4th Veterans Reserve Corps|5th Veterans Reserve Corps|6th Veterans Reserve Corps|7th Veterans Reserve Corps|8th Veterans Reserve Corps|9th Veterans Reserve Corps|10th Veterans Reserve Corps|11th Veterans Reserve Corps|12th Veterans Reserve Corps|13th Veterans Reserve Corps|14th Veterans Reserve Corps|15th Veterans Reserve Corps|16th Veterans Reserve Corps|17th Veterans Reserve Corps|18th Veterans Reserve Corps|19th Veterans Reserve Corps|20th Veterans Reserve Corps

Which suggests that I the US is supposed to have 20 mp units to begin with.





loki100 wrote:this is a script I wrote to give Italy a full range of colonial options:



So all you need to do is to replace the core with your desired change, obv make the faction USA, give it a name that makes sense. Pop it into ons of the US event files, run the forceevent routine and off you go. I'd delete the event after it fires as otherwise it is just another thing the game engine checks on the turn processing routine.

for the rest of the info poke around in the Gamedata directory, you'll find the code for USA MP units there

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

Fri Mar 22, 2013 1:42 am

Here's a command from another game. This removes 4 corps from the Austrians. You would substitute this.
ChangeUnitPool = $uni_AUS_Inf_1870_Corps;-4
ChangeUnitPool = $uni_AHU_Inf_1870_Corps;-4

With the start event being a |1|1|, you should have a location in the 3rd NULL field, like $Washington, so it would read |1|1|NULL|NULL|$Washington|NULL

Now which type do you want to give yourself? 1850 model or 1870 model? If 1850, use $uni_USA_Pol_Pol1850
After the date for the type you want, give the number you want to add (lets say 5). Thus your text would read ChangeUnitPool = $uni_USA_Pol_Pol1850;5

After you determine your script, you need to add it somewhere. I would add the whole thing to the end of the of the USA scripts. You can find this folder in the Pride of Nations\VGN\Events\USA Events.sct
I would add this after the last line that says End Event (at the very bottom).

The next time you process a turn, this should give you the extra troops.
Remember - The beatings will continue until morale improves.

[SIGPIC][/SIGPIC]

Sherman
Corporal
Posts: 44
Joined: Sat Feb 02, 2013 3:55 am

Fri Mar 22, 2013 5:08 am

Thanks for your help Jim.

This is what I typed:

EndEvent


SelectFaction = $USA

StartEvent = MP_Addition|1|1|NULL|NULL|$Washington|NULL
ChangeUnitPool = $uni_USA_Pol_Pol1850:15

EndEvent


This is the error thrown:

9:00:55 PM [Critical ] TScriptEngine.Parse Exception caught: Violation d'accès à l'adresse 005E042D dans le module 'PON.exe'. Lecture de l'adresse 0000000C while parsing line 27211 : EndEvent

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

Fri Mar 22, 2013 8:41 am

at a very quick glance you need the line 'Actions' between start event and the change info
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

Sherman
Corporal
Posts: 44
Joined: Sat Feb 02, 2013 3:55 am

Fri Mar 22, 2013 3:29 pm

That and changing : to ; mostly did the trick.

It seemed to remember that it had fired in a previous turn, even though it didn't work. So I had to change the name to Add_Cops.

Thank you.

loki100 wrote:at a very quick glance you need the line 'Actions' between start event and the change info

Sherman
Corporal
Posts: 44
Joined: Sat Feb 02, 2013 3:55 am

Fri Mar 22, 2013 5:25 pm

BTW, for future reference, which file would I edit to control the number of all units from the get-go?

And thanks again for the help. Much appreciated.

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

Fri Mar 22, 2013 5:50 pm

Sherman wrote:That and changing : to ; mostly did the trick.

It seemed to remember that it had fired in a previous turn, even though it didn't work. So I had to change the name to Add_Cops.

Thank you.

The event was designed to fire once. It happened that the 1st time it fired, it got an error, but the engine counted it as having fired once. You could have changed the first 1 to a 2 in the start event line (it would have looked like "MP_Addition|2|1|NULL|NULL|$Washington|NULL"), or changed the name (which is what you did).
Remember - The beatings will continue until morale improves.

[SIGPIC][/SIGPIC]

Return to “Pride of Nations”

Who is online

Users browsing this forum: No registered users and 9 guests