XML:TURR: Difference between revisions
m (Edition -> AE)  | 
				m (using Image: consistently to make it easier to find all image refs on a page)  | 
				||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{XML_File_Header | type=TURR   | {{XML_File_Header | prev=TSFF | type=TURR | next=TXCA | name=Turret}}  | ||
==  | ==General information==  | ||
* The   | * The XML on this page is compatible with OniSplit '''v0.9.61.0''' and '''0.9.68.0'''.  | ||
* TURR   | * TURR files are stored globally in level0_Final.dat.  | ||
* M3GM <BaseGeometry> isn't used  | * TURR instances for a level are stored in [[XML:BINA/OBJC/TURR|BINACJBOTurret]].  | ||
* The M3GM in <BaseGeometry> isn't used; instead the turret body is part of the AKEV level geometry.  | |||
==File structure==  | |||
[[Image:TURR_geometries.png|200px|right|thumb|Extracted DAE in XSI.]]  | |||
  TURR  |   TURR  | ||
    |    |     |    | ||
    +-- M3GM <BaseGeometry> (not used  |     +-- M3GM <BaseGeometry> (not used; turret body must be part of the AKEV level geometry)  | ||
    |     |  |     |     |  | ||
    |     +-- PNTA <Points>  |     |     +-- PNTA <Points>  | ||
| Line 32: | Line 30: | ||
        [...]  |         [...]  | ||
==XML tags==  | |||
===<TURR>===  | |||
===  | |||
{| class="wikitable" width="100%"  | {| class="wikitable" width="100%"  | ||
!width=150px| XML tag  | !width=150px| XML tag  | ||
!width=120px|   | !width=120px| Content type  | ||
!   | ! Description  | ||
|-  | |-  | ||
| width=200px| <Name>  | | width=200px| <Name>  | ||
| width=40px| char[64]  | | width=40px| char[64]  | ||
|   | | File name, without prefix "TURR" and suffix ".oni".  | ||
|-  | |-  | ||
| <ParticleCount>  | | <ParticleCount>  | ||
| int16  | | int16  | ||
|   | | Number of <TURRParticle>s that are actually used.  | ||
|-  | |-  | ||
| <Offset_0058>  | | <Offset_0058>  | ||
| Line 80: | Line 75: | ||
| <ArmTranslation>  | | <ArmTranslation>  | ||
| float  | | float  | ||
|   | | XYZ translation for turret head (body-relative).  | ||
|-  | |-  | ||
| <WeaponTranslation>  | | <WeaponTranslation>  | ||
| float  | | float  | ||
|   | | XYZ translation for turret gun (head-relative).  | ||
|-  | |-  | ||
| <Particles>  | | <Particles>  | ||
|  | |  | ||
|   | | Holds 16 <TURRParticle>s, though only 2 or 3 will be used and the rest will be placeholders.  | ||
|-  | |-  | ||
| <TURRParticle>  | | <TURRParticle>  | ||
|  | |  | ||
|   | | See [[#<TURRParticle>|THIS]] section below.  | ||
|-  | |-  | ||
| <FiringMode>  | | <FiringMode>  | ||
|  | |  | ||
|   | | See [[#<FiringMode>|THIS]] section below.  | ||
|-  | |-  | ||
| <Targeting>  | | <Targeting>  | ||
|  | |  | ||
|   | | See [[#<Targeting>|THIS]] section below.  | ||
|-  | |-  | ||
| <WeaponSkill>  | | <WeaponSkill>  | ||
|  | |  | ||
|   | | See [[#<WeaponSkill>|THIS]] section below.  | ||
|-  | |-  | ||
| <Timeout>  | | <Timeout>  | ||
| int32  | | int32  | ||
|   | | Timeout in frames.  | ||
|-  | |-  | ||
| <MinElevation>  | | <MinElevation>  | ||
| float  | | float  | ||
|   | | Minimum elevation in radians.  | ||
|-  | |-  | ||
| <MaxElevation>  | | <MaxElevation>  | ||
| float  | | float  | ||
|   | | Maximum elevation in radians.  | ||
|-  | |-  | ||
| <MinAzimuth>  | | <MinAzimuth>  | ||
| float  | | float  | ||
|   | | Minimum azimuth in radians.  | ||
|-  | |-  | ||
| <MaxAzimuth>  | | <MaxAzimuth>  | ||
| float  | | float  | ||
|   | | Maximum azimuth in radians.  | ||
|-  | |-  | ||
| <MaxVerticalSpeed>  | | <MaxVerticalSpeed>  | ||
| float  | | float  | ||
|   | | Maximum vertical speed in radians per frame.  | ||
|-  | |-  | ||
| <MaxHorizontalSpeed>  | | <MaxHorizontalSpeed>  | ||
| float  | | float  | ||
|   | | Maximum horizontal speed in radians per frame.  | ||
|-  | |-  | ||
| <ActiveSound>  | | <ActiveSound>  | ||
| Line 139: | Line 134: | ||
|}  | |}  | ||
===<TURRParticle>===  | |||
{| class="wikitable" width="100%"  | {| class="wikitable" width="100%"  | ||
!width=150px| XML tag  | !width=150px| XML tag  | ||
!width=120px|   | !width=120px| Content type  | ||
!   | ! Description  | ||
|-  | |-  | ||
|width=200px| <ParticleClass>  | |width=200px| <ParticleClass>  | ||
|width=40px| link  | |width=40px| link  | ||
|   | | Particle file name without file prefix BINA3RAP and suffix .oni  | ||
|-  | |-  | ||
| <ShotFrequency>  | | <ShotFrequency>  | ||
| int32  | | int32  | ||
|   | | Delay between shots in frames.  | ||
|-  | |-  | ||
| valign=top | <FiringModeOwner>  | | valign=top | <FiringModeOwner>  | ||
| Line 163: | Line 157: | ||
| <Transform>  | | <Transform>  | ||
| float  | | float  | ||
|   | | Coefficients of transform matrix: x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4  | ||
|}  | |}  | ||
===<FiringMode>===  | |||
{| class="wikitable" width="100%"  | {| class="wikitable" width="100%"  | ||
!width=150px| XML tag  | !width=150px| XML tag  | ||
!width=120px|   | !width=120px| Content type  | ||
!   | ! Description  | ||
|-  | |-  | ||
|width=200px| <Flags>  | |width=200px| <Flags>  | ||
| Line 179: | Line 172: | ||
| <InverseDirection>  | | <InverseDirection>  | ||
| matrix4x3  | | matrix4x3  | ||
|   | | Targeting inverse transform matrix - the inverse of the matrix that gives the targeting direction  | ||
|-  | |-  | ||
| <Direction>  | | <Direction>  | ||
| vector3  | | vector3  | ||
|   | | Targeting direction  | ||
|-  | |-  | ||
| <Origin>  | | <Origin>  | ||
| vector3  | | vector3  | ||
|   | | Targeting origin  | ||
|-  | |-  | ||
| <PredictionSpeed>  | | <PredictionSpeed>  | ||
| float  | | float  | ||
|   | | Prediction speed  | ||
|-  | |-  | ||
| <MaxInaccuracyAngle>  | | <MaxInaccuracyAngle>  | ||
| float  | | float  | ||
|   | | Inaccuracy tolerance; always 0 for TURR .  | ||
|-  | |-  | ||
| <AimRadius>  | | <AimRadius>  | ||
| float  | | float  | ||
|   | | Aim radius; always the same for TURR and ONWC.  | ||
|-  | |-  | ||
| <AISoundRadius>  | | <AISoundRadius>  | ||
| float  | | float  | ||
|   | | Sound sphere radius; always the same for TURR.  | ||
|-  | |-  | ||
| <MinShootingDistance>  | | <MinShootingDistance>  | ||
| float  | | float  | ||
|   | | Minimum shooting distance; always 0 for TURR.  | ||
|-  | |-  | ||
| <MaxShootingDistance>  | | <MaxShootingDistance>  | ||
| float  | | float  | ||
|   | | Maximum shooting distance; always 0 for TURR.  | ||
|-  | |-  | ||
| <MaxStartleMisses>  | | <MaxStartleMisses>  | ||
| int16  | | int16  | ||
|   | | Maximum startle misses.  | ||
|-  | |-  | ||
| <SkillIndex>  | | <SkillIndex>  | ||
| int16  | | int16  | ||
| AI shooting skill ID; always 0 for TURR  | | AI shooting skill ID; always 0 for TURR.  | ||
|-  | |-  | ||
| <FightTimer>  | | <FightTimer>  | ||
| int16  | | int16  | ||
|   | | Fight timer; always 0 for TURR; 240 for ONWCw4_psm, 200 for ONWCv6_vdg.  | ||
|-  | |-  | ||
| <ProjectileSpeed>  | | <ProjectileSpeed>  | ||
| float  | | float  | ||
|   | | Ballistic projectile speed (150 for ONWCw5_sbg, 160 for w11_ba1); always 0 for TURR .  | ||
|-  | |-  | ||
| <ProjectileGravity>  | | <ProjectileGravity>  | ||
| float  | | float  | ||
|   | | Ballistic projectile gravity (0.5 for ONWCw5_sbg, 0.3 for w11_ba1); always 0 for TURR.  | ||
|-  | |-  | ||
| <FireSpreadLength>  | | <FireSpreadLength>  | ||
| float  | | float  | ||
|   | | Length of firing spread; always 0 for TURR.  | ||
|-  | |-  | ||
| <FireSpreadWidth>  | | <FireSpreadWidth>  | ||
| flaot  | | flaot  | ||
|   | | Width of firing spread; always 0 for TURR.  | ||
|-  | |-  | ||
| <FireSpreadSkew>  | | <FireSpreadSkew>  | ||
| float  | | float  | ||
|   | | Skew angle of firing spread; always 0 for TURR.  | ||
|}  | |}  | ||
===<Targeting>===  | |||
{| class="wikitable" width="100%"  | {| class="wikitable" width="100%"  | ||
!width=150px| XML tag  | !width=150px| XML tag  | ||
!width=120px|   | !width=120px| Content type  | ||
!   | ! Description  | ||
|-  | |-  | ||
|width=200px| <StartleMissAngle>  | |width=200px| <StartleMissAngle>  | ||
| width=40px| float  | | width=40px| float  | ||
|   | | Always the same for TURR and ONCC (0.5).  | ||
|-  | |-  | ||
| <StartleMissDistance>  | | <StartleMissDistance>  | ||
| float  | | float  | ||
|   | | Always the same for TURR and ONCC (25).  | ||
|-  | |-  | ||
| <PredictAmount>  | | <PredictAmount>  | ||
| float  | | float  | ||
|   | | Always the same for TURR (1.0).  | ||
|-  | |-  | ||
| <PredictPositionDelayFrames>  | | <PredictPositionDelayFrames>  | ||
| int32  | | int32  | ||
|   | | Always the same for TURR (0).  | ||
|-  | |-  | ||
| <PredictDelayFrames>  | | <PredictDelayFrames>  | ||
| int32  | | int32  | ||
|   | | Always the same for TURR (5).  | ||
|-  | |-  | ||
| <PredictVelocityFrames>  | | <PredictVelocityFrames>  | ||
| int32  | | int32  | ||
|   | | Always the same for TURR (15).  | ||
|-  | |-  | ||
| <PredictTrendFrames>  | | <PredictTrendFrames>  | ||
| int32  | | int32  | ||
|   | | Always the same for TURR (60).  | ||
|}  | |}  | ||
===<WeaponSkill>===  | |||
All the TURRs have the same shooting skill settings.  | |||
All the   | |||
{| class="wikitable" width="100%"  | {| class="wikitable" width="100%"  | ||
!width=150px| XML tag  | !width=150px| XML tag  | ||
!width=120px|   | !width=120px| Content type  | ||
!   | ! Description  | ||
|-  | |-  | ||
|width=200px| <RecoilCompensation>  | |width=200px| <RecoilCompensation>  | ||
|width=40px| float  | |width=40px| float  | ||
|   | | Min = 0.0, max = 1.0  | ||
|-         | |-         | ||
| <BestAimingAngle>  | | <BestAimingAngle>  | ||
| float  | | float  | ||
|   | | Best aiming angle, in radians.  | ||
|-  | |-  | ||
| <ShotGroupError>  | | <ShotGroupError>  | ||
| float  | | float  | ||
|   | | Shot grouping error.  | ||
|-  | |-  | ||
| <ShotGroupDecay>  | | <ShotGroupDecay>  | ||
| float  | | float  | ||
|   | | Shot grouping decay.  | ||
|-  | |-  | ||
| <ShootingInaccuracyMultiplier>  | | <ShootingInaccuracyMultiplier>  | ||
| float  | | float  | ||
|   | | Shooting inaccuracy multiplier.  | ||
|-  | |-  | ||
| <MinShotDelay>  | | <MinShotDelay>  | ||
| uint16  | | uint16  | ||
|   | | Minimum delay between shots in frames.  | ||
|-  | |-  | ||
| <MaxShotDelay>  | | <MaxShotDelay>  | ||
| uint16  | | uint16  | ||
|   | | Maximum delay between shots in frames.  | ||
|}  | |}  | ||
==Vanilla classes==  | |||
[[Image:XSI_ModTool_VanillaTURRs.jpg|400px|thumb]]  | |||
==  | ==3D model==  | ||
===  | ===Export (new method)===  | ||
With OniSplit '''v0.9.94.0+''' (and possibly a few older versions), you can extract the DAE together with the XML from the .oni.  | |||
:    onisplit -extract:xml output_folder input_folder\TURRfile.oni  | |||
You would need to   | ===Export (old method)===  | ||
You would need to trim the TURR instance so that only the M3GM and its connected instances remain, and save that as a .oni file.  | |||
:    onisplit -extract:xml output_folder input_folder\TURRfile.oni  | :    onisplit -extract:xml output_folder input_folder\TURRfile.oni  | ||
:    onisplit -create output_folder input_folder\cutfile.xml  | :    onisplit -create output_folder input_folder\cutfile.xml  | ||
Version advice:  | |||
:   | : OniSplit v0.9.61.0 and v0.9.68.0 can extract M3GM only as OBJ.  | ||
:   | : OniSplit [http://mods.oni2.net/node/38 v0.9.41.0] can extract M3GM as OBJ or DAE.  | ||
Convert the M3GMfile.oni to   | Convert the M3GMfile.oni to OBJ:  | ||
:    onisplit -extract:obj output_folder input_folder\M3GMfile.oni  | :    onisplit -extract:obj output_folder input_folder\M3GMfile.oni  | ||
===Import (new method)===  | |||
There's a bug in OniSplit: before you can convert the DAE and XML back into a .oni, you must clean up some tags in the XML file.  | |||
For example, looking at TURRvdg_turret_wall.xml…  | |||
 <ParticleCount>4</ParticleCount>  | |||
…that means 4 <ParticleClass> are used and the rest are not. However, those unused elements contain garbage like "<ParticleClass>�ޭޭޭޭޭޭޭ�</ParticleClass>". Remove that content, making it "<ParticleClass></ParticleClass>". Then you can re-import.  | |||
You can create M3GM meshes from   | ===Import (old method)===  | ||
You can replace the M3GM content with data from another M3GM.  | |||
You first create M3GM meshes from OBJ files.  | |||
: onisplit -create:m3gm output_folder -tex:weapon_tex input_folder/weapon.obj  | : onisplit -create:m3gm output_folder -tex:weapon_tex input_folder/weapon.obj  | ||
:: -tex is optional    | :: -tex is optional    | ||
:: The TXMP file must created separately (if needed).    | :: The TXMP file must created separately (if needed).    | ||
Then you can convert the file to   | Then you can convert the file to XML and replace the TURR's old M3GM XML code. Remember to change the links (#N) and instance IDs of the new data.  | ||
Remember to change the links (#N) and instance IDs of the new data.  | |||
{{XML}}  | {{XML}}  | ||
Latest revision as of 17:38, 21 February 2022
| TURR : Turret |  
 | |
|---|---|---|
| XML
 TSFF << Other file types >> TXCA  | 
General information
- The XML on this page is compatible with OniSplit v0.9.61.0 and 0.9.68.0.
 - TURR files are stored globally in level0_Final.dat.
 - TURR instances for a level are stored in BINACJBOTurret.
 - The M3GM in <BaseGeometry> isn't used; instead the turret body is part of the AKEV level geometry.
 
File structure
TURR
  | 
  +-- M3GM <BaseGeometry> (not used; turret body must be part of the AKEV level geometry)
  |     |
  |     +-- PNTA <Points>
  |     +-- VCRA <VertexNormals>
  |     +-- VCRA <FaceNormals>
  |     +-- TXCA <TextureCoordinates>
  |     +-- IDXA <TriangleStrips>
  |     +-- IDXA <FaceNormalIndices>
  |     +-- TXMP <Texture> (link to external file)
  |
  +-- M3GM <ArmGeometry>
  |     |
  |   [...]
  |
  +-- M3GM <WeaponGeometry>
        |
      [...]
XML tags
<TURR>
| XML tag | Content type | Description | 
|---|---|---|
| <Name> | char[64] | File name, without prefix "TURR" and suffix ".oni". | 
| <ParticleCount> | int16 | Number of <TURRParticle>s that are actually used. | 
| <Offset_0058> | int16 | ? | 
| <BaseGeometry> | link | M3GM instance number (#N) | 
| <BaseGunkFlags> | flag | ? | 
| <ArmGeometry> | link | M3GM instance number (#N) | 
| <ArmGunkFlags> | flag | ? | 
| <WeaponGeometry> | link | M3GM instance number (#N) | 
| <WeaponGunkFlags> | flag | ? | 
| <ArmTranslation> | float | XYZ translation for turret head (body-relative). | 
| <WeaponTranslation> | float | XYZ translation for turret gun (head-relative). | 
| <Particles> | Holds 16 <TURRParticle>s, though only 2 or 3 will be used and the rest will be placeholders. | |
| <TURRParticle> | See THIS section below. | |
| <FiringMode> | See THIS section below. | |
| <Targeting> | See THIS section below. | |
| <WeaponSkill> | See THIS section below. | |
| <Timeout> | int32 | Timeout in frames. | 
| <MinElevation> | float | Minimum elevation in radians. | 
| <MaxElevation> | float | Maximum elevation in radians. | 
| <MinAzimuth> | float | Minimum azimuth in radians. | 
| <MaxAzimuth> | float | Maximum azimuth in radians. | 
| <MaxVerticalSpeed> | float | Maximum vertical speed in radians per frame. | 
| <MaxHorizontalSpeed> | float | Maximum horizontal speed in radians per frame. | 
| <ActiveSound> | link | OSBDfile.amb.oni | 
<TURRParticle>
| XML tag | Content type | Description | 
|---|---|---|
| <ParticleClass> | link | Particle file name without file prefix BINA3RAP and suffix .oni | 
| <ShotFrequency> | int32 | Delay between shots in frames. | 
| <FiringModeOwner> | flag | 
  | 
| <Transform> | float | Coefficients of transform matrix: x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4 | 
<FiringMode>
| XML tag | Content type | Description | 
|---|---|---|
| <Flags> | flag | NoWildShots | 
| <InverseDirection> | matrix4x3 | Targeting inverse transform matrix - the inverse of the matrix that gives the targeting direction | 
| <Direction> | vector3 | Targeting direction | 
| <Origin> | vector3 | Targeting origin | 
| <PredictionSpeed> | float | Prediction speed | 
| <MaxInaccuracyAngle> | float | Inaccuracy tolerance; always 0 for TURR . | 
| <AimRadius> | float | Aim radius; always the same for TURR and ONWC. | 
| <AISoundRadius> | float | Sound sphere radius; always the same for TURR. | 
| <MinShootingDistance> | float | Minimum shooting distance; always 0 for TURR. | 
| <MaxShootingDistance> | float | Maximum shooting distance; always 0 for TURR. | 
| <MaxStartleMisses> | int16 | Maximum startle misses. | 
| <SkillIndex> | int16 | AI shooting skill ID; always 0 for TURR. | 
| <FightTimer> | int16 | Fight timer; always 0 for TURR; 240 for ONWCw4_psm, 200 for ONWCv6_vdg. | 
| <ProjectileSpeed> | float | Ballistic projectile speed (150 for ONWCw5_sbg, 160 for w11_ba1); always 0 for TURR . | 
| <ProjectileGravity> | float | Ballistic projectile gravity (0.5 for ONWCw5_sbg, 0.3 for w11_ba1); always 0 for TURR. | 
| <FireSpreadLength> | float | Length of firing spread; always 0 for TURR. | 
| <FireSpreadWidth> | flaot | Width of firing spread; always 0 for TURR. | 
| <FireSpreadSkew> | float | Skew angle of firing spread; always 0 for TURR. | 
<Targeting>
| XML tag | Content type | Description | 
|---|---|---|
| <StartleMissAngle> | float | Always the same for TURR and ONCC (0.5). | 
| <StartleMissDistance> | float | Always the same for TURR and ONCC (25). | 
| <PredictAmount> | float | Always the same for TURR (1.0). | 
| <PredictPositionDelayFrames> | int32 | Always the same for TURR (0). | 
| <PredictDelayFrames> | int32 | Always the same for TURR (5). | 
| <PredictVelocityFrames> | int32 | Always the same for TURR (15). | 
| <PredictTrendFrames> | int32 | Always the same for TURR (60). | 
<WeaponSkill>
All the TURRs have the same shooting skill settings.
| XML tag | Content type | Description | 
|---|---|---|
| <RecoilCompensation> | float | Min = 0.0, max = 1.0 | 
| <BestAimingAngle> | float | Best aiming angle, in radians. | 
| <ShotGroupError> | float | Shot grouping error. | 
| <ShotGroupDecay> | float | Shot grouping decay. | 
| <ShootingInaccuracyMultiplier> | float | Shooting inaccuracy multiplier. | 
| <MinShotDelay> | uint16 | Minimum delay between shots in frames. | 
| <MaxShotDelay> | uint16 | Maximum delay between shots in frames. | 
Vanilla classes
3D model
Export (new method)
With OniSplit v0.9.94.0+ (and possibly a few older versions), you can extract the DAE together with the XML from the .oni.
- onisplit -extract:xml output_folder input_folder\TURRfile.oni
 
Export (old method)
You would need to trim the TURR instance so that only the M3GM and its connected instances remain, and save that as a .oni file.
- onisplit -extract:xml output_folder input_folder\TURRfile.oni
 - onisplit -create output_folder input_folder\cutfile.xml
 
Version advice:
- OniSplit v0.9.61.0 and v0.9.68.0 can extract M3GM only as OBJ.
 - OniSplit v0.9.41.0 can extract M3GM as OBJ or DAE.
 
Convert the M3GMfile.oni to OBJ:
- onisplit -extract:obj output_folder input_folder\M3GMfile.oni
 
Import (new method)
There's a bug in OniSplit: before you can convert the DAE and XML back into a .oni, you must clean up some tags in the XML file.
For example, looking at TURRvdg_turret_wall.xml…
<ParticleCount>4</ParticleCount>
…that means 4 <ParticleClass> are used and the rest are not. However, those unused elements contain garbage like "<ParticleClass>�ޭޭޭޭޭޭޭ�</ParticleClass>". Remove that content, making it "<ParticleClass></ParticleClass>". Then you can re-import.
Import (old method)
You can replace the M3GM content with data from another M3GM.
You first create M3GM meshes from OBJ files.
- onisplit -create:m3gm output_folder -tex:weapon_tex input_folder/weapon.obj
- -tex is optional
 - The TXMP file must created separately (if needed).
 
 
Then you can convert the file to XML and replace the TURR's old M3GM XML code. Remember to change the links (#N) and instance IDs of the new data.
