19,703
edits
m (correcting prev/next types in nav header)  | 
				m (copy-edit)  | 
				||
| Line 1: | Line 1: | ||
{{XML_File_Header | prev=TSFF | type=TURR | next=TXCA | name=Turret}}  | {{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.  | ||
* TURR   | * TURR instances for a level are stored in [[XML:BINA/OBJC/TURR|BINACJBOTurret]].  | ||
* M3GM <BaseGeometry> isn't used  | * 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.]]  | ||
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 34: | 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 82: | 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 141: | 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 165: | 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 181: | 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==  | |||
[[File:XSI_ModTool_VanillaTURRs.jpg|400px|thumb]]  | [[File: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   | 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  | :    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.  | |||
You would need to   | |||
:    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…  | |||
For example TURRvdg_turret_wall.  | |||
  <ParticleCount>4</ParticleCount>  |   <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.  | |||
Then you can re-  | |||
===  | ===Import (old method)===  | ||
You can replace the M3GM content with data from another M3GM.  | |||
You   | 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}}  | ||