Subobject and subsystem properties: Difference between revisions
should be better nao |
Goober5000 (talk | contribs) →Subobject Properties: elaborate, and add $rvec |
||
| (18 intermediate revisions by 5 users not shown) | |||
| Line 2: | Line 2: | ||
==Important notes== | ==Important notes== | ||
* Subobject/subsystem properties data | * Subobject/subsystem properties data can be parsed in any order. | ||
* Occasionally an option may lack a trailing 'terminating character' like ':' or '=' from its description. In these cases any character can be used as the trailing 'terminating character'. | * Occasionally an option may lack a trailing 'terminating character' like ':' or '=' from its description. In these cases any character can be used as the trailing 'terminating character'. | ||
* Buffer size of 256 is reserved for the characters in properties data. | * Buffer size of 256 is reserved for the characters in properties data. | ||
==Subsystem Properties== | ==Subsystem Properties== | ||
* These can be applied to subsystems | * These can be applied to subsystems, some of which require the subsystem to have an associated subobject. | ||
{| border=0 align=right cellpadding=2 cellspacing=1 style="margin: 0 0 1em 1em; background: #202020; border: 1px #AA2020 solid; border-collapse: collapse; font-size: 95%;" | {| border=0 align=right cellpadding=2 cellspacing=1 style="margin: 0 0 1em 1em; background: #202020; border: 1px #AA2020 solid; border-collapse: collapse; font-size: 95%;" | ||
! colspan="2" style="color: white; height: 30px; background: #512020; 70%;"|'''''Key strings and their order for setting subsystems''''' | ! colspan="2" style="color: white; height: 30px; background: #512020; 70%;"|'''''Key strings and their order for setting subsystems''''' | ||
| Line 63: | Line 63: | ||
===$rotate=== | ===$rotate=== | ||
*Marks the subsystem as a rotating subsystem | *Marks the subsystem as a rotating subsystem | ||
*Defines the rotation time for the subsystem (''float'') | *Defines the rotation time for the subsystem: the number of seconds to make a complete rotation (''float'') | ||
===$rotate_time=== | |||
*Marks the subsystem as a rotating subsystem - alternative to $rotate | |||
*Defines the rotation time for the subsystem: the number of seconds to make a complete rotation (''float'') | |||
===$rotate_rate=== | |||
*Marks the subsystem as a rotating subsystem - alternative to $rotate, with different units | |||
*Defines the rotation rate for the subsystem: the rotational velocity in radians per second (''float'') | |||
{{Table216| | |||
===$rotate_accel=== | |||
*Specifies the acceleration for a rotating or dumb-rotating subobject. If not specified, acceleration is 0.5 radians per second per second (''float'', or ''"instant"'') | |||
}} | |||
====$pbank==== | ====$pbank==== | ||
| Line 71: | Line 84: | ||
====$stepped==== | ====$stepped==== | ||
*Defines the rotation as | *Defines the rotation as a stepped instead of continuous rotation | ||
=====$steps===== | =====$steps===== | ||
*Defines the number of steps | *Defines the number of steps per complete rotation (''integer'') | ||
*Defaults to 8 | *Defaults to 8 | ||
=====$t_paused===== | =====$t_paused===== | ||
*Defines the pause time between steps (''float'') | *Defines the pause time, in seconds, between steps (''float'') | ||
*Defaults to 2 | *Defaults to 2 | ||
=====$t_transit===== | =====$t_transit===== | ||
*Defines the movement time between pauses (''float'') | *Defines the movement time, in seconds, between pauses (''float'') | ||
*Defaults to 2 | *Defaults to 2 | ||
=====$fraction_accel===== | =====$fraction_accel===== | ||
*Defines the fraction of the stepped rotation time used for acceleration (''float'') | *Defines the fraction of the stepped rotation time used for acceleration (''float'') | ||
* | *Must be between 0 .. 0.5 | ||
*Defaults to 0.3 | |||
{{Table224| | |||
===$translate=== | |||
*Marks the subsystem as a translating subsystem | |||
*Defines the translation rate for the subsystem: the linear velocity in meters per second (''float'') | |||
===$translate_rate=== | |||
*Marks the subsystem as a translating subsystem - alternative to $translate | |||
*Defines the translation rate for the subsystem: the linear velocity in meters per second (''float'') | |||
===$translate_accel=== | |||
*Specifies the acceleration for a translating subobject. If not specified, acceleration is 0.5 meters per second per second (''float'', or ''"instant"'') | |||
====$stepped==== | |||
*Defines the translation as a stepped instead of continuous translation | |||
=====$reverse_after_step===== | |||
*Defines whether the subsystem should reverse direction after every step (''boolean'') | |||
*Defaults to true | |||
=====$step_distance===== | |||
*Defines the distance, in meters, covered by one complete step (''float'') | |||
*Defaults to 25 | |||
=====$t_paused===== | |||
*Defines the pause time, in seconds, between steps (''float'') | |||
*Defaults to 2 | |||
=====$t_transit===== | |||
*Defines the movement time, in seconds, between pauses (''float'') | |||
*Defaults to 2 | |||
=====$fraction_accel===== | |||
*Defines the fraction of the stepped translation time used for acceleration (''float'') | |||
*Must be between 0 .. 0.5 | |||
*Defaults to 0.3 | *Defaults to 0.3 | ||
}} | |||
==Subobject Properties== | ==Subobject Properties== | ||
* These can be applied only to subsystem with their own separate subobject. | * These can be applied only to subsystem with their own separate subobject, or subobjects without subsystems. | ||
===$dumb_rotate:=== | ===$dumb_rotate:=== | ||
* Marks the subobject as 'dumb rotating | * Marks the subobject as a 'dumb rotating submodel' (i.e. a submodel that rotates but doesn't require a corresponding subsystem) | ||
* Defines the rotation time (''float'') | * Defines the rotation time for the subobject: the number of seconds to make a complete rotation (''float'') | ||
===$dumb_rotate_time=== | |||
*Marks the subobject as a 'dumb rotating submodel' - alternative to $dumb_rotate | |||
*Defines the rotation time for the subobject: the number of seconds to make a complete rotation (''float'') | |||
===$dumb_rotate_rate=== | |||
*Marks the subobject as a 'dumb rotating submodel' - alternative to $dumb_rotate, with different units | |||
*Defines the rotation rate for the subobject: the rotational velocity in radians per second (''float'') | |||
===$look_at:=== | |||
* Causes the subobject to always "look at" (i.e. point to by rotating on its axis) the origin of another subobject | |||
* ''Integer'' index or ''string'' name of the subobject target | |||
===$look_at_offset:=== | |||
* Defines an angle offset for a '''$look_at:''' submodel | |||
* ''Float'' angle in degrees | |||
* Note: if '''$look_at_offset''' is not specified, it will be set to the submodel's initial position. In other words, the initial position is considered to be the default forward direction. | |||
{{Table250| | |||
In 25.0, if the submodel's '''$fvec'''/'''$uvec''' is specified but '''$look_at_offset''' is not, '''$look_at_offset''' is set to 0 instead of the submodel's initial position. In other words, the '''$fvec'''/'''$uvec''' is considered to determine the forward direction. | |||
}} | |||
===$special=== | ===$special=== | ||
* Defines special attributes for the subobject | * Defines special attributes for the subobject | ||
* String, either '''"subsystem"''' or '''" | * String, either '''"subsystem"''', '''"no_rotate"''' or '''"shieldpoint"''' | ||
===="subsystem"==== | ===="subsystem"==== | ||
| Line 107: | Line 177: | ||
* Valid option if '''subsystem''' string was not used | * Valid option if '''subsystem''' string was not used | ||
* Marks subobject as an object that should not rotate | * Marks subobject as an object that should not rotate | ||
===="shieldpoint"==== | |||
{{Table371| | |||
* Only usable on special points ('''not''' on submodels). | |||
* Marks the special point as a shield point, see [[Model Point Shields]].}} | |||
===$no_collisions=== | ===$no_collisions=== | ||
| Line 124: | Line 199: | ||
====[[Detail box|$box_min:]]==== | ====[[Detail box|$box_min:]]==== | ||
====[[Detail box|$box_max:]]==== | ====[[Detail box|$box_max:]]==== | ||
====$box_offset:==== | |||
{{Table373| | |||
* Optional offset of the detail box from the model center. Without this, the detail box is centered on the submodel. | |||
* Example: '''$offset: 0,0,-100.5''' to make the detail box be positioned 100.5m behind the ship's center.}} | |||
===$detail_sphere:=== | |||
{{Table3615| | |||
* Marks the subsystem as one with detail sphere. Detail spheres work exactly like detail boxes (see above), except that they only define a radius instead of a box.}} | |||
====$radius:==== | |||
{{Table3615| | |||
* Defines the radius of the detail sphere (''float''). If not provided, defaults to the submodel radius.}} | |||
====$offset:==== | |||
{{Table3615| | |||
* Optional offset of the detail sphere from the model center. Without this, the detail sphere is centered on the submodel. | |||
* Example: '''$offset: 0,0,-100.5''' to make the detail sphere be positioned 100.5m behind the ship's center.}} | |||
===$rotation_axis:=== | |||
{{Table202| | |||
* Defines the custom rotation axis of a submodel. The point represents an axis vector in a particular direction, just like the X axis is the {1,0,0} vector. | |||
* Reads three comma separated ''floats'' enclosed in square or curly brackets. It does not need to be a normalized vector. | |||
* '''$rotation_axis''' can be followed by whitespace, a colon, or an equals sign.}} | |||
===$translation_axis:=== | |||
{{Table224| | |||
* Defines the custom translation axis of a submodel. The point represents an axis vector in a particular direction, just like the X axis is the {1,0,0} vector. | |||
* Reads three comma separated ''floats'' enclosed in square or curly brackets. It does not need to be a normalized vector. | |||
* '''$translation_axis''' can be followed by whitespace, a colon, or an equals sign.}} | |||
===$fvec:=== | |||
{{Table3610| | |||
* Defines the forward vector of the orientation matrix for a rotating subsystem. This can be used to create off-axis rotating subsystems or off-axis multipart turrets. (Multiparts with a vertical rotation axis do not need '''$fvec'''/'''$uvec'''/'''$rvec''' specified.) | |||
* Reads three comma separated ''floats''. It does not need to be a normalized vector. | |||
* As of 20.2, '''$fvec''' can be followed by whitespace, a colon, or an equals sign. | |||
* As of 25.0, '''$fvec''' can be specified on its own (without '''$uvec''' or '''$rvec'''), although for certain orientations '''$uvec''' or '''$rvec''' is still necessary.}} | |||
===$uvec:=== | ===$uvec:=== | ||
* Defines the | {{Table3610| | ||
* Reads three comma separated ''floats'' | * Defines the up vector of the orientation matrix for a rotating subsystem. This can be used to create off-axis rotating subsystems or off-axis multipart turrets. (Multiparts with a vertical rotation axis do not need '''$fvec'''/'''$uvec'''/'''$rvec''' specified.) Usually it stands perpendicular to the ship surface. | ||
* | * Reads three comma separated ''floats''. It does not need to be a normalized vector. | ||
* Forces turret normal into the same as the '''$uvec'''. | |||
* As of 20.2, '''$uvec''' can be followed by whitespace, a colon, or an equals sign. | |||
* As of 25.0, '''$rvec''' can be specified in addition, or as an alternative.}} | |||
===$rvec:=== | |||
{{Table250| | |||
* Defines the right vector of the orientation matrix for a rotating subsystem. This can be used to create off-axis rotating subsystems or off-axis multipart turrets. (Multiparts with a vertical rotation axis do not need '''$fvec'''/'''$uvec'''/'''$rvec''' specified.) | |||
* Reads three comma separated ''floats''. It does not need to be a normalized vector. | |||
* Can be specified in addition, or as an alternative, to '''$uvec'''.}} | |||
===$lod0_name=== | |||
* Allows adding LODs to older models and changing from special points to modeled subsystems. | |||
* Example $lod0_name=enginea used on a subobject named engine would allow engineb, engienc, and engined to be used while preserving backward compatibility. | |||
===$ | ===$attach_thrusters=== | ||
* | {{Table3615| | ||
* Allows thrusters associated with this submodel to follow its rotations.}} | |||
{{Warning| | |||
This flag is redundant. This behavior is active regardless of this flag.}} | |||
[[Category:Modding]] | [[Category:Modding]] | ||
Latest revision as of 02:27, 16 April 2025
This page documents the properties that can be applied to subobjects and to subsystems in their respective properties data in the model file.
Important notes
- Subobject/subsystem properties data can be parsed in any order.
- Occasionally an option may lack a trailing 'terminating character' like ':' or '=' from its description. In these cases any character can be used as the trailing 'terminating character'.
- Buffer size of 256 is reserved for the characters in properties data.
Subsystem Properties
- These can be applied to subsystems, some of which require the subsystem to have an associated subobject.
| Key strings and their order for setting subsystems | |
|---|---|
| engine | Engine subsystem |
| radar | Radar dish subsystem |
| turret | Turret subsystem |
| navigation | Navigation subsystem |
| communication | Communication subsystem |
| weapon | Weapon control subsystem |
| sensor | Sensor subsystem |
| solar | Solar panel subsystem |
| gas | Gas collector subsystem |
| activator | unused |
$name
- Defines the alternate name for the subsystem (string)
- Alternate subsystem names offer an alternative option for setting this via ships.tbl file or via mission data.
$fov
- Valid only if the true subobject name (not the alternate defined above) contains string "turret" but not strings "radar" or "engine"
- Defines the firing arc of the turret in degrees (integer)
- Defaults to 180 degrees if omitted.
$crewspot
- Valid only if the true subobject name (not the alternate defined above) contains string "turret" but not strings "radar" or "engine"
- Marks the turret as 'crewspot'
- Defines the name of the crewspot (string)
- No actual function
$triggered:
- Defines the subsystem as a rotating subsystem which can be triggered (animated) via Animation Code
$rotate
- Marks the subsystem as a rotating subsystem
- Defines the rotation time for the subsystem: the number of seconds to make a complete rotation (float)
$rotate_time
- Marks the subsystem as a rotating subsystem - alternative to $rotate
- Defines the rotation time for the subsystem: the number of seconds to make a complete rotation (float)
$rotate_rate
- Marks the subsystem as a rotating subsystem - alternative to $rotate, with different units
- Defines the rotation rate for the subsystem: the rotational velocity in radians per second (float)
FS2 Open, 22.0:
$rotate_accel
- Specifies the acceleration for a rotating or dumb-rotating subobject. If not specified, acceleration is 0.5 radians per second per second (float, or "instant")
$pbank
- Marks the rotation as primary weapon rotation
- Defines the associated weapon bank (integer)
$stepped
- Defines the rotation as a stepped instead of continuous rotation
$steps
- Defines the number of steps per complete rotation (integer)
- Defaults to 8
$t_paused
- Defines the pause time, in seconds, between steps (float)
- Defaults to 2
$t_transit
- Defines the movement time, in seconds, between pauses (float)
- Defaults to 2
$fraction_accel
- Defines the fraction of the stepped rotation time used for acceleration (float)
- Must be between 0 .. 0.5
- Defaults to 0.3
FS2 Open, 23.0:
$translate
- Marks the subsystem as a translating subsystem
- Defines the translation rate for the subsystem: the linear velocity in meters per second (float)
$translate_rate
- Marks the subsystem as a translating subsystem - alternative to $translate
- Defines the translation rate for the subsystem: the linear velocity in meters per second (float)
$translate_accel
- Specifies the acceleration for a translating subobject. If not specified, acceleration is 0.5 meters per second per second (float, or "instant")
$stepped
- Defines the translation as a stepped instead of continuous translation
$reverse_after_step
- Defines whether the subsystem should reverse direction after every step (boolean)
- Defaults to true
$step_distance
- Defines the distance, in meters, covered by one complete step (float)
- Defaults to 25
$t_paused
- Defines the pause time, in seconds, between steps (float)
- Defaults to 2
$t_transit
- Defines the movement time, in seconds, between pauses (float)
- Defaults to 2
$fraction_accel
- Defines the fraction of the stepped translation time used for acceleration (float)
- Must be between 0 .. 0.5
- Defaults to 0.3
Subobject Properties
- These can be applied only to subsystem with their own separate subobject, or subobjects without subsystems.
$dumb_rotate:
- Marks the subobject as a 'dumb rotating submodel' (i.e. a submodel that rotates but doesn't require a corresponding subsystem)
- Defines the rotation time for the subobject: the number of seconds to make a complete rotation (float)
$dumb_rotate_time
- Marks the subobject as a 'dumb rotating submodel' - alternative to $dumb_rotate
- Defines the rotation time for the subobject: the number of seconds to make a complete rotation (float)
$dumb_rotate_rate
- Marks the subobject as a 'dumb rotating submodel' - alternative to $dumb_rotate, with different units
- Defines the rotation rate for the subobject: the rotational velocity in radians per second (float)
$look_at:
- Causes the subobject to always "look at" (i.e. point to by rotating on its axis) the origin of another subobject
- Integer index or string name of the subobject target
$look_at_offset:
- Defines an angle offset for a $look_at: submodel
- Float angle in degrees
- Note: if $look_at_offset is not specified, it will be set to the submodel's initial position. In other words, the initial position is considered to be the default forward direction.
FS2 Open, 25.0:
In 25.0, if the submodel's $fvec/$uvec is specified but $look_at_offset is not, $look_at_offset is set to 0 instead of the submodel's initial position. In other words, the $fvec/$uvec is considered to determine the forward direction.
$special
- Defines special attributes for the subobject
- String, either "subsystem", "no_rotate" or "shieldpoint"
"subsystem"
- subsystem marks the subobject as an subsystem
"no_rotate"
- Valid option if subsystem string was not used
- Marks subobject as an object that should not rotate
"shieldpoint"
FS2 Open, 3.7.2:
- Only usable on special points (not on submodels).
- Marks the special point as a shield point, see Model Point Shields.
$no_collisions
- Prevents collision detection from occurring on this subobject and all of its children (recursively).
$nocollide_this_only
- Prevents collision detection from occurring on this subobject only (children collide normally).
$collide_invisible
- Allows full collision detection for things painted with the special "invisible" texture (normally ships collide but weapons do not)
$gun_rotation:
- Marks the submodel as using gun rotation
$detail_box:
- Marks the subsystem as one with detail box
$box_min:
$box_max:
$box_offset:
FS2 Open, 3.7.4:
- Optional offset of the detail box from the model center. Without this, the detail box is centered on the submodel.
- Example: $offset: 0,0,-100.5 to make the detail box be positioned 100.5m behind the ship's center.
$detail_sphere:
FS2 Open, 3.6.16:
- Marks the subsystem as one with detail sphere. Detail spheres work exactly like detail boxes (see above), except that they only define a radius instead of a box.
$radius:
FS2 Open, 3.6.16:
- Defines the radius of the detail sphere (float). If not provided, defaults to the submodel radius.
$offset:
FS2 Open, 3.6.16:
- Optional offset of the detail sphere from the model center. Without this, the detail sphere is centered on the submodel.
- Example: $offset: 0,0,-100.5 to make the detail sphere be positioned 100.5m behind the ship's center.
$rotation_axis:
FS2 Open, 21.0:
- Defines the custom rotation axis of a submodel. The point represents an axis vector in a particular direction, just like the X axis is the {1,0,0} vector.
- Reads three comma separated floats enclosed in square or curly brackets. It does not need to be a normalized vector.
- $rotation_axis can be followed by whitespace, a colon, or an equals sign.
$translation_axis:
FS2 Open, 23.0:
- Defines the custom translation axis of a submodel. The point represents an axis vector in a particular direction, just like the X axis is the {1,0,0} vector.
- Reads three comma separated floats enclosed in square or curly brackets. It does not need to be a normalized vector.
- $translation_axis can be followed by whitespace, a colon, or an equals sign.
$fvec:
FS2 Open 3.6.10:
- Defines the forward vector of the orientation matrix for a rotating subsystem. This can be used to create off-axis rotating subsystems or off-axis multipart turrets. (Multiparts with a vertical rotation axis do not need $fvec/$uvec/$rvec specified.)
- Reads three comma separated floats. It does not need to be a normalized vector.
- As of 20.2, $fvec can be followed by whitespace, a colon, or an equals sign.
- As of 25.0, $fvec can be specified on its own (without $uvec or $rvec), although for certain orientations $uvec or $rvec is still necessary.
$uvec:
FS2 Open 3.6.10:
- Defines the up vector of the orientation matrix for a rotating subsystem. This can be used to create off-axis rotating subsystems or off-axis multipart turrets. (Multiparts with a vertical rotation axis do not need $fvec/$uvec/$rvec specified.) Usually it stands perpendicular to the ship surface.
- Reads three comma separated floats. It does not need to be a normalized vector.
- Forces turret normal into the same as the $uvec.
- As of 20.2, $uvec can be followed by whitespace, a colon, or an equals sign.
- As of 25.0, $rvec can be specified in addition, or as an alternative.
$rvec:
FS2 Open, 25.0:
- Defines the right vector of the orientation matrix for a rotating subsystem. This can be used to create off-axis rotating subsystems or off-axis multipart turrets. (Multiparts with a vertical rotation axis do not need $fvec/$uvec/$rvec specified.)
- Reads three comma separated floats. It does not need to be a normalized vector.
- Can be specified in addition, or as an alternative, to $uvec.
$lod0_name
- Allows adding LODs to older models and changing from special points to modeled subsystems.
- Example $lod0_name=enginea used on a subobject named engine would allow engineb, engienc, and engined to be used while preserving backward compatibility.
$attach_thrusters
FS2 Open, 3.6.16:
- Allows thrusters associated with this submodel to follow its rotations.
Warning:
This flag is redundant. This behavior is active regardless of this flag.