ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Autocreate: Difference between revisions

From ModEnc
Jump to navigation Jump to search
E1 Elite (talk | contribs)
No edit summary
Crimsonum (talk | contribs)
Added a note about a special case, and a table of contents
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Autocreate in TeamTypes is used to check whether a unit should be recruited from the pre-placed unit on the map or it should be produced from a factory to form the team.
{{Flag
|name={{PAGENAME}}
|files={{Categ|ini=ai}}, {{Categ|maps}}
|values={{Values|boolean}}
|types={{Categ|TeamTypes}}
|ts=yes
|fs=yes
|hp=yes
|ra2=yes
|yr=yes
|ares=yes
}}


Pre-Placed unit formats on the map for [[Infantry_(maps)|Infantry]], [[Units_(maps)|Units]] and [[Aircraft_(maps)|Aircraft]].
Autocreate in [[TeamTypes]] is used to check whether a unit should be recruited from the preplaced unit on the map or it should be produced from a factory to form the team.
 
== Unit Parameters ==
 
Preplaced units have two parameters that control recruitment to autocreate teams. These parameters are at the end of the unit section. For reference, below are the preplaced unit formats on the map for [[Infantry_(maps)|infantry]], [[Units_(maps)|units (vehicles)]], and [[Aircraft_(maps)|aircraft]].


  [Infantry]
  [Infantry]
  Index=OWNER,ID,HEALTH,X,Y,SUB_CELL,MISSION,FACING,TAG,VETERANCY,GROUP,HIGH,AUTOCREATE_NO_RECRUITABLE,AUTOCREATE_YES_RECRUITABLE
  INDEX=OWNER,ID,HEALTH,X,Y,SUB_CELL,MISSION,FACING,TAG,VETERANCY,GROUP,HIGH,'''AUTOCREATE_NO_RECRUITABLE''','''AUTOCREATE_YES_RECRUITABLE'''


  [Units]
  [Units]
  Index=OWNER,ID,HEALTH,X,Y,FACING,MISSION,TAG,VETERANCY,GROUP,HIGH,FOLLOWS_ID,AUTOCREATE_NO_RECRUITABLE,AUTOCREATE_YES_RECRUITABLE
  INDEX=OWNER,ID,HEALTH,X,Y,FACING,MISSION,TAG,VETERANCY,GROUP,HIGH,FOLLOWS_INDEX,'''AUTOCREATE_NO_RECRUITABLE''','''AUTOCREATE_YES_RECRUITABLE'''


  [Aircraft]
  [Aircraft]
  Index=OWNER,ID,HEALTH,X,Y,FACING,MISSION,TAG,VETERANCY,GROUP,AUTOCREATE_NO_RECRUITABLE,AUTOCREATE_YES_RECRUITABLE
  INDEX=OWNER,ID,HEALTH,X,Y,FACING,MISSION,TAG,VETERANCY,GROUP,'''AUTOCREATE_NO_RECRUITABLE''','''AUTOCREATE_YES_RECRUITABLE'''
 
== How It Works ==
 
When a TeamType has {{f|Autocreate|no}} then the preplaced units on the map with {{tt|AUTOCREATE_NO_RECRUITABLE}} as {{tt|0}} are not considered for recruitment. If there are units with {{tt|AUTOCREATE_NO_RECRUITABLE}} as {{tt|1}} then recruit those and form the team. If it falls short to form the team then produce remaining units from the factory to complete the team. If it fails to recruit the units on the map with {{tt|AUTOCREATE_NO_RECRUITABLE}} as {{tt|1}}, because of any reason like {{f|Group|link}} mismatch along with {{f|Recruiter|no|link}}, then it cannot produce replacement for such units from the factory, so the team formation is interrupted and the team is not formed.
 
When a TeamType has {{f|Autocreate|yes}} then the preplaced units on the map with {{tt|AUTOCREATE_YES_RECRUITABLE}} as {{tt|0}} are not considered for recruitment. If there are units with {{tt|AUTOCREATE_YES_RECRUITABLE}} as {{tt|1}} then recruit those and form the team. If it fails to recruit, because of any reason like {{f|Group|link}} mismatch along with {{f|Recruiter|no|link}}, then produce those units from the factory and complete the team. If it falls short to form the team from the preplaced units on the map then also produce remaining units from the factory and complete the team. Additional restriction apply that is if {{tt|AUTOCREATE_NO_RECRUITABLE}} is {{tt|1}} then it cannot produce from factory.
 
