Difference between revisions of "Armor.tbl"
(update to 5707) |
|||
(17 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{SCP_table}} | {{SCP_table}} | ||
+ | {{TableVersion|8629}} | ||
+ | {{Tables}} | ||
+ | The '''armor.tbl''' stores data on FS2's as-of-now-simplistic armor system. It lets you define different damage types per armor. The reason for defining different damage types per armor is that armor may be damaged more/less by certain types of weapons. For example, a fire-retardant suit may offer excellent protection against a flamethrower but virtually none against bullets.<br><br> | ||
+ | It's important to note that the cumbersome +Calculation/+Value system used for defining calculations will, in the future, be [[deprecated]] in favor of a more efficient scripting system. However, the current system will be kept for backwards compatibility if any mods or campaigns choose to make use of the table. | ||
− | + | Please note that the spelling '''armour.tbl''' is currently not supported. | |
− | + | This table is one of the [[Modular Tables]] and can be extended with xxx-amr.tbm | |
− | |||
− | == | + | ==#Armor Type== |
− | + | Each armor entry begins with '''#Armor Type''' and ends with '''#End'''. There may be multiple entries in armor.tbl. | |
− | |||
− | |||
+ | ===$Name:=== | ||
+ | Defines the name of the armor type. The same name must be used in the [[ships.tbl#$Armor Type:|$Armor Type]] entry in order for that ship to use the armor type. Note that Shields may also have an armor type as designated by [[ships.tbl#$Shield Armor Type:|$Shield Armor Type]] | ||
− | + | *Syntax: '''String''' | |
− | |||
===$Damage Type:=== | ===$Damage Type:=== | ||
− | + | Defines the name for the damage type that is used for the armor type/damage type pairs. | |
− | * | + | *The same name must be used in the [[weapons.tbl#$Damage Type:|$Damage Type]] entry (for all weapons that have this damage type) so that the armor can be applied against that particular damage type. |
− | * | + | *Each $Damage Type entry must have at least one [[armor.tbl#+Calculation:|+Calculation]] entry |
− | + | ||
+ | |||
+ | *Syntax:'''String''', name of the damage type | ||
====+Calculation:==== | ====+Calculation:==== | ||
− | + | Defines the used calculation type. | |
+ | *Calculations per damage types are possible | ||
+ | *Calculations are performed in the order they are defined in the armor.tbl (and -amr.tbm's) | ||
+ | **The "current damage value" is the result of the calculation before it | ||
+ | **The "current damage value" is initially equal to the [[weapons.tbl#$Damage:|$Damage]] value of the weapon that is impacting the armor (provided that the weapon has the same [[armor.tbl#$Damage Type:|$Damage Type]]) | ||
+ | |||
+ | |||
+ | *Syntax:'''String''', name of the calculation type | ||
+ | *Valid strings: see [[armor.tbl#List of Calculations|List of Calculations]] | ||
+ | |||
+ | {{Table3615| | ||
+ | Note that this must be followed by a +Stored Value:, a +Constant:, or a +Value: tag. but only one of the three. This will be the value used by the calculation, so only one source is allowed. | ||
+ | }} | ||
+ | =====+Stored Value:===== | ||
+ | {{Table3615| | ||
+ | The calculation shall use the value stored in the specified memory location (which is stored by a previous calculation) | ||
+ | *One, and only one, of the +Stored Value, [[armor.tbl#+Constant:|+Constant]], or [[armor.tbl#+Value:|+Value]] entries is required per [[armor.tbl#+Calculation:|+Calculation]]. | ||
+ | |||
+ | |||
+ | *Syntax:'''Unsigned integer''' | ||
+ | *Valid Values: 0 through 7 | ||
+ | **Values greater than 7 are possible, but are not guaranteed to work as of (Rev 8629) | ||
+ | }} | ||
+ | |||
+ | =====+Constant:===== | ||
+ | {{Table3615| | ||
+ | The calculation shall use a constant float value, that's internally defined in FSO. | ||
+ | *One, and only one, of the [[armor.tbl#+Stored Value:|+Stored Value]], +Constant, or [[armor.tbl#+Value:|+Value]] entries is required per [[armor.tbl#+Calculation:|+Calculation]]. | ||
+ | *Syntax:'''String''' | ||
+ | *Valid Values: | ||
+ | **'''base damage''' | ||
+ | ***The calculation shall use the base damage as defined by [[weapons.tbl#$Damage:|$Damage]] | ||
+ | ***Note: if [[armor.tbl#+Difficulty Scale Type:|+Difficulty Scale Type]] is set to "first", this returns the base damage times the difficulty scale factor | ||
+ | **'''current damage''' | ||
+ | ***The calculation shall use the resulting value of the previous calculation as the input value for this calculation | ||
+ | **'''difficulty factor''' | ||
+ | ***The calculation shall use the difficulty scale factor | ||
+ | **'''random''' | ||
+ | ***The calculation shall use a random number that's anywhere between 0 and 1 | ||
+ | **'''pi''' | ||
+ | ***The calculation shall use the constant Pi (3.1415...) | ||
+ | }} | ||
+ | |||
+ | =====+Value:===== | ||
+ | Defines the value used for the defined calculation. | ||
+ | *One, and only one, of the [[armor.tbl#+Stored Value:|+Stored Value]], [[armor.tbl#+Constant:|+Constant]], or +Value entries is required per [[armor.tbl#+Calculation:|+Calculation]]. | ||
+ | |||
+ | *Syntax: '''Float''' | ||
− | |||
− | |||
====+Shield Piercing Percentage:==== | ====+Shield Piercing Percentage:==== | ||
{{Table3611| | {{Table3611| | ||
− | + | If a ship's shield is setup for this particular damage type (by using [[ship.tbl#$Shield Armor Type:|$Shield Armor Type]]), this entry defines the percentage of damage (resulting from the earlier calculations) that will be applied directly to the hull. This has the effect of damaging both the shield and hull for a single impact. | |
− | + | *Syntax: '''Float''' | |
− | *Syntax: ''''' | + | *Valid values: '''0''' to '''1''', where 1 is 100% |
+ | }} | ||
+ | ====+Weapon Piercing Effect Start Limit:==== | ||
+ | {{Table3612| | ||
+ | Defines the percentage of hull integrity at which weapon piercing effects are started | ||
+ | |||
+ | *Syntax: '''''Float''''', value from 0 to 100}} | ||
+ | |||
+ | |||
+ | ====+Weapon Piercing Type:==== | ||
+ | {{Table3612| | ||
+ | Defines the piercing type to use | ||
+ | |||
+ | *Syntax: '''''String''''' | ||
+ | *Valid Values: | ||
+ | **'''none''' | ||
+ | **'''default''' | ||
+ | **'''retail'''}} | ||
+ | |||
+ | |||
+ | ====+Difficulty Scale Type:==== | ||
+ | {{Table3615| | ||
+ | Dictates how/when the Difficulty damage multiplier is applied to the end result of all calculations | ||
+ | |||
+ | *Syntax: '''String''' | ||
+ | *Valid Values: | ||
+ | **'''first''' - Difficulty damage multiplier is applied to the base damage before calculations | ||
+ | **'''last''' - Difficulty damage multiplier is applied to the result of the calculations | ||
+ | **'''manual''' - Difficulty damage multiplier is ignored, and is assumed to be handled elsewhere (such as in a LUA script or a sexp) | ||
+ | *Default: '''first''' | ||
+ | }} | ||
===$Flags:=== | ===$Flags:=== | ||
{{Table3611| | {{Table3611| | ||
− | + | Defines the flags affecting this armor type | |
− | + | ||
*Syntax: ( '''''String''''' ) | *Syntax: ( '''''String''''' ) | ||
− | * | + | *Valid flags: |
− | + | **'''ignore subsystem armor''' | |
+ | ***If set, FSO will use the hull's armor type against all damage to the subsystem, regardless of any armor type that the subsystem may have}} | ||
+ | |||
+ | |||
+ | ==#End== | ||
+ | Each #Armor Type section must end with #End, no exceptions. | ||
+ | |||
---- | ---- | ||
− | == | + | ==List of Calculations== |
− | {{ | + | The following is a list of valid strings to be used with [[armor.tbl#+Calculation:|+Calculation]]. |
− | + | {{Table3615| | |
− | + | Note: As of this version +Value may be substituted with +Stored Value or +Constant. Usage of +Value in this section is only for example purposes and is a stand in for whatever source you actually use. | |
− | + | }} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | *'''additive''' | ||
+ | **Adds [[armor.tbl#+Value:|+Value]] to the the current damage value | ||
+ | *'''multiplicative''' | ||
+ | **Multiplies the the current damage value by [[armor.tbl#+Value:|+Value]] | ||
+ | *'''exponential''' | ||
+ | **Raises the current damage value to the power of [[armor.tbl#+Value:|+Value]] | ||
+ | *'''exponential base''' | ||
+ | **Raises [[armor.tbl#+Value:|+Value]] to the power of the current damage value | ||
+ | *'''cutoff''' | ||
+ | **If the current damage value is '''''less''''' than [[armor.tbl#+Value:|+Value]], then the resulting damage value is 0. | ||
+ | *'''reverse cutoff''' | ||
+ | **If the current damage value is '''''greater''''' than [[armor.tbl#+Value:|+Value]], then the resulting damage value is 0. | ||
+ | *'''instant cutoff''' | ||
+ | **If the current damage value is '''''less''''' than the specified amount, then the resulting damage value is set to 0 and the engine ignores all following calculations | ||
+ | *'''instant reverse cutoff''' | ||
+ | **If the current damage value is '''''greater''''' than the specified amount, then the resulting damage value is set to 0 and the engine ignores all following calculations. | ||
+ | {{Table3615| | ||
+ | *'''cap''' | ||
+ | **If the current damage value is '''''greater''''' than [[armor.tbl#+Value:|+Value]], then the resulting damage value is [[armor.tbl#+Value:|+Value]]. | ||
+ | *'''instant cap''' | ||
+ | **If the current damage value is '''''greater''''' than the specified amount, then the resulting damage value is set to [[armor.tbl#+Value:|+Value]] and the engine ignores all following calculations. | ||
+ | *'''set''' | ||
+ | **Sets the damage value to [[armor.tbl#+Value:|+Value]]. | ||
+ | *'''store''' | ||
+ | **Stores the current damage value to a memory location specified by [[armor.tbl#+Value:|+Value]] (which is casted as an unsigned integer) | ||
+ | **Stored damage values may be used only in the calculations they are assigned, and are discarded after the calculations are finished | ||
+ | *'''load''' | ||
+ | **Loads the current damage value from a memory location specified by [[armor.tbl#+Value:|+Value]] (which is casted as an unsigned integer) | ||
+ | **Stored damage values may be used only in the calculations they are assigned, and are discarded after the calculations are finished | ||
+ | *'''random''' | ||
+ | **Randomizes the damage value to anything between the current damage value and the base damage value as defined by [[weapons.tbl#$Damage:|$Damage]] | ||
+ | }} | ||
− | == Example == | + | ==Example== |
'''''[[armor.tbl]]''''' | '''''[[armor.tbl]]''''' | ||
Latest revision as of 02:47, 4 January 2023
This feature requires FreeSpace Open |
Revision information.....
- FSO Revision: 8629
List of Tables and related code files | |
---|---|
* Notes Modular Tables | |
** Notes tables which only use modular tables | |
Ai.tbl* | /ai/aicode.cpp |
Ai_profiles.tbl* | /ai/ai_profiles.cpp |
Animation.tbl** | /model/modelanimation.cpp |
Armor.tbl* | /ship/ship.cpp |
Asteroid.tbl* | /asteroid/asteroid.cpp |
Autopilot.tbl* | /autopilot/autopilot.cpp |
Cheats.tbl* | /cheats_table/cheats_table.cpp |
Colors.tbl* | /globalincs/alphacolors.cpp |
Curves.tbl* | /math/curves.cpp |
Controlconfigdefaults.tbl | /controlconfig/controlsconfigcommon.cpp |
Credits.tbl* | /menuui/credits.cpp |
Cutscenes.tbl* | /cutscene/cutscenes.cpp |
Decals.tbl** | /decals/decals.cpp |
Fireball.tbl* | /fireball/fireballs.cpp |
Fonts.tbl* | /graphics/font.cpp |
Game_settings.tbl* | /mod_table/mod_table.cpp |
Glowpoints.tbl* | /model/modelread.cpp |
Help.tbl* | /gamehelp/contexthelp.cpp |
Hud_gauges.tbl* | /hud/hudparse.cpp |
Icons.tbl* | /mission/missionbriefcommon.cpp |
Iff_defs.tbl* | /iff_defs/iff_defs.cpp |
Keywords.tbl* | Not In Codebase |
Lighting_Profiles.tbl* | /lighting/lighting_profiles.cpp |
Lightning.tbl* | /nebula/neblightning.cpp |
Mainhall.tbl* | /menuui/mainhallmenu.cpp |
Medals.tbl* | /stats/medals.cpp |
Messages.tbl* | /mission/missionmessage.cpp |
Mflash.tbl* | /weapon/muzzleflash.cpp |
Music.tbl* | /gamesnd/eventmusic.cpp |
Nebula.tbl* | /nebula/neb.cpp |
Objecttypes.tbl* | /ship/ship.cpp |
Options.tbl* | Not In Codebase |
Particle effects(-part.tbm)** | /particle/effects... |
Post_processing.tbl | /graphics/gropenglpostprocessing.cpp |
Rank.tbl* | /stats/scoring.cpp |
Scpui.tbl* | Not In Codebase |
Scripting.tbl* | /parse/scripting.cpp |
Ships.tbl* | /ship/ship.cpp |
Sexps.tbl** | /parse/sexp/sexp_lookup.cpp |
Sounds.tbl* | /gamesnd/gamesnd.cpp |
Species_defs.tbl* | /species_defs/species_defs.cpp |
Species.tbl* | /menuui/techmenu.cpp |
Ssm.tbl* | /hud/hudartillery.cpp |
Stars.tbl* | /starfield/starfield.cpp |
Strings.tbl* | /localization/localize.cpp |
Tips.tbl* | /menuui/playermenu.cpp |
Traitor.tbl* | /stats/scoring.cpp |
Tstrings.tbl* | /localization/localize.cpp |
Virtual_pofs.tbl* | /model/modelreplace.cpp |
Weapon_expl.tbl* | /weapon/weapons.cpp |
Weapons.tbl* | /weapon/weapons.cpp |
The armor.tbl stores data on FS2's as-of-now-simplistic armor system. It lets you define different damage types per armor. The reason for defining different damage types per armor is that armor may be damaged more/less by certain types of weapons. For example, a fire-retardant suit may offer excellent protection against a flamethrower but virtually none against bullets.
It's important to note that the cumbersome +Calculation/+Value system used for defining calculations will, in the future, be deprecated in favor of a more efficient scripting system. However, the current system will be kept for backwards compatibility if any mods or campaigns choose to make use of the table.
Please note that the spelling armour.tbl is currently not supported.
This table is one of the Modular Tables and can be extended with xxx-amr.tbm
#Armor Type
Each armor entry begins with #Armor Type and ends with #End. There may be multiple entries in armor.tbl.
$Name:
Defines the name of the armor type. The same name must be used in the $Armor Type entry in order for that ship to use the armor type. Note that Shields may also have an armor type as designated by $Shield Armor Type
- Syntax: String
$Damage Type:
Defines the name for the damage type that is used for the armor type/damage type pairs.
- The same name must be used in the $Damage Type entry (for all weapons that have this damage type) so that the armor can be applied against that particular damage type.
- Each $Damage Type entry must have at least one +Calculation entry
- Syntax:String, name of the damage type
+Calculation:
Defines the used calculation type.
- Calculations per damage types are possible
- Calculations are performed in the order they are defined in the armor.tbl (and -amr.tbm's)
- The "current damage value" is the result of the calculation before it
- The "current damage value" is initially equal to the $Damage value of the weapon that is impacting the armor (provided that the weapon has the same $Damage Type)
- Syntax:String, name of the calculation type
- Valid strings: see List of Calculations
Note that this must be followed by a +Stored Value:, a +Constant:, or a +Value: tag. but only one of the three. This will be the value used by the calculation, so only one source is allowed.
+Stored Value:
The calculation shall use the value stored in the specified memory location (which is stored by a previous calculation)
- One, and only one, of the +Stored Value, +Constant, or +Value entries is required per +Calculation.
- Syntax:Unsigned integer
- Valid Values: 0 through 7
- Values greater than 7 are possible, but are not guaranteed to work as of (Rev 8629)
+Constant:
The calculation shall use a constant float value, that's internally defined in FSO.
- One, and only one, of the +Stored Value, +Constant, or +Value entries is required per +Calculation.
- Syntax:String
- Valid Values:
- base damage
- The calculation shall use the base damage as defined by $Damage
- Note: if +Difficulty Scale Type is set to "first", this returns the base damage times the difficulty scale factor
- current damage
- The calculation shall use the resulting value of the previous calculation as the input value for this calculation
- difficulty factor
- The calculation shall use the difficulty scale factor
- random
- The calculation shall use a random number that's anywhere between 0 and 1
- pi
- The calculation shall use the constant Pi (3.1415...)
- base damage
+Value:
Defines the value used for the defined calculation.
- One, and only one, of the +Stored Value, +Constant, or +Value entries is required per +Calculation.
- Syntax: Float
+Shield Piercing Percentage:
If a ship's shield is setup for this particular damage type (by using $Shield Armor Type), this entry defines the percentage of damage (resulting from the earlier calculations) that will be applied directly to the hull. This has the effect of damaging both the shield and hull for a single impact.
- Syntax: Float
- Valid values: 0 to 1, where 1 is 100%
+Weapon Piercing Effect Start Limit:
Defines the percentage of hull integrity at which weapon piercing effects are started
- Syntax: Float, value from 0 to 100
+Weapon Piercing Type:
Defines the piercing type to use
- Syntax: String
- Valid Values:
- none
- default
- retail
+Difficulty Scale Type:
Dictates how/when the Difficulty damage multiplier is applied to the end result of all calculations
- Syntax: String
- Valid Values:
- first - Difficulty damage multiplier is applied to the base damage before calculations
- last - Difficulty damage multiplier is applied to the result of the calculations
- manual - Difficulty damage multiplier is ignored, and is assumed to be handled elsewhere (such as in a LUA script or a sexp)
- Default: first
$Flags:
Defines the flags affecting this armor type
- Syntax: ( String )
- Valid flags:
- ignore subsystem armor
- If set, FSO will use the hull's armor type against all damage to the subsystem, regardless of any armor type that the subsystem may have
- ignore subsystem armor
#End
Each #Armor Type section must end with #End, no exceptions.
List of Calculations
The following is a list of valid strings to be used with +Calculation.
Note: As of this version +Value may be substituted with +Stored Value or +Constant. Usage of +Value in this section is only for example purposes and is a stand in for whatever source you actually use.
- additive
- Adds +Value to the the current damage value
- multiplicative
- Multiplies the the current damage value by +Value
- exponential
- Raises the current damage value to the power of +Value
- exponential base
- Raises +Value to the power of the current damage value
- cutoff
- If the current damage value is less than +Value, then the resulting damage value is 0.
- reverse cutoff
- If the current damage value is greater than +Value, then the resulting damage value is 0.
- instant cutoff
- If the current damage value is less than the specified amount, then the resulting damage value is set to 0 and the engine ignores all following calculations
- instant reverse cutoff
- If the current damage value is greater than the specified amount, then the resulting damage value is set to 0 and the engine ignores all following calculations.
- cap
- instant cap
- If the current damage value is greater than the specified amount, then the resulting damage value is set to +Value and the engine ignores all following calculations.
- set
- Sets the damage value to +Value.
- store
- Stores the current damage value to a memory location specified by +Value (which is casted as an unsigned integer)
- Stored damage values may be used only in the calculations they are assigned, and are discarded after the calculations are finished
- load
- Loads the current damage value from a memory location specified by +Value (which is casted as an unsigned integer)
- Stored damage values may be used only in the calculations they are assigned, and are discarded after the calculations are finished
- random
- Randomizes the damage value to anything between the current damage value and the base damage value as defined by $Damage
Example
#Armor Type $Name: Reflective ;;This armor is made up of some kind of reflective material, ;;that deflects 1/4 of the energy from laser weapons back into space. ;;However, it is somewhat more fragile than typical hull materials, ;;and takes 1/3 more damage from weapons that use physical projectiles. $Damage Type: Laser +Calculation: Multiplicative +Value: 0.75 $Damage Type: Kinetic +Calculation: Multiplicative +Value: 1.33 #End
As you can see above, "Reflective" armor is dealt only 75% of the damage from laser weapons, but 133% of the damage from kinetic weapons. However, in order to activate the armor system, you must assign the armor type to the ships you want it to apply to, and damage types to the weapons you wish to use.
The Thoth fighter seems like a good choice for this armor. Its speed and maneuverability give it the ability to evade missiles, and many direct-fire weapons are energy based. So, to give it this armor, you would add "$Armor Type:" to ships.tbl, under the "Thoth" entry:
$Hitpoints: 200 $Armor Type: Reflective $Flags: ( "player_ship" "fighter" "in tech database")
At this point, the Thoth will be equipped with Reflective armor. However, it will have no effect unlesss it is hit by a weapon with a "$Damage Type" that is defined in armor.tbl, under the "Reflective" armor entry. Otherwise, Freespace 2 would have no idea how to take into account the defined damage types.
So, in the interests of time, here's how you would assign the "Laser" damage type to the Subach HL-7, and the "Kinetic" damage type to the Rockeye.
Under the Subach entry, you would add "$Damage Type" like so:
$Damage: 15 $Damage Type: Laser $Armor Factor: 0.9
Under the Rockeye entry, you would add "$Damage Type" like this:
$Damage: 45 $Damage Type: Kinetic $Armor Factor: 0.1
Now, if you were to start FreeSpace 2 with these modifications, you would find that the Thoth would take 3/4 as much damage from the Subach HL-7, 1/3 more damage from the Rockeye, but normal damage from everything else. All other ships, not being equipped with any kind of armor, would also be dealt normal damage from all weapons, including the Rockeye and the Subach.