XML:TURR: Difference between revisions

From OniGalore
Jump to navigation Jump to search
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 | prev=TRSC | next=TXMB | name=Turret class }}
{{XML_File_Header | prev=TSFF | type=TURR | next=TXCA | name=Turret}}


===general information===
==General information==
* The xml code on this page is compatible with onisplit '''v0.9.61.0''' and '''0.9.68.0'''
* The XML on this page is compatible with OniSplit '''v0.9.61.0''' and '''0.9.68.0'''.
* TURR file are stored globally (in AE/AEInstaller/vanilla/level0_Final.dat)
* TURR files are stored globally in level0_Final.dat.
* M3GM <BaseGeometry> isn't used, the turret pod is part of the AKEV level geometry
* 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==
===file structure===
[[Image:TURR_geometries.png|200px|right|thumb|Extracted DAE in XSI.]]
{| border=0 cellspacing=20 cellpadding=0 style="float:right"
| the 3 exported M3GM instances<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/TURR_Geometries.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/TURR_Geometries_tn.png]
|}


  TURR
  TURR
   |  
   |  
   +-- M3GM <BaseGeometry> (not used, turret pod must be part of the AKEV level geometry)
   +-- M3GM <BaseGeometry> (not used; turret body must be part of the AKEV level geometry)
   |    |
   |    |
   |    +-- PNTA <Points>
   |    +-- PNTA <Points>
Line 32: Line 30:
       [...]
       [...]


 
==XML tags==
===XML tags===
===<TURR>===
 
