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

SelectSubUnits and AlterCuSubUnit: The super meta polymorphic do it all commands

Wed Nov 07, 2007 3:03 pm

These commands can do various things on the currently selected current sub-unit, or can use the current list of selected sub-units for wider effect

SelectSubUnits

ex1: SelectSubUnits Area $South_West|Models $mdl_USA_Cav1 $mdl_USA_Cav2

Region <RgnUID> NEW
Pick all elts of a given region (unless another criteria is added)

Area <AreaUID> NEW
Pick all elts of a given area (unless another criteria is added)

Families <Fam1> <Fam2> ..
Will filter the elts which are not of the specified families.

Models <Mdl1> <Mdl2> ..
Will filter the elts which are not of the specified models.

FactionTags <Tag1> <Tag2>
NEW
Will filter the elts which are not of the specified factiontag.

Domains <_domLand> <_domNav> <_domAir> NEW
Will filter the elts which are not of the specified Domain (VGN+ only).
[color=Black]Selectors: All elts are added to the list cuSUList, the last elt is added to cuSubUnit.

AlterCuSubUnit
[/color]

ApplyToList
All changes are done on the current list of selected elts ([color=Black]cuSUList)[/color], not only on the current selected elt ([color=Black]cuSubUnit).

[/color]Probability
A % roll is done before applying any effect on the elt.

Model or ModelUID
[color=Black]Will alter the elt to the specified model, or to his PrimUpg path or to his SecUpg path. A new name can be given in this case.

ModelUID NewUID/PrimUpg/SecUpg [NewName]

ex2: ApplyToList|probability 35|Model $mdl_USA_Cav2|ChgCohesion 5

ex2: AlterCuSubUnit
[/color][color=Black]probability 90|[/color][color=Black]Model $mdl_USA_Patterson3 Retired
The currently selected elt is converted to Patterson3 and is now named 'Retired'.

ChgSeniority
Change the seniority of the elt, if a leader, by this amount. (positive is bad)

[/color][color=Black]ChgCohesion
Change the cohesion of the elt by this amount.

[/color][color=Black]ChgHealth
Change the health of the elt by this amount. Won't kill the elt.

ChgXPLevel
Change the experience level
[/color][color=Black] of the elt by this amount (ie 1 means +1 level gained)[/color]
[color=Black]
[/color]Kill NEW
Kill the elt.

Attempts NEW
The number of check (passed or failed if probability is under 100) is limited to this number of attempts.

RerollActivation NEW
Reroll the activation dice of the elt, if a leader and not active.

Others examples:
FifthCoalition1809 event, partial withdrawal from Spain:

Picking all french line elements in Spain, and then remove 15 at most (75% chance for each attempt though):
SelectSubUnits Area $Theater_Spanish_Peninsula|FactionTags FRA|Families $famLine
AlterCuSubUnit ApplytoList|Kill|Attempts 15|Probability 75
Image


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

User avatar
aryaman
Posts: 738
Joined: Thu May 18, 2006 6:19 pm

Fri Jun 06, 2008 6:49 pm

Would be that a valid command to kill all the Militia units in Capua?

SelectSubUnits Area $Region Capua|Families $famMilitia
AlterCubSubUnit ApplytoList|Kill

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

Sat Jun 07, 2008 7:31 am

SelectSubUnits Region $Capua|Families $famMilitia
AlterCubSubUnit ApplytoList|Kill

Note that even passing militia can be killed though.
Image


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

User avatar
PhilThib
Posts: 13705
Joined: Tue Oct 18, 2005 5:21 pm
Location: Meylan (France)

Sat Jun 07, 2008 8:39 am

Including Carthaginians ones :8o: ... there should be some indication to affect the militias of only one selected nation or faction IMHO :indien:
Image

User avatar
aryaman
Posts: 738
Joined: Thu May 18, 2006 6:19 pm

Sat Jun 07, 2008 9:07 am

