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

some scripting help needed

Wed Dec 04, 2013 11:52 am

I'm trying to do two very simple things and can't get the scripts to work, so thought I'd ask ...

First is trying to remove a large British and Belgian armies that have got stuck in the middle of Africa. The British one is the only significant army they have left.

So here's what I've written:

SelectFaction = $CMN
StartEvent = locations and loyalty|1|1|Null|Null|Null|NULL

Actions
SelectSubUnits = Region $Dioulasso;FactionTags GBR
AlterCuSubUnit = ApplyToList;Move $Anglia

Actions
SelectSubUnits = Region $Inhambane;FactionTags BEL
AlterCuSubUnit = ApplyToList;Move $Vlaandern

EndEvent


In the game log it shows as firing but neither force actually moves.

Second is to try and give the British a navy (and some extra units), once I have this right, I'm going to script in navies for Germany, France and Austria. It seems as if so far the AI hasn't built a single ship and the lack of transports can't be helping the other colonial powers (may explain why a lot of the French army has remained stuck in Africa). So its a long script, but I think pretty simple (and based on scripts in the existing event files):

SelectFaction = $CMN
StartEvent = evt_nam_rebuild_UK_navy|1|1|NULL|NULL|NULL|NULL

Conditions
SelectRegion = $Sussex

Actions

SelectFaction = $GBR
CreateGroup
Posture = $Defensive
SetKind = $Nav
Entranch = 0
FixType = 0
SetName = Home Fleet
Apply
CreateUnit
SetType = $uni_GBR_BBO5
NumCreate = 4
SUFlavorName = HMS Devastation|HMS Thunderer|HMS Rupert|HMS Dreadnought|
SetLevel = 4
SetName = Home Fleet
Apply

SelectFaction = $GBR
CreateGroup
Posture = $Defensive
SetKind = $Nav
Entranch = 0
FixType = 0
SetName = Home Fleet
Apply
CreateUnit
SetType = $uni_GBR_BCO1
NumCreate = 2
SUFlavorName = HMS Devastation|HMS Thunderer|HMS Rupert|HMS Dreadnought|
SetLevel = 4
SetName = Home Fleet
Apply

SelectFaction = $GBR
CreateGroup
Posture = $Defensive
SetKind = $Nav
Entranch = 0
FixType = 0
SetName = Home Fleet
Apply
CreateUnit
SetType = $uni_GBR_DD02
NumCreate = 6
SUFlavorName = HMS Devastation|HMS Thunderer|HMS Rupert|HMS Dreadnought|
SetLevel = 4
SetName = Home Fleet
Apply

SelectFaction = $GBR
CreateGroup
Posture = $Defensive
SetKind = $Nav
Entranch = 0
FixType = 0
SetName = Transports
Apply
CreateUnit
SetType = $uni_GBR_TR04
NumCreate = 10
SUFlavorName = British Queen|President|Queen of Scotland|Britannia|
SetLevel = 4
SetName = Transports
Apply

SelectFaction = $GBR
SelectRegion = $Anglia
CreateGroup
Posture = $Defensive
SetKind = $Land
Entranch = 0
InCS = 0
FixType = 0
SetName = Home Guard
Apply
CreateUnit
SetType = $uni_GBR_Inf-1910_Corps
NumCreate = 4
SetName = Home Guard
Apply
CreateUnit
SetType = $uni_GBR_Cav-1890_Corps
NumCreate = 2
SetName = Home Guard
Apply
CreateUnit
SetType = $uni_GBR_Sup_Sup1
SetLevel = 4
SetName = Supply
Apply

EndEvent


I'm sure the error is trivial, but I can't work it out, despite a week of testing this ...
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

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

Wed Dec 04, 2013 2:04 pm

IF this can help (sorry, presently sneaking a few minutes, not having time toroughly reviewing code) :

