Due to a sudden burst in spammer activity, account creation has been temporarily disabled. Sorry for the inconvenience to any new potential contributors.

AddGarrison

From AGEWiki

Jump to: navigation, search

AddGarrison

Syntax  

AddGarrison = AreaUID ; StrucTypeUID ; UnitDefUID ; ChancePerCheck ;
               Placeholder1 ; Placeholder2 ; Placeholder3 ; Placeholder4 ;

Description

Automatically adds a garrison for the selected faction, using the unit definition for a given area and structure type.

See also ClearGarrisons

See Spreadsheet of examples

This commands work in two modes: Simple and Advanced.

Example  

AddGarrison = $New_England ; -1 ; $uni_GBR_Gar1; 50; 25; x; x; x; x

In Theater New England, use uni_GBR_Gar1 for autogarrison in all structures that qualify. Each turn that qualifying requirements are met there is a 50% chance per available replacement that a garrison will appear (Simple Mode). If in Advanced Mode, a test must instead be passed using the structure level (ChancePerCheck time level).

Qualifying Structures 
To qualify as an important site: a Fort, a Depot, a City of level at least equals
to half the maximum level possible for the game (Simple Mode only).

In advanced mode, a structure qualifies if the ChancePerCheck roll is passed.

See the article on AutoGarrison for further details.

Requirement to gain Garrison (Simple Mode only) 
The Garrison can appear if a Qualifying Structure exists, and: 
a) Has no others units of the garrison type.
b) Has a garrison type defined by this script command
c) Has at least 75% military control
d) Is not besieged
e) Has at least one regular infantry (to prevent cavalry raids to establish garrisons) 
f) Has at least 100 supply points (if under the rule rulAdvancedSupply, 
   BOA and WIA don't use this criteria)
Procedure to add the Garrison
If the garrison can appear, a % roll is made by multiplying the number of replacements in the
pool (of the family of the first element of the garrison unit) times
ChancePerRPL. If the roll is ok, a new unit appears in the structure and one replacement is
deducted from the pool. Note that garrisons units with several elements will be created with
only one element, but will get others by the standard replacement rule, so in effect you can
'grow' multi-elements units on several turns. 
Implementation ideas:
a) at the most basic level, you will use one definition per nation: The area would be the map,
strucKind at -1 and every structure to be garrisoned would get the same kind of garrison
(a militia eg.) 
b) more advanced, you specify several areas. For NCP Wurtemberg garrisons in WUR for example,
or Kentucky Militia in KY, etc.
c) The 'deluxe' scripting would be to change the garrison for the 3 structures. For example a
conscript unit for cities, a single militia for depot and for forts, a unit made of 2 reserve
line regiments and one fort battery. That would be perfect!


 

Parameters

AreaUID

Area Alias or -1 for entire map.

StrucTypeUID

Simple Mode:

Structure Type:
All = -1,
$Fort = 1 ,
$Depot = 2,
$City = 3, etc.

Advanced mode:

this is the Structure Family.
UnitDefUID

Alias of unit to be the garrison

ChancePerCheck

Simple Mode:

Integer (1-100) Probability of appearing per replacement available in the pool of the defined garrison unit.

Advanced Mode:

Integer (1-100) Probability of appearing per level of the structure checked.
Placeholder(n)

Required. For future expansion

Forums