For production from factory, it is assumed that the concerned house has required factory (barracks/war factory etc.) and has credits to produce units.
 
The value in {{tt|MISSION}} also affects whether a preplaced unit is recruitable or not. For example, in {{rules}}, {{tt|Harmless}} section is set with {{f|Recruiter|no}}. So if the preplaced unit is in {{tt|Harmless}} mission, it is not available for recruitment whereas a unit in {{tt|Guard}} or {{tt|Area Guard}} mission are available for recruitment.
 
Here's the above information in table format:
 
{|class="wikitable" style="text-align: center; max-width: 80em"
|+Can these preplaced units be recruited to this team?
|colspan="3" rowspan="2" style="border-left: none; border-top: none;"|
!colspan="4"|Unit &rarr;&nbsp;<code>AUTOCREATE_YES_RECRUITABLE</code>
|-
|colspan="2" style="background:#eaecf0;"|<code>0</code>
|colspan="2" style="background:#eaecf0;"|<code>1</code>
|-
|colspan="2" style="border-left: none; border-top: none;"|
!Team &rarr;&nbsp;<code>Autocreate</code>
|style="background:#eaecf0; width: 25%;"|<code>no</code>
|style="background:#eaecf0; width: 25%;"|<code>yes</code>
|style="background:#eaecf0; width: 25%;"|<code>no</code>
|style="background:#eaecf0; width: 25%;"|<code>yes</code>
|-
!rowspan="4"|Unit &rarr;&nbsp;<code>AUTOCREATE_NO_RECRUITABLE</code>
|rowspan="2" style="background:#eaecf0;"|<code>0</code>
|style="background:#eaecf0;"|<code>no</code>
|{{N}}
|style="background:#e5e5e5;"|
|{{N}}
|style="background:#e5e5e5;"|
|-
|style="background:#eaecf0;"|<code>yes</code>
|style="background:#e5e5e5;"|
|{{N}}
|style="background:#e5e5e5;"|
|{{Y}}<br />If recruitment fails or team is not filled, produce remaining members.
|-
|rowspan="2" style="background:#eaecf0;"|<code>1</code>
|style="background:#eaecf0;"|<code>no</code>
|{{Y}}<br />If recruitment succeeds but team is not filled, produce remaining members. If recruitment fails, do nothing.
|style="background:#e5e5e5;"|
|{{Y}}<br />If recruitment succeeds but team is not filled, produce remaining members. If recruitment fails, do nothing.
|style="background:#e5e5e5;"|
|-
|style="background:#eaecf0;"|<code>yes</code>
|style="background:#e5e5e5;"|
|{{N}}
|style="background:#e5e5e5;"|
|{{Y}}<br />If recruitment fails or team is not filled, do nothing.
|-
|}


When a TeamType has Autocreate=no then the pre-placed units on the map with AUTOCREATE_NO_RECRUITABLE as 0 are not considered for recruitment. If there are units with AUTOCREATE_NO_RECRUITABLE as 1 then recruit those and form the team. If it falls short to form the team then produce remaining units from the factory to complete the team. If it fails to recruit the units on the map with AUTOCREATE_NO_RECRUITABLE as 1, because of any reason like [[Group]] mismatch along with [[Recruiter]]=no, then it cannot produce replacement for such units from the factory, so the team formation is interrupted and the team is not formed.
== Special Cases ==


When a TeamType has Autocreate=yes then the pre-placed units on the map with AUTOCREATE_YES_RECRUITABLE as 0 are not considered for recruitment. If there are units with AUTOCREATE_YES_RECRUITABLE as 1 then recruit those and form the team. If it fails to recruit, because of any reason like [[Group]] mismatch along with [[Recruiter]]=no, then produce those units from the factory and complete the team. If it falls short to form the team from the pre-placed units on the map then also produce remaining units from the factory and complete the team.
=== Automatic Base Defense ===


AITrigger Teams that are produced regularly according to [[TeamDelays]] are not affected whether Autocreate is set to yes or no.
As explained above, preplaced units have two kinds of recruitment flags. If both of these flags are set on a unit, then the unit is available for an automatic base defense mission: When an enemy attacks the AI's base, these units are immediately sent out after the attacker. This only applies to buildings that are not [[insignificant]] and do not have a [[Primary|weapon]], i.e. attacks on base defenses are ignored.