====TURR====
 
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
| width=200px| <Name>
| width=200px| <Name>
| width=40px| char[64]
| width=40px| char[64]
| file name without file prefix TURR and suffix .oni
| File name, without prefix "TURR" and suffix ".oni".
|-
|-
| <ParticleCount>
| <ParticleCount>
| int16
| int16
| number of <TURRParticle> that are actually used
| Number of <TURRParticle>s that are actually used.
|-
|-
| <Offset_0058>
| <Offset_0058>
Line 80: Line 75:
| <ArmTranslation>
| <ArmTranslation>
| float
| float
| X Y Z translation for turret head (body-relative)
| XYZ translation for turret head (body-relative).
|-
|-
| <WeaponTranslation>
| <WeaponTranslation>
| float
| float
| X Y Z translation for turret gun (head-relative)
| XYZ translation for turret gun (head-relative).
|-
|-
| <Particles>
| <Particles>
|
|
| holds 16 <TURRParticle>
| Holds 16 <TURRParticle>s, though only 2 or 3 will be used and the rest will be placeholders.
|-
|-
| <TURRParticle>
| <TURRParticle>
|
|
| see [[#<TURRParticle>|HERE]]
| See [[#<TURRParticle>|THIS]] section below.
|-
|-
| <FiringMode>
| <FiringMode>
|
|
| see [[#<FiringMode>|HERE]]
| See [[#<FiringMode>|THIS]] section below.
|-
|-
| <Targeting>
| <Targeting>
|
|
| see [[#<Targeting>|HERE]]
| See [[#<Targeting>|THIS]] section below.
|-
|-
| <WeaponSkill>
| <WeaponSkill>
|
|
| see [[#<WeaponSkill>|HERE]]
| See [[#<WeaponSkill>|THIS]] section below.
|-
|-
| <Timeout>
| <Timeout>
| int32
| int32
| timeout in frames
| Timeout in frames.
|-
|-
| <MinElevation>
| <MinElevation>
| float
| float
| minimum elevation in radians
| Minimum elevation in radians.
|-
|-
| <MaxElevation>
| <MaxElevation>
| float
| float
| maximum elevation in radians
| Maximum elevation in radians.
|-
|-
| <MinAzimuth>
| <MinAzimuth>
| float
| float
| minimum azimuth in radians
| Minimum azimuth in radians.
|-
|-
| <MaxAzimuth>
| <MaxAzimuth>
| float
| float
| maximum azimuth in radians
| Maximum azimuth in radians.
|-
|-
| <MaxVerticalSpeed>
| <MaxVerticalSpeed>
| float
| float
| maximum vertical speed in radian/frame
| Maximum vertical speed in radians per frame.
|-
|-
| <MaxHorizontalSpeed>
| <MaxHorizontalSpeed>
| float
| float
| maximum horizontal speed in radian/frame
| Maximum horizontal speed in radians per frame.
|-
|-
| <ActiveSound>
| <ActiveSound>
Line 139: Line 134:
|}
|}


 
===<TURRParticle>===
=====<TURRParticle>=====
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
|width=200px| <ParticleClass>
|width=200px| <ParticleClass>
|width=40px| link
|width=40px| link
| particle file name without file prefix BINA3RAP and suffix .oni
| Particle file name without file prefix BINA3RAP and suffix .oni
|-
|-
| <ShotFrequency>
| <ShotFrequency>
| int32
| int32
| delay between shots in frames: X/60
| 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
| Coefficients of transform matrix: x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4
|}
|}


 
===<FiringMode>===
=====<FiringMode>=====
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! 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
| Targeting inverse transform matrix - the inverse of the matrix that gives the targeting direction
|-
|-
| <Direction>
| <Direction>
| vector3
| vector3
| targeting direction
| Targeting direction
|-
|-
| <Origin>
| <Origin>
| vector3
| vector3
| targeting origin
| Targeting origin
|-
|-
| <PredictionSpeed>
| <PredictionSpeed>
| float
| float
| prediction speed
| Prediction speed
|-
|-
| <MaxInaccuracyAngle>
| <MaxInaccuracyAngle>
| float
| float
| inaccuracy tolerance; always 0 for TURR  
| Inaccuracy tolerance; always 0 for TURR .
|-
|-
| <AimRadius>
| <AimRadius>
| float
| float
| aim radius; always the same for TURR and ONWC
| Aim radius; always the same for TURR and ONWC.
|-
|-
| <AISoundRadius>
| <AISoundRadius>
| float
| float
| sound sphere radius; always the same for TURR
| Sound sphere radius; always the same for TURR.
|-
|-
| <MinShootingDistance>
| <MinShootingDistance>
| float
| float
| minimal shooting distance; always 0 for TURR
| Minimum shooting distance; always 0 for TURR.
|-
|-
| <MaxShootingDistance>
| <MaxShootingDistance>
| float
| float
| maximal shooting distance; always 0 for TURR
| Maximum shooting distance; always 0 for TURR.
|-
|-
| <MaxStartleMisses>
| <MaxStartleMisses>
| int16
| int16
| maximum startle misses
| 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
| 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  
| 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
| 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
| Length of firing spread; always 0 for TURR.
|-
|-
| <FireSpreadWidth>
| <FireSpreadWidth>
| flaot
| flaot
| width of firing spread; always 0 for TURR
| Width of firing spread; always 0 for TURR.
|-
|-
| <FireSpreadSkew>
| <FireSpreadSkew>
| float
| float
| skew angle of firing spread; always 0 for TURR
| Skew angle of firing spread; always 0 for TURR.
|}
|}


 
===<Targeting>===
=====<Targeting>=====
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
|width=200px| <StartleMissAngle>
|width=200px| <StartleMissAngle>
| width=40px| float
| width=40px| float
| always the same for TURR and ONCC (0.5)
| Always the same for TURR and ONCC (0.5).
|-
|-
| <StartleMissDistance>
| <StartleMissDistance>
| float
| float
| always the same for TURR and ONCC (25)
| Always the same for TURR and ONCC (25).
|-
|-
| <PredictAmount>
| <PredictAmount>
| float
| float
| always the same for TURR (1.0)
| Always the same for TURR (1.0).
|-
|-
| <PredictPositionDelayFrames>
| <PredictPositionDelayFrames>
| int32
| int32
| always the same for TURR (0)
| Always the same for TURR (0).
|-
|-
| <PredictDelayFrames>
| <PredictDelayFrames>
| int32
| int32
| always the same for TURR (5)
| Always the same for TURR (5).
|-
|-
| <PredictVelocityFrames>
| <PredictVelocityFrames>
| int32
| int32
| always the same for TURR (15)
| Always the same for TURR (15).
|-
|-
| <PredictTrendFrames>
| <PredictTrendFrames>
| int32
| int32
| always the same for TURR (60)
| Always the same for TURR (60).
|}
|}


 
===<WeaponSkill>===
=====<WeaponSkill>=====
All the TURRs have the same shooting skill settings.
All the TURR have the same shooting skill.


{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
|width=200px| <RecoilCompensation>
|width=200px| <RecoilCompensation>
|width=40px| float
|width=40px| float
| min = 0.0, max = 1.0
| Min = 0.0, max = 1.0
|-       
|-       
| <BestAimingAngle>
| <BestAimingAngle>
| float
| float
| best aiming angle in radians  
| Best aiming angle, in radians.
|-
|-
| <ShotGroupError>
| <ShotGroupError>
| float
| float
| shot grouping error
| Shot grouping error.
|-
|-
| <ShotGroupDecay>
| <ShotGroupDecay>
| float
| float
| shot grouping decay
| Shot grouping decay.
|-
|-
| <ShootingInaccuracyMultiplier>
| <ShootingInaccuracyMultiplier>
| float
| float
| shooting inaccuracy multiplier
| Shooting inaccuracy multiplier.
|-
|-
| <MinShotDelay>
| <MinShotDelay>
| uint16
| uint16
| minimum delay between shots in frames
| Minimum delay between shots in frames.
|-
|-
| <MaxShotDelay>
| <MaxShotDelay>
| uint16
| uint16
| maximum delay between shots in frames
| Maximum delay between shots in frames.
|}
|}


==Vanilla classes==
[[Image:XSI_ModTool_VanillaTURRs.jpg|400px|thumb]]


===embedded M3GM===
==3D model==
====export====
===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 cut TURR instance so that only the M3GM and its connected instances remain and convert it to 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 -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 hint:
Version advice:
: onisplit v0.9.61.0 and v0.9.68.0 can extract M3GM only as obj
: 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
: OniSplit [http://mods.oni2.net/node/38 v0.9.41.0] can extract M3GM as OBJ or DAE.


Convert the M3GMfile.oni to obj:
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…


====import====
<ParticleCount>4</ParticleCount>


Are there some tags which make together the mesh but you basically need to know that you can replace that content with data from another M3GM.
…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 obj files.
===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 xml and replace the TURR's old M3GM xml code.
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 modding tips
  • See HERE to start learning about XML modding.
  • See HERE if you are searching for information on how to handle object coordinates.
  • See HERE for some typical modding errors and their causes.
XML.png
XML

TSFF << Other file types >> TXCA

switch to OBD page

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

Extracted DAE in XSI.
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
0 (?)
-1 (?)
-8531 (?)
<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

XSI ModTool VanillaTURRs.jpg

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.