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

Foundation: Difference between revisions

From ModEnc
Jump to navigation Jump to search
m Cross-categories, wee
Crimsonum (talk | contribs)
Moved and updated note on weapons factories
 
(20 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{flag|name=Foundation|files=art(md).ini|values=see below|special=None|default=1x1|types=BuildingTypes|games=TS, FS, RA2, YR}}
{{flag
|files={{categ|ini=art}}
|values={{values|strings|[[hardcoded]] values[[{{PAGENAME}}#values|{{sup|{{arr|d}}}}]]}}
|default=1x1
|types={{categ|BuildingTypes}}
|ts=yes
|fs=yes
|ets=yes
|ra2=yes
|yr=yes
|rp=yes
|ares=yes
}}


Foundation= defines the footprint of buildings, in other words, how many cells will it take up.  
This flag determines the number of [[cell]]s a [[BuildingType|structure]] occupies, and the arrangement of those cells.


Possible values (the first number defines cell count along the NW-SE axis, the second - along the NE-SW axis) are:<br>
=={{anchor|values||}}Accepted values==
0x0, 6x4, 3x4, 4x4, 5x3, 2x5, 2x6, 1x5, 1x4, 4x3, 3x1, 1x3, 3x3Refinery, 4x2, 3x5, 3x3, 3x2, 2x3, 2x2, 1x2, 2x1, 1x1
All values are case-insensitive. Any other values will simply be ignored and the default used instead; however [[Ares]] can be utilized to create custom foundations. The first number represents the cell-count along the NW-SE axis, the second along the NE-SW axis.


'''Note''': You cannot make up other foundations, because these are actually hardcoded in the EXE, and only appear to be modifiable.
0x0, 6x4, 3x4, 4x4, 5x3, 2x5, 2x6, 1x5, 1x4, 4x3, 3x1, 1x3, 3x3REFINERY, 4x2, 3x5, 3x3, 3x2, 2x3, 2x2, 1x2, 2x1, 1x1


==== 3x3Refinery ====
===3x3REFINERY===
3x3Refinery is a special case. All other foundations are rectangles, this one has a free cell in the center of the third row. See the sketch below:
[[Image:3x3refinery.png|frame|{{f|Foundation|3x3REFINERY}} grid illustration]] <code>3x3REFINERY</code> is an unusual shape. While all other foundation values are rectangles, this one has an empty cell in the center of the third row.


--/\--
Albeit containing "Refinery" in the value string, this will not work for a {{f|Refinery|link}} because the harvester's docking point inside a refinery is [[hardcoded]] to be the second [[cell]] in the fourth row, which is outside of the foundation in this case.
-/\/\-
/\/\/\
\/\/\/
-\/\--
--\/--


'''Note''': This foundation, albeit mentioning Refinery in the name, will not work for a Refinery, because the harvester's docking point inside a refinery is hardcoded to be the second cell in the fourth row, as it is in TS and RA2.
===6x4===
[[Image:6x4foundation.png|frame|{{f|Foundation|6x4}} grid illustration.]]


[[Category:INI Flags]]
In Tiberian Sun, 6x4 produces an unusual shape. The foundation is shaped like a rectangle, but with three empty cells at the southwest side. It was used for the Scrin Ship and probably coded to match the building art.
[[Category:rules(md).ini Flags]]
 
[[Category:BuildingTypes Flags]]
===0x0===
Foundation <code>0x0</code> works a bit differently from the others as well. Such structures are completely immune to normal [[Weapons|weapon]] damage and thus cannot be destroyed in the standard way. They however ''are'' vulnerable to weapons whose [[Warheads|warhead]] has {{f|Temporal|yes|link}}. <code>0x0</code> structures do not occupy physical space, which allows units to move over the cell one of these structures was placed on. They also display their appropriate {{f|UIName|link}} strings if the cursor is hovered over the cell the structure was placed on. Apart from this, they function pretty much like structures with normal foundations, although the [[AI]] has some issues handling them[[{{PAGENAME}}#0x0AI|{{sup|{{arr|d}}}}]].
'''WARNING: 0x0 buildings do NOT expand the base even when {{f|BaseNormal|yes|link}}!'''
{{Bugs}}
This flag is read from {{Ini|art}} twice: from section you specified in rules as [object]->Image , and from simply [object] , and the second one overrules the first if present. This causes weird behaviour, like setting
[GAYARD]
Image=NAHAND
in rules still requires a 4x4 Foundation to place, contrary to what logic dictates - you need to remove the Foundation flag from GAYARD to get it to use NAHAND's one.
 
==={{anchor|0x0AI||}}AI Treatment of Foundation 0x0===
The AI is apparently stupid enough to think that 0x0 structures don't actually exist on the battlefield, and continues to build more and more of them instead of just one.
 
===Construction Yards===
The AI seems to have a problem using a Construction Yard with any Foundation smaller than 2x2, it will deploy the construction yard but will not build anything.
 
===Weapons Factories===
 
The preferred exit point for a unit exiting a [[WeaponsFactory|Weapons Factory]] is hardcoded to be the 8th and 11th cells in TS and RA2/YR respectively (counted from the building origin by increasing X, then Y).
 
==Ares's Custom Foundations==
Ares introduced custom foundations with version 0.1. Building Foundations can now be any shape and size, not just the few predefined options previously available. For example, you can now recreate the old Red Alert Repair Depot foundation. The INI coding is rather complex, so instead of writing it manually, it’s recommended to use the [http://ares-developers.github.io/Ares-docs/_downloads/custom_foundation.html Custom Foundation Generator] developed by Renegade.
 
When creating foundations, don’t forget to create the outlines.
 
===New Values and Flags===
* {{f|Foundation|custom}}    ; Initiates the custom foundation logic. 
* {{f|Foundation.X}}    ; Length of the foundation along the X axis.
* {{f|Foundation.Y}}    ; Length of the foundation along the Y axis.
* {{f|Foundation.#}}    ; Replace # with an integer starting from 0. The coordinates of each cell in the foundation.
* {{f|FoundationOutline.Length}}    ; The 'perimeter' of the foundation's outline.
* {{f|FoundationOutline.#}}    ; Replace # with an integer starting from 0 up to ({{f|FoundationOutline.Length}} - 1). The coordinates of each cell in the foundation's outline.
 
===Sample Code===
The code below represents a foundation in the form of a cross.
Foundation = Custom
Foundation.X = 5
Foundation.Y = 5
Foundation.0 = 1,0
Foundation.1 = 0,1
Foundation.2 = 1,1
Foundation.3 = 2,1
Foundation.4 = 1,2
FoundationOutline.Length = 16
FoundationOutline.0 = 0,-1
FoundationOutline.1 = 1,-1
FoundationOutline.2 = 2,-1
FoundationOutline.3 = -1,0
FoundationOutline.4 = 0,0
FoundationOutline.5 = 2,0
FoundationOutline.6 = 3,0
FoundationOutline.7 = -1,1
FoundationOutline.8 = 3,1
FoundationOutline.9 = -1,2
FoundationOutline.10 = 0,2
FoundationOutline.11 = 2,2
FoundationOutline.12 = 3,2
FoundationOutline.13 = 0,3
FoundationOutline.14 = 1,3
FoundationOutline.15 = 2,3
 
===Notes===
[[WeaponsFactory|Weapons Factories]] are hard-coded to use the unit exit paths from the original game so changing the foundation for these buildings is not recommended.
 
The Custom Foundation Generator located with the Renegade Project Network is incompatible with Google Chrome, and results in gibberish. Be advised.

Latest revision as of 07:05, 14 February 2023

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: Foundation
File(s): art(md).ini
Values: Strings: Normal text. (Limited to: hardcoded values)
Default: 1x1
Applicable to: BuildingTypes


This flag determines the number of cells a structure occupies, and the arrangement of those cells.

Accepted values

All values are case-insensitive. Any other values will simply be ignored and the default used instead; however Ares can be utilized to create custom foundations. The first number represents the cell-count along the NW-SE axis, the second along the NE-SW axis.

0x0, 6x4, 3x4, 4x4, 5x3, 2x5, 2x6, 1x5, 1x4, 4x3, 3x1, 1x3, 3x3REFINERY, 4x2, 3x5, 3x3, 3x2, 2x3, 2x2, 1x2, 2x1, 1x1

3x3REFINERY

Foundation=3x3REFINERY grid illustration
3x3REFINERY is an unusual shape. While all other foundation values are rectangles, this one has an empty cell in the center of the third row.

Albeit containing "Refinery" in the value string, this will not work for a Refinery because the harvester's docking point inside a refinery is hardcoded to be the second cell in the fourth row, which is outside of the foundation in this case.

6x4

Foundation=6x4 grid illustration.

In Tiberian Sun, 6x4 produces an unusual shape. The foundation is shaped like a rectangle, but with three empty cells at the southwest side. It was used for the Scrin Ship and probably coded to match the building art.

0x0

Foundation 0x0 works a bit differently from the others as well. Such structures are completely immune to normal weapon damage and thus cannot be destroyed in the standard way. They however are vulnerable to weapons whose warhead has Temporal=yes. 0x0 structures do not occupy physical space, which allows units to move over the cell one of these structures was placed on. They also display their appropriate UIName strings if the cursor is hovered over the cell the structure was placed on. Apart from this, they function pretty much like structures with normal foundations, although the AI has some issues handling them.

WARNING: 0x0 buildings do NOT expand the base even when BaseNormal=yes!

Bugs/Side-Effects/Unexpected Limitations

This flag is read from art(md).ini twice: from section you specified in rules as [object]->Image , and from simply [object] , and the second one overrules the first if present. This causes weird behaviour, like setting

[GAYARD]
Image=NAHAND

in rules still requires a 4x4 Foundation to place, contrary to what logic dictates - you need to remove the Foundation flag from GAYARD to get it to use NAHAND's one.

AI Treatment of Foundation 0x0

The AI is apparently stupid enough to think that 0x0 structures don't actually exist on the battlefield, and continues to build more and more of them instead of just one.

Construction Yards

The AI seems to have a problem using a Construction Yard with any Foundation smaller than 2x2, it will deploy the construction yard but will not build anything.

Weapons Factories

The preferred exit point for a unit exiting a Weapons Factory is hardcoded to be the 8th and 11th cells in TS and RA2/YR respectively (counted from the building origin by increasing X, then Y).

Ares's Custom Foundations

Ares introduced custom foundations with version 0.1. Building Foundations can now be any shape and size, not just the few predefined options previously available. For example, you can now recreate the old Red Alert Repair Depot foundation. The INI coding is rather complex, so instead of writing it manually, it’s recommended to use the Custom Foundation Generator developed by Renegade.

When creating foundations, don’t forget to create the outlines.

New Values and Flags

  • Foundation=custom  ; Initiates the custom foundation logic.
  • Foundation.X  ; Length of the foundation along the X axis.
  • Foundation.Y  ; Length of the foundation along the Y axis.
  • Foundation.#  ; Replace # with an integer starting from 0. The coordinates of each cell in the foundation.
  • FoundationOutline.Length  ; The 'perimeter' of the foundation's outline.
  • FoundationOutline.#  ; Replace # with an integer starting from 0 up to (FoundationOutline.Length - 1). The coordinates of each cell in the foundation's outline.

Sample Code

The code below represents a foundation in the form of a cross.

Foundation = Custom
Foundation.X = 5
Foundation.Y = 5
Foundation.0 = 1,0
Foundation.1 = 0,1
Foundation.2 = 1,1
Foundation.3 = 2,1
Foundation.4 = 1,2
FoundationOutline.Length = 16
FoundationOutline.0 = 0,-1
FoundationOutline.1 = 1,-1
FoundationOutline.2 = 2,-1
FoundationOutline.3 = -1,0
FoundationOutline.4 = 0,0
FoundationOutline.5 = 2,0
FoundationOutline.6 = 3,0
FoundationOutline.7 = -1,1
FoundationOutline.8 = 3,1
FoundationOutline.9 = -1,2
FoundationOutline.10 = 0,2
FoundationOutline.11 = 2,2
FoundationOutline.12 = 3,2
FoundationOutline.13 = 0,3
FoundationOutline.14 = 1,3
FoundationOutline.15 = 2,3

Notes

Weapons Factories are hard-coded to use the unit exit paths from the original game so changing the foundation for these buildings is not recommended.

The Custom Foundation Generator located with the Renegade Project Network is incompatible with Google Chrome, and results in gibberish. Be advised.