[[Category:INI Flags]]
[[Category:INI Flags]]

Latest revision as of 22:31, 19 January 2024

Tiberian Dawn The Covert Operations Red Alert Counterstrike Aftermath Tiberian Sun Firestorm HyperPatch Red Alert 2 Yuri's Revenge Ares Generals Zero Hour Tiberium Wars Kane's Wrath
Flag: Autocreate
File(s): ai(md).ini, maps
Values: Boolean values: yes or no, true or false, 1 or 0
Applicable to: TeamTypes


Autocreate in TeamTypes is used to check whether a unit should be recruited from the preplaced unit on the map or it should be produced from a factory to form the team.

Unit Parameters

Preplaced units have two parameters that control recruitment to autocreate teams. These parameters are at the end of the unit section. For reference, below are the preplaced unit formats on the map for infantry, units (vehicles), and aircraft.

[Infantry]
INDEX=OWNER,ID,HEALTH,X,Y,SUB_CELL,MISSION,FACING,TAG,VETERANCY,GROUP,HIGH,AUTOCREATE_NO_RECRUITABLE,AUTOCREATE_YES_RECRUITABLE
[Units]
INDEX=OWNER,ID,HEALTH,X,Y,FACING,MISSION,TAG,VETERANCY,GROUP,HIGH,FOLLOWS_INDEX,AUTOCREATE_NO_RECRUITABLE,AUTOCREATE_YES_RECRUITABLE
[Aircraft]
INDEX=OWNER,ID,HEALTH,X,Y,FACING,MISSION,TAG,VETERANCY,GROUP,AUTOCREATE_NO_RECRUITABLE,AUTOCREATE_YES_RECRUITABLE

How It Works

When a TeamType has Autocreate=no then the preplaced units on the map with AUTOCREATE_NO_RECRUITABLE as 0 are not considered for recruitment. If there are units with AUTOCREATE_NO_RECRUITABLE as 1 then recruit those and form the team. If it falls short to form the team then produce remaining units from the factory to complete the team. If it fails to recruit the units on the map with AUTOCREATE_NO_RECRUITABLE as 1, because of any reason like Group mismatch along with Recruiter=no, then it cannot produce replacement for such units from the factory, so the team formation is interrupted and the team is not formed.

When a TeamType has Autocreate=yes then the preplaced units on the map with AUTOCREATE_YES_RECRUITABLE as 0 are not considered for recruitment. If there are units with AUTOCREATE_YES_RECRUITABLE as 1 then recruit those and form the team. If it fails to recruit, because of any reason like Group mismatch along with Recruiter=no, then produce those units from the factory and complete the team. If it falls short to form the team from the preplaced units on the map then also produce remaining units from the factory and complete the team. Additional restriction apply that is if AUTOCREATE_NO_RECRUITABLE is 1 then it cannot produce from factory.

For production from factory, it is assumed that the concerned house has required factory (barracks/war factory etc.) and has credits to produce units.

The value in MISSION also affects whether a preplaced unit is recruitable or not. For example, in Rules(md).ini, Harmless section is set with Recruiter=no. So if the preplaced unit is in Harmless mission, it is not available for recruitment whereas a unit in Guard or Area Guard mission are available for recruitment.

Here's the above information in table format:

Can these preplaced units be recruited to this team?
Unit → AUTOCREATE_YES_RECRUITABLE
0 1
Team → Autocreate no yes no yes
Unit → AUTOCREATE_NO_RECRUITABLE 0 no
yes
If recruitment fails or team is not filled, produce remaining members.
1 no
If recruitment succeeds but team is not filled, produce remaining members. If recruitment fails, do nothing.

If recruitment succeeds but team is not filled, produce remaining members. If recruitment fails, do nothing.
yes
If recruitment fails or team is not filled, do nothing.

Special Cases

Automatic Base Defense

As explained above, preplaced units have two kinds of recruitment flags. If both of these flags are set on a unit, then the unit is available for an automatic base defense mission: When an enemy attacks the AI's base, these units are immediately sent out after the attacker. This only applies to buildings that are not insignificant and do not have a weapon, i.e. attacks on base defenses are ignored.