a) look at code of building Japanese navy
I inspired from PhilippeS/Malacher/-Thibaut (which one wrote the script) code of building merchant ships event and the RJW scenario (reinforcement + Baltic fleet appearing), then adapted by looking for correct alias in the excel file corresponding - then wrote my script - it worked (has been tested, only thing is I had to remove date condition (why my 1904 Japanese buildings don't appear in 1878, damn ! ;) )

as I am certainly less good than you, must be trivial, try to compare line to line
here :
http://www.ageod-forum.com/showthread.php?33528-PON2-subforum-improve-Events-reviewing-far-east-events&p=298775&viewfull=1#post298775

by comparing them (I'm certainly no better than you) you may detect differences

b) removal of armies you can of course find in balkan event san stefano/berlin congress events

c) killing units in russo japanese war events (colonial events, japan kills a lot of russian far east ships in surprise attacks then russian units mutiny, ditto)

all of this you know of course

for the events of removal, I'd try to selct nationality faction, not sure it helps, but spontaneously I'd try a british event to remove British units and so on or at least a SelectFaction = $[color="#FF0000"]GBR[/color] for the brits and so on - may be has no effect, but can't harm imho

and try one nationality apiece, with small bricks it's easier to see what fails

ditto did you set in full debug and looked the post action event scripts ?, thy report the test of conditions, can tell you something

comparing :

[color="#FF0000"]CreateGroup
Posture = $Defensive
SetKind = $Nav
Entranch = 0
FixType = 6
Apply
CreateUnit
SetType = $uni_JAP_Tra3
SetLevel = 4
Apply
SetBuildFlag = 1
SetHealth = 100
SetCohesion = 100[/color]

yours :

SelectFaction = $GBR
//ok did that for japan too
[color="#40E0D0"]CreateGroup
Posture = $Defensive
SetKind = $Nav
Entranch = 0
[color="#FF0000"]FixType = 0[/color] [color="#FFFF00"]//I guess aliases may cause trouble, look at what types they fixed, may be an alias problem I don't master[/color]
SetName = Home Fleet
Apply
CreateUnit
SetType = $uni_GBR_BBO5
[color="#FF0000"]NumCreate = 4[/color][color="#FFFF00"]//I dont have this[/color]
SUFlavorName = HMS Devastation|HMS Thunderer|HMS Rupert|HMS Dreadnought|
SetLevel = 4
SetName = Home Fleet
Apply[/color]
[color="#FFFF00"]//not those following ?
SetBuildFlag = 1
SetHealth = 100
SetCohesion = 100
[/color]
fort the last one, I guess I inspired from Baltic fleet event, cohesion at least must be lower I guess when you build fleets normally in port

I see some writing differences, could be all that - best I think is to copy paste the exact syntax and orders of Philippe's events (I diispensed of flavour names, I got standard ones, fine for me)

I suggest you look that way - of course check builds are not too early compared to available technologies but I guess you did

you build fleets in your arsenals or "from scratch at sea" like Rdjevensky's fleet before Tsushima event ? arsenals may help ? perhaps , but guess you want to rapatriate armies before they starve ? how did they get there at fiorst (saw that too, troubling, huge armies in africa, british, german when i don't play them, Americans !!! yikes, what are US doing in Africa (I know they have a treaty and Brits feed them but still, seriously folks ?) ditto for British in Indochina ! in mass ! twice ! not Burma or even Siam, Indochina ! in my old Russian and new german game ! parameters of theater/area - priorities need a serious correction I guess

I intent to create naval race events at my turning points (US+german versus British) as i don't see AI modernizing or even building fleets (problem of threat perception perhaps, parameters to set differently ? or system of not upgrading fleet keeps her at an obsolete level ..), will tell you if it works (presently am working on Egypt and Persia colonial events, Fashoda, more reactive balakan situation, improving coordination in Crimea war, other turning points still in file, and we need a thorough expertise of how to streamline Italian unity - then make perhaps eents and turning points a bit more flexible (they should happen at all, usually, soon or late, then we have to condition them to precise events, as it is AI germany did not form in my russian game, France was dead meat for risorgimento, and Russia is too exhausted to even think fighting Turks in 1877)

[ATTACH]25878[/ATTACH]

I'm going to script in navies for Germany, France and Austria. It seems as if so far the AI hasn't built a single ship and the lack of transports can't be helping the other colonial powers (quote)

I absolutely confirm that - hence my japanese shipbuilding program which will be followed by a german- british conditional arms race by AI - turnings points, and a mahan event where "manifest destiny" will be backed by some guns to enforce Roosevelt corollary as well as Monroe doctrine (US was third navy in the world in 1914, outppowered only by Britain's and almost at par with Germany's (both missed war by a small margin in the Philipines sea)

what's the point having gunboat diplomacy without big guns
Attachments
HMS ocean 1899.jpeg
[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
loki100
AGEod Guard of Honor
Posts: 2374
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Wed Dec 04, 2013 7:48 pm

thank you

I hadn't thought of looking at the Russo-Japanese war as a source of base scripts but it of course makes sense that the Russian Fleet is created in scenario. I'll see if I can get it to work and then post the results as basic scripts for others to amend

R
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

User avatar
Bohémond
Posts: 2613
Joined: Wed May 14, 2008 8:47 pm

Thu Dec 05, 2013 3:32 am

For Removal Event, you can try ;

SelectFaction = $CMN
StartEvent = locations and loyalty|1|1|Null|Null|Null|NULL

Actions
SelectFaction = $GBR
SelectSubUnits = Region $Dioulasso;FactionTags GBR
AlterCuSubUnit = ApplyToList;Move $Anglia

SelectFaction = $BEL
SelectSubUnits = Region $Inhambane;FactionTags BEL
AlterCuSubUnit = ApplyToList;Move $Vlaandern

EndEvent

Let us know if it works

Regards
Marco, perché vai così forte in salita?» «Per abbreviare la mia agonia.

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

Thu Dec 05, 2013 4:34 pm

thank you that was indeed the secret words I was overlooking - the second 'select faction'. I've added a working version to my little thread with a collection of scripts that people can use/amend/
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

Return to “Pride of Nations”

Who is online

Users browsing this forum: No registered users and 4 guests