Pocus wrote:SelectSubUnits Region $Capua|Families $famMilitia
AlterCubSubUnit ApplytoList|Kill

Note that even passing militia can be killed though.


No problem there, Miltia models are inmobile (move ratio 0) so no passing militia, the only militia that could be in the region s the garrison of Capua.

So, it seems like a good solution, I will implement that command in the setup this weekend

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

Sun Jun 08, 2008 9:02 am

you can restrict the selection further anyway, just add FactionTags ROM ITA for example, to restrict to Roman or Italian militias.
Image


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

User avatar
lodilefty
Posts: 7613
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

AlterCuSubUnit new params

Tue Aug 11, 2009 4:58 pm

Effective in your "next" new .exe version [WIA, NCP, AACW, RoP, VGN] there are additional commands to use in the AlterCuSubUnit strings:

RerollActivation [not new, really :o ]
[color="Red"]LeaderActive
LeaderUnactive[/color]



I've tested successfully with WIA and it works nicely:
SelectSubUnits = Models $ldr_GBR_WHowe $ldr_GBR_Hclinton2 $ldr_GBR_TGage $ldr_GBR_Hclinton $ldr_GBR_Grant $ldr_GBR_Pigot $ldr_GBR_Smith $ldr_GBR_Tryon
AlterCuSubUnit = ApplytoList;[color="red"]LeaderActive[/color]


Results in:
Line 15520: SelectSubUnits 1001862 Sir William Howe added, List Count now at: 1
Line 15520: SelectSubUnits 1001864 Sir Henry Clinton added, List Count now at: 2
Line 15520: SelectSubUnits 1001866 James Grant added, List Count now at: 3
Line 15520: SelectSubUnits 1001868 Sir Robert Pigott added, List Count now at: 4
Line 15520: SelectSubUnits 1001870 Francis Smith added, List Count now at: 5
Line 15520: SelectSubUnits 1001872 William Tryon added, List Count now at: 6
Line 15520: SelectSubUnits finished Regions Selected: 0 SubUnits Selected: 6
Line 15521: AlterCuSubUnit 1001872 William Tryon is now activated: 1
Line 15521: AlterCuSubUnit 1001866 James Grant is now activated: 1
Line 15521: AlterCuSubUnit 1001864 Sir Henry Clinton is now activated: 1
Line 15521: AlterCuSubUnit 1001870 Francis Smith is now activated: 1
Line 15521: AlterCuSubUnit 1001862 Sir William Howe is now activated: 1
Line 15521: AlterCuSubUnit 1001868 Sir Robert Pigott is now activated: 1
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]
[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]

[CENTER]Rules for new members[/CENTER]
[CENTER]Forum Rules[/CENTER]

[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

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

Mon Jan 04, 2010 5:21 pm

A new parameter to AlterCuSubUnits:

SkipAttribs

The purpose is to have some elements, within a stack, able to 'protect' the the others selected elements from the effects of the command.

An example will clarify things. We have selected on the map all militia of a faction, and want to reduce by 30 their cohesion, unless in the stack they are in, there is at least one element which has either the *HighMorale* or *IronWill* attribute.

Note that the elements bearing the attributes can be leaders or combat/supports elements.
Attributes are to be added in the Attributes column of the models bearing it. Generally, the naming convention have them listed between 2 *. For example *HighMorale*, *Guard*, *EliteSoldier* etc.

The parameter will also need a 'protection' probability. So in the end, here is a valid syntax:

AlterCuSubUnits = ApplyToList|ChgCohesion -30|SkipAttribs 60 *HighMorale* *IronWill*

Note that the attributes are cumulative in their protection mechanism, i.e if a stack have at least one element each which has either *HighMorale* or *IronWill*, then the protection probability will be 84% (40% of 40% of not being protected).

This protection probability is checked for each element which should undergo the effect(s) of the command.
Image


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

Return to “VIP Modding &amp; AGE Engine Novelties forum”

Who is online

Users browsing this forum: No registered users and 3 guests