XML:ONWC: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (i wonder if it's not time to clean up this page since all the hex stuff seems to be on the main page)
m (link fixes)
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{|align=right
{{XML_File_Header | prev=ONVL | type=ONWC | next=OPge | name=Oni Weapon Class}}
![[OBD:Oni Binary Data|ONI BINARY DATA]]
 
==General information==
* The XML on this page is compatible with OniSplit '''v0.9.61.0'''.
* Vanilla ONWC files are stored in AE/AEInstaller/vanilla/level0_Final.dat.
 
==File structure==
ONWC
  |
  +-- M3GM (embedded 3D mesh)
        |
        +-- PNTA <Points>
        +-- VCRA <VertexNormals>
        +-- VCRA <FaceNormals>
        +-- TXCA <TextureCoordinates>
        +-- IDXA <TriangleStrips>
        +-- IDXA <FaceNormalIndices>
        +-- TXMP <Texture> (link to external file)
 
==XML tags==
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=60px| '''Type'''
| '''Description'''
|-
| <LaserSight>
|
| See [[#<LaserSight>|THIS]] section below.
|-
|-
![[OBD:ONVL|ONVL]] << [[OBD:File types|Other file types]] >> [[OBD:OPge|OPge]]
| <AmmoMeter>
|
| See [[#<AmmoMeter>|THIS]] section below.
|-
|-
!<FONT SIZE=5>ONWC : Oni Weapon Class</FONT>
| <Geometry>
| link
| [[#M3GM model|Weapon instance]] number (#N). For geometry importing, see [[#New method|THIS]] section below.
|-
|-
![[OBD:File types/Global|Level 0 file]]
| <Name>
| char[32]
| <font color="#777777">ONWC</font>file<font color="#777777">.oni</font> <font color="#777777">(don't use file prefix/suffix)</font>
|-
|-
![http://geyser.oni2.net/OUP/ONWC.txt Struct def for OUP]
| <MouseSensitivity>
| float
| Weapon's mouse sensitivity (applies to AI too).
|-
|-
![http://www6.fh-eberswalde.de/user/dkriesch/onistuff/oni_onwc.htm Overview @ Oni Stuff]
| <Recoil>
|
| See [[#<Recoil>|THIS]] section below.
|-
|-
!TXT overviews (27 kB each) :<br>[http://www6.fh-eberswalde.de/user/dkriesch/onistuff/subfold/text/oni_onwc_dc.txt "," decimals] or [http://www6.fh-eberswalde.de/user/dkriesch/onistuff/subfold/text/oni_onwc_dp.txt "." decimals]
| <RecoilAnimationType>
|}
| link
There's an [[OBD:File types|empty]] ONWC file in every level, and the 12 actual ONWC files are in level 0.
| A recoil [[XML:StNA#Animation_types|animation type]].
;File size:1824 = 0x720 bytes
|-
;Example: '''w1_tap.ONWC''' (unless specified otherwise)
| <ReloadAnimationType>
;Structure
| link
*0x08 - 0xD7 : MAIN WEAPON DATA (216 = 0xD8 bytes)
| A reload [[XML:StNA#Animation_types|animation type]].
**0x08 - 0x53 : laser sight
|-
**0x54 - 0x5F : ammo meter
| <PauseAfterReload>
**0x60 - 0xD7 : various weapon parameters
| int16
*0xD8 - 0x1D7 : FIRING MODE ARRAY (2 elements, 128 = 0x80 bytes each)
| Pause after reloading, in 1/60 seconds.
**0xD8 - 0x157 : primary firing mode
|-
**0x158 - 0x1D7 : secondary firing mode
|valign=top| <MaxShots>
*0x1D8 - 0x6DC : WEAPON PARTICLE ARRAY (16 elements, 80 = 0x50 bytes each)
|valign=top| int16
*0x6D8 - 0x71F : TRAILING CHUNK (68 =0x48 bytes)
| Number of "shots". Let's say a weapon has 4 emitters each with <UsedAmmo>1 and the weapon shall be able to fire 3 times. Then <MaxShots> has to be 12 = 4 * 1 * 3.
**weapon sounds, unheld weapon parameters, blank filler
;Coordinates
:Unless specified otherwise, they are relative to the weapon's mesh
:(x = forwards, y = left, z = up)


----
A mismatched <MaxShots> number creates an infinite-ammunition bug.
----
|-
==0x00 - 0xD7==
| <ParticleCount>
;MAIN PART
| int16
http://www6.fh-eberswalde.de/user/dkriesch/onistuff/images/onwc_a.gif
| Number of attached particles.
{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
|-
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
| <FiringModeCount>
!Offset
| int16
!Hex
| Number of used firing modes (max of 2?).
!Translation
|-
!Meaning
| <PauseBeforeReload>
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| int16
|0x00
| Pause before reloading, in 1/60 seconds.
| BGCOLOR="#FF0000" | 01 '''75 0E''' 00
|-
| 3701
| <ReleaseDelay>
| ALIGN=LEFT | File ID (03701-w1_tap.ONWC)
| int16
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| Delay between the moment the trigger is released and the moment the weapon stops firing.
|0x04
|-
| BGCOLOR="#FFFF00" | 01 00 00 ''00''
|valign=top| <Flags>
| 0
|valign=top| flag
| ALIGN=LEFT | level ID
| Weapon options
|}
: NoHolster
----
: UsesCells
===0x08 - 0x53===
: TwoHanded
;LASER SIGHT PARAMETERS
: RecoilAffectsAiming
{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
:: Even without this flag, there will still be recoil. Recoil makes the aim travel upwards as the trigger is held down.
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
:: If the flag is set, the aiming will remain elevated after firing the gun.
!Offset
:: If flag isn't set, the upward movement stops earlier, and when the firing ends, the weapon will fall to the previous aiming angle.
!Hex
: Automatic
!Translation
: StunSwitcher
!Meaning
:: If the enemy is within shooting distance (between <MinShootingDistance> and <MaxShootingDistance>) and is knocked down, stunned or blown up, the AI with this weapon switches to melee for a time specified in a *fight timer* field.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
: KnockdownSwitcher
|0x08
:: If the enemy is within shooting distance and is knocked down or blown up, the AI with this weapon switches to melee for a time specified in a *fight timer* field.
| BGCOLOR="#FFC8C8" | F5 A4 49 40
: Explosive
| 3.150693
: SecondaryFire
| ALIGN=LEFT | x-offset of the origin
: BarabbasWeapon
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
:: If the enemy is within shooting distance and is knocked down or blown up, the AI with this weapon switches to melee for a time specified in a *fight timer* field.
|0x0C
: Heavy
| BGCOLOR="#FFC8C8" | F4 2C A5 3B
: AutoRelease
| 0.005041
: HasReleaseDelay
| ALIGN=LEFT | y-offset of the origin
: HasLaserSight
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
: ScaleCrosshair
|0x10
: NoFade
| BGCOLOR="#FFC8C8" | 21 4E D2 3E
: DrainAmmo
| 0.410752
|-
| ALIGN=LEFT | z-offset of the origin
| <FiringModes>
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|
|0x14
| Holds 2 <FiringModes> tags.
| BGCOLOR="#FFC8C8" | 23 A6 7F 3F
|-
| 0.998629
| <AIFiringMode>
| ALIGN=LEFT | something like the stiffness (try setting it to 0.001 and lower)
|
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| See [[#<AIFiringMode>|THIS]] section below.
|0x18
|-
| BGCOLOR="#FFC8C8" | AA 6C 56 BD
| <Particles>
| -0.052349
|
| ALIGN=LEFT | additional azimuth
| Holds 16 <ONWCParticle> tags.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|-
|0x1C
| <ONWCParticle>
| BGCOLOR="#FFC8C8" | 69 66 AA B7
|
| -0.000020
| See [[#<ONWCParticle>|THIS]] section below.
| ALIGN=LEFT | additional elevation
|-
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| <EmptyWeaponSound>
|0x20
| link
| BGCOLOR="#FFC8C8" | 00 40 9C 45
| <font color="#777777">OSBD</font>file<font color="#777777">.imp.oni</font> <font color="#777777">(don't use file prefix/suffix)</font>
| 5000.000000
|-
| ALIGN=LEFT | maximal length of laser sight vector
| <Glow>
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| link
|0x24
| TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
| BGCOLOR="#FFFFC8" | 00 00 FF FF
|-
| Red, opaque
| <GlowAmmo>
| ALIGN=LEFT | laser sight color (RGBA)
| link
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
|0x28
|-
| BGCOLOR="#C8FFC8" | 01 '''94 05''' 00
| <GlowTextureScale>
| 1428
| float
| ALIGN=LEFT | crosshair texture (link to 01428-target_1A.[[OBD:TXMP|TXMP]])
| XZ scale factor of glow textures around weapon when lying on the ground.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|-
|0x2C
| <PickupHandleOffset>
| BGCOLOR="#C8FFC8" | FF FF FF 00
| float
| White, transparent
| XYZ offset of weapon's pickup handle when on the ground.
| ALIGN=LEFT | crosshair background color (RGBA)
|-
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| <HoveringHeight>
|0x30
| float
| BGCOLOR="#C8FFC8" | CD CC 4C 3F
| Hovering height of weapon when on ground.
| 0.800000
| ALIGN=LEFT | crosshair scale factor
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x34
| BGCOLOR="#C8FFFF" | 01 '''95 05''' 00
| 1429
| ALIGN=LEFT | locked crosshair texture (link to 01429-target_1B.[[OBD:TXMP|TXMP]])
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x38
| BGCOLOR="#C8FFFF" | FF FF FF 00
| White, transparent
| ALIGN=LEFT | locked crosshair background color (RGBA)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x3C
| BGCOLOR="#C8FFFF" | CD CC 4C 3F
| 0.800000
| ALIGN=LEFT | locked crosshair scale factor
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x40
| BGCOLOR="#FFC8FF" | 00 '''00 00''' 00
| not used
| ALIGN=LEFT | tunnel texture ([[OBD:TXMP|TXMP]] link)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x44
| BGCOLOR="#FFC8FF" | FF FF FF 00
| White, transparent
| ALIGN=LEFT | tunnel background color (RGBA)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x48
| BGCOLOR="#FFC8FF" | 00 00 80 3F
| 1.000000
| ALIGN=LEFT | tunnel scale factor
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x4C
| BGCOLOR="#FFC800" | 0F 00 00 00
| 15
| ALIGN=LEFT | number of tunnel textures
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x50
| BGCOLOR="#C800C8" | 00 00 20 41
| 10.000000
| ALIGN=LEFT | spacing of tunnel textures
|}
;Crosshair
:Default crosshair appears where the laser sight hits environment, corpses, etc
:Locked crosshair appears when the laser sight hits characters (including the shooter)
:"Tunnel" is used by '''w8_mbo''' as a complement to the crosshair
:'''w2_sap''', '''w5_sbg''', '''w7_scc''' and '''w9_scr''' use it with no crosshair
----
===0x54 - 0x5F===
;AMMO METER
{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
!Offset
!Hex
!Translation
!Meaning
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x54
| BGCOLOR="#C87C64" | 01 '''7E 0E''' 00
| 3710
| ALIGN=LEFT | link to 03710-tap_icon.[[OBD:TXMP|TXMP]]
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x58
| BGCOLOR="#C87C64" | 01 '''7F 0E''' 00
| 3711
| ALIGN=LEFT | link to 03711-tap_empty.[[OBD:TXMP|TXMP]]
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x5C
| BGCOLOR="#C87C64" | 01 '''80 0E''' 00
| 3712
| ALIGN=LEFT | link to 03712-tap_fill.[[OBD:TXMP|TXMP]]
|}
|}
----
===0x60 - 0xD7===
;WEAPON PARAMETERS
{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
!Offset
!Hex
!Translation
!Meaning
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x60
| BGCOLOR="#C87C64" | 01 '''76 0E''' 00
| 3702
| ALIGN=LEFT | link to 03702-.[[OBD:M3GM|M3GM]]
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x64
| BGCOLOR="#B0C3D4" COLSPAN=2 | <TT>w1_tap</TT>
| ALIGN=LEFT | name of the weapon
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x84
| BGCOLOR="#E7CEA5" | 00 00 80 3F
| 1.000000
| ALIGN=LEFT | weapon mouse sensitivity (applies on AI, too)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x88
| BGCOLOR="#E7CEA5" | A6 92 2B 3D
| 0.041888
| ALIGN=LEFT | recoil (e.g. for '''w1_tap''' and '''w2_sap''')
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x8C
| BGCOLOR="#E7CEA5" | 92 0A 86 3E
| 0.261799
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x90
| BGCOLOR="#E7CEA5" | 00 00 A0 40
| 5.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x94
| BGCOLOR="#E7CEA5" | E2 A3 7B 3B
| 0.003839
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x98
| BGCOLOR="#E7CEA5" | 88 C3 E4 3A
| 0.001745
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x9C
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xA0
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xA4
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xA8
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xAC
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xB0
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xB4
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xB8
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xBC
| BGCOLOR="#E7CEA5" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xC0
| BGCOLOR="#FFDDDD" | 00 00
| 0
| ALIGN=LEFT | unknown; always zero
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xC2
| BGCOLOR="#FFDDDD" | 95 00
| 149
| ALIGN=LEFT | recoil animation type, (149 => autopistol_recoil)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xC4
| BGCOLOR="#FFDDDD" | A4 00
| 164
| ALIGN=LEFT | reload animation type, (164 => reload_pistol)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xC6
| BGCOLOR="#FFDDDD" | 19 00
| 25
| ALIGN=LEFT | pause after reload in 1/60 seconds
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xC8
| BGCOLOR="#FFDDDD" | 0A 00
| 10
| ALIGN=LEFT | amount of shots
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xCA
| BGCOLOR="#FFDDDD" | 06 00
| 6
| ALIGN=LEFT | amount of particles
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xCC
| BGCOLOR="#FFDDDD" | 01 00
| 1
| ALIGN=LEFT | amount of firing modes
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xCE
| BGCOLOR="#FFDDDD" | 0A 00
| 10
| ALIGN=LEFT | pause before reload in 1/60 seconds
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xD0
| BGCOLOR="#FFDDDD" | 04 00
| 4
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xD2
| BGCOLOR="#FFDDDD" | 00 00
| 0
| ALIGN=LEFT | unknown; always zero
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xD4
| BGCOLOR="#FFDDDD" | 30
| 48
| ALIGN=LEFT | Flags 1 :


{| BORDER=0 CELLPADDING=0 CELLSPACING=0
; Glow textures
|- VALIGN=TOP
: They're applied to the lower face of the M3GM's bounding box. The factors in <GlowTextureScale> are the ratio between the X/Z extent of that face and the half-length/width of the glow textures. So if both factors are 0.5, the glow textures fit the bounding box exactly.
| ALIGN=RIGHT | 1 -&nbsp;
; Pickup handle
| unknown, never used
: The tolerance around the defined handle is hardcoded. The offsets are not relative to the weapon's axes, but to the world axes (!). This is a rather nasty "feature", as the offsets should definitely be relative to the weapon's orientation. The way it is now, the pickup volume of Barabas' Wave Motion Cannon is not necessarily near the handle. That's why it's hard to pick up sometimes.
|- VALIGN=TOP
| ALIGN=RIGHT | 2 -&nbsp;
| '''weapon can't be holstered'''
|- VALIGN=TOP
| ALIGN=RIGHT | 4 -&nbsp;
| '''weapon reloads with energy cells'''
|- VALIGN=TOP
| ALIGN=RIGHT | 8 -&nbsp;
| '''weapon is a rifle (two-handed)'''
|- VALIGN=TOP
| ALIGN=RIGHT | 16 -&nbsp;
| unknown, used for w1_tap and w2_sap
|- VALIGN=TOP
| ALIGN=RIGHT | 32 -&nbsp;
| '''sustained fire'''
|- VALIGN=TOP
| ALIGN=RIGHT | 64 -&nbsp;
| '''you can't shoot ...'''
|- VALIGN=TOP
| ALIGN=RIGHT | 128 -&nbsp;
| '''stun switcher''',see below, used for w6_vdg
|}


|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
===<LaserSight>===
|0xD5
; Crosshair
| BGCOLOR="#FFDDDD" | C0
: The default crosshair appears where the laser sight contacts the environment, corpses, etc. A locked-on version of the crosshair appears when the laser sight contacts characters (including the shooter). An "aiming tunnel" is used by the w8_mbo as a complement to the crosshair (w2_sap, w5_sbg, w7_scc and w9_scr use the tunnel with no crosshair).
| 192
| ALIGN=LEFT | Flags 2 :


{| BORDER=0 CELLPADDING=0 CELLSPACING=0
{|class="wikitable" width=100%
|- VALIGN=TOP
|width=120px| '''XML tag'''
| ALIGN=RIGHT | 1 -&nbsp;
|width=60px| '''Type'''
| '''knockdown switcher''',see below, used for w4_psm
| '''Description'''
|- VALIGN=TOP
|-
| ALIGN=RIGHT | 2 -&nbsp;
| <Origin>
| unknown, used for w5_sbg and w11_ba1
| float
|- VALIGN=TOP
| X, Y, Z
| ALIGN=RIGHT | 4 -&nbsp;
|-
| '''secondary fire enabled'''
| <Stiffness>
|- VALIGN=TOP
| float
| ALIGN=RIGHT | 8 -&nbsp;
| X component of laser sight direction?
| '''weapon can't be reloaded'''
|-
|- VALIGN=TOP
| <AdditionalAzimuth>
| ALIGN=RIGHT | 16 -&nbsp;
| float
| '''run, jump and creep disabled'''
| [[wikipedia:Azimuth|Wikipedia definition of azimuth]]
|- VALIGN=TOP
|-
| ALIGN=RIGHT | 32 -&nbsp;
| <AdditionalElevation>
| unknown, used for w11_ba1
| float
|- VALIGN=TOP
| [[wikipedia:Elevation|Wikipedia definition of elevation]]
| ALIGN=RIGHT | 64 -&nbsp;
|-
| '''I d.k.h.t.c.t.2''',see below, used for w1_tap, w2_sap and w3_phr
| <LaserMaxLength>
|- VALIGN=TOP
| float
| ALIGN=RIGHT | 128 -&nbsp;
| Maximum length of laser sight vector.
| '''laser sight visible'''
|-
| <LaserColor>
| color
| Laser sight color in BGRA
|-
| <NormalTexture>
| link
| Crosshair texture: TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
|-
| <NormalColor>
| color
| Crosshair background color in BGRA
|-
| <NormalScale>
| float
| Crosshair scale factor
|-
| <LockedTexture>
| link
| Locked-on crosshair texture: TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
|-
| <LockedColor>
| color
| Locked-on crosshair background color in BGRA
|-
| <LockedScale>
| float
| Locked-on crosshair scale factor
|-
| <TunnelTexture>
| link
| Aiming tunnel texture
|-
| <TunnelColor>
| color
| Tunnel background color in RGBA
|-
| <TunnelScale>
| float
| Tunnel scale factor
|-
| <TunnelCount>
| int32
| Number of tunnel textures
|-
| <TunnelSpacing>
| float
| Spacing of tunnel textures
|}
|}


|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
===<AmmoMeter>===
|0xD6
{|class="wikitable" width=100%
| BGCOLOR="#FFDDDD" | 02 00
|width=120px| '''XML tag'''
| 2
|width=60px| '''Type'''
| ALIGN=LEFT | Flags 3 :
| '''Description'''
{| BORDER=0 CELLPADDING=0 CELLSPACING=0
|-
|- VALIGN=TOP
| <Icon>
| ALIGN=RIGHT | 1 -&nbsp;
| link
| unknown, never used
| TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
|- VALIGN=TOP
|-
| ALIGN=RIGHT | 2 -&nbsp;
| <Empty>
| '''crosshair scaling''', used for w1_tap, w2_sap, w3_phr and w8_mbo
| link
|- VALIGN=TOP
| TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
| ALIGN=RIGHT | 4 -&nbsp;
|-
| unknown, never used
| <Fill>
|- VALIGN=TOP
| link
| ALIGN=RIGHT | 8 -&nbsp;
| TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
| '''weapon doesn't fade'''
|- VALIGN=TOP
| ALIGN=RIGHT | 16 -&nbsp;
| '''I don't know how to call this''', see below, used for w4_psm
|- VALIGN=TOP
| ALIGN=RIGHT | 32 -&nbsp;
| unknown, never used
|- VALIGN=TOP
| ALIGN=RIGHT | 64 -&nbsp;
| unknown, never used
|- VALIGN=TOP
| ALIGN=RIGHT | 128 -&nbsp;
| unknown, never used
|}
|}
===<Recoil>===
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=60px| '''Type'''
| '''Description'''
|-
| <Base>
| float
| Recoil base (e.g. for w1_tap and w2_sap)
|-
| <Max>
| float
| Recoil max
|-
| <Factor>
| float
| Recoil factor
|-
| <ReturnSpeed>
| float
| Recoil return speed
|-
| <FiringReturnSpeed>
| float
| Recoil firing return speed
|}
|}


'''stun switcher''' -if enemy is inside shooting distance (between min and max) and is '''knockdown'''ed/'''stun'''ed or '''blownup'''ed, AI with this weapon switches to melee for a time specified in a *fight timer* field
===<AIFiringMode>===
w11_ba1 is the only vanilla weapon in Oni that uses the second firing mode.


'''knockdown switcher''' -  if enemy is inside shooting distance (between min and max) and is '''knockdown'''ed or '''blownup'''ed, AI with this weapon switches to melee for a time specified in a *fight timer* field
; Transform matrix
: Probably defined the orientation, scaling and position of the firing spread, but it doesn't appear to be used.


'''I don't know how to call this''' - If you press and HOLD the fire (mouse1), it ONCE triggers particles for shooting, then drains ammo as if it was '''sustained fire''', but particles are NOT emitted (you just stand and watch as ammo drops). Used by w4_psm, probably because w4 particles works constantly (beam) after triggered.
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=60px| '''Type'''
| '''Description'''
|-
| <Flags>
| flag
| NoWildShots is the only accepted value. When the AI first sights an enemy, their first shot will go wide if this flag is set (making them more lifelike and giving the player a break). Also see <MaxStartleMisses> tag below.
|-
| <InverseDirection>
| matrix4x3
| Targeting inverse transform matrix. The inverse of the matrix that gives the targeting direction.
|-
| <Direction>
| vector3
| Targeting direction. Sets the orientation of the firing spread.
|-
| <Origin>
| vector3
| Targeting origin. Sets the deviation of the AI's aim from the target's origin
|-
| <PredictionSpeed>
| float
| Prediction speed. The supposed speed of the projectile, used by the AI to predict where to fire in order to hit a moving target (note that this doesn't strictly work for an accelerating projectile like the plasma rifle's).
|-
| <MaxInaccuracyAngle>
| float
| Maximum inaccuracy angle. Sets the max angle between the weapon's aiming vector and the target's position; when the AI exceeds this angle (whether due to recoil or the target evading them), they will stop shooting, re-aim the weapon straight at the target, then resume shooting.
|-
| <AimRadius>
| float
| Always the same. Possibly related to the inaccuracy angle above.
|-
| <AISoundRadius>
| float
| Weapon's sound sphere radius. The sound sphere is created momentarily every time the weapon fires, and is used to alert the AI (see [[AI#Vision and hearing|HERE]] to read about about AI sound spheres).
|-
| <MinShootingDistance>
| float
| Minimum shooting distance. If the target is closer than this, the AI ceases firing and moves backward from the target till at least this distance is achieved. Note that this is given as a diameter, not a radius, so the effective distance from the AI to the target is half of this value.
|-
| <MaxShootingDistance>
| float
| Maximum shooting distance. If the target is farther than this distance, then the AI ceases firing and moves toward the target until it gets below this distance.
|-
| <MaxStartleMisses>
| float
| Probably the maximum number of times that an AI will fire wildly when surprised before he starts aiming. Also see NoWildShots flag above.
|-
| <SkillIndex>
| int16
| [[XML:ONCC#.3CWeaponSkills.3E|ONCC skill index]]
|-
| <FightTimer>
| int32
| Unknown timer; 240 for w4_psm, 200 for v6_vdg.
|-
| <ProjectileSpeed>
| float
| Ballistic projectile speed (150 for SBG, 160 for WMC).
|-
| <ProjectileGravity>
| float
| Ballistic projectile gravity, causing the AI to anticipate the arc their shot will follow. Can be negative for firing at the enemy's feet (0.5 for SBG, 0.3 for WMC).
|-
| <FireSpreadLength>
| float
| Length of weapon's supposed fire spread. The AI can utilize gunfire-dodging mechanics when it intersects with a fire spread (read [[AI#Basic combat behaviors|HERE]] for details). Can be visualized with "ai2_showfiringspreads=1" (180 for w1_tap, 150 for w2_sap, 120 for w4_psm).
|-
| <FireSpreadWidth>
| float
| Base width of weapon's supposed fire spread; can be visualized with "ai2_showfiringspreads=1".
|-
| <FireSpreadSkew>
| float
| Skew in the weapon's supposed fire spread; can be visualized with "ai2_showfiringspreads=1" (0.1 for w1_tap, 0.21 for w2_sap).
|}


'''I d.k.h.t.c.t.2''' - try this: set '''I don't know how to call this''' on some weapon, then set this on that weapon too. You will see that once you press the shooting button, it keeps *shooting* (altough you can't see any particles coming) even after you release shooting button. You can't stop it. It keeps shooting until all ammo is drained. So, basically, it works like an automatic hold of the mouse button.
;Firing spread
Note that the dodging-oriented fire spread set here is entirely separate from the weapon's <u>actual</u> fire spread, that is, the conical gunfire that a weapon like the autopistol produces (see note at end of the [[OBD:BINA/PAR3#Emitters|PAR3 Emitters section]]). The dodging fire spread is separate in order to allow fine-tuning of the area from which the AI will attempt to escape, rather than simply relying on the calculated cone of weapons fire that is actually produced.


P.S.: Someone please think off nice names for those two poor flags :))
===<ONWCParticle>===
--[[User:Loser|Loser]] 07:52, 29 July 2007 (CEST)
; Transformation matrix
----
: This is what defines particle orientation, stretching, etc. See [[OBD:CRSA|CRSA]] for details.
----


==0xD8 - 0x1D7==
{|class="wikitable" width=100%
;FIRING MODES
|width=120px| '''XML tag'''
Every ONWC has 2 firing mode slots (128 = 0x80 bytes each.)
|width=60px| '''Type'''
 
| '''Description'''
The number of slots actually used by the weapon is specified at 0xCA.
|-
===0xD8 - 0x157===
| <Transform>
;PRIMARY FIRING MODE
| matrix4x3
Offsets are given with respect to the start of the file.
| The transformation matrix (xx xy xz yx yy yz zx zy zz + x y z offset) of the particle to the weapon.
{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
|-
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
| <ParticleClass>
!Offset
| link
!Raw hex
| <font color="#777777">BINA3RAP</font>file<font color="#777777">.oni</font> <font color="#777777">(don't use file prefix/suffix)
!Value
|-
!Meaning
| <UsedAmmo>
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| int16
|0xD8
| Ammo to remove from current clip when weapon is fired (different for the 2 firing modes of w11_ba1).
| BGCOLOR="#FFDDDD" | 00 00
|-
| 0
| <ShotDelay>
| ALIGN=LEFT | unknown (1 for w9_scr)
| int16
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| Normal delay between shots, in frames.
|0xDA
|-
| BGCOLOR="#FFDDDD" | 00 00
| <RoughJusticeShotDelay>
| 0
| int16
| ALIGN=LEFT | unknown; always zero
| 'roughjustice' delay between shots, in frames.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|-
|0xDC
| <ActiveFrames>
| BGCOLOR="#64AAAA" | 23&nbsp;A6&nbsp;7F&nbsp;3F
| int16
| 0.998629
| Minimum number of frames that the weapon will be firing for; used for w4_psm and w11_ba1.
| ALIGN=LEFT | transform matrix XX
|-
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|valign=top| <TriggeredBy>
|0xE0
|valign=top| int16
| BGCOLOR="#64AAAA" | 05 6D 56 3D
|
| 0.052350
: 0 (particle is triggered by fire1)
| ALIGN=LEFT | transform matrix XY
: 1 (particle is triggered by fire2)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
: -1 (particle is triggered by both firing modes)
|0xE4
|-
| BGCOLOR="#64AAAA" | F4 8D A9 37
| <DelayBeforeFiring>
| 0.000020
| int16
| ALIGN=LEFT | transform matrix XZ
| Delay before firing (think of the WMC's long warm-up time).
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xE8
| BGCOLOR="#64AAAA" | 05 6D 56 BD
| -0.052350
| ALIGN=LEFT | transform matrix YX
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xEC
| BGCOLOR="#64AAAA" | 23 A6 7F 3F
| 0.998629
| ALIGN=LEFT | transform matrix YY
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xF0
| BGCOLOR="#64AAAA" | D0 1D 0E B5
| -0.000001
| ALIGN=LEFT | transform matrix YZ
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xF4
| BGCOLOR="#64AAAA" | F4 8D A9 B7
| -0.000020
| ALIGN=LEFT | transform matrix ZX
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xF8
| BGCOLOR="#64AAAA" | D0 1D 0E B5
| -0.000001
| ALIGN=LEFT | transform matrix ZY
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0xFC
| BGCOLOR="#64AAAA" | 00 00 80 3F
| 1.000000
| ALIGN=LEFT | transform matrix ZZ
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x100
| BGCOLOR="#64AAAA" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | translation X; always zero for original weapons
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x104
| BGCOLOR="#64AAAA" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | translation Y; always zero for original weapons
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x108
| BGCOLOR="#64AAAA" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | translation Z; always zero for original weapons
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x10C
| BGCOLOR="#64AAAA" | 23 A6 7F 3F
| 0.998629
| ALIGN=LEFT | unknown; something with angle proportions between firingspread base's angles, the higher you set it the more it is taller than wider; can be seen with ai2_showfiringspreads=1
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x110
| BGCOLOR="#64AAAA" | AE 6C 56 BD
| -0.052349
| ALIGN=LEFT | unknown; something with firingspread's aim in the "x,z plane". This value is forcing firingspread to aim more left or more right than weapon is aiming or to even aim firingspread backwards; can be seen with ai2_showfiringspreads=1
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x114
| BGCOLOR="#64AAAA" | AF 8D A9 B7
| -0.000020
| ALIGN=LEFT | unknown; something with firingspread's aim in the "y plane". This value is forcing firingspread to aim more up or more down than weapon is aiming or to even aim firingspread backwards; can be seen with ai2_showfiringspreads=1
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x118
| BGCOLOR="#64AAAA" | DC FE 08 3C
| 0.008362
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x11C
| BGCOLOR="#64AAAA" | 5C 11 23 3E
| 0.159246
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x120
| BGCOLOR="#64AAAA" | 39 C6 2A 3F
| 0.667087
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x124
| BGCOLOR="#64AAAA" | 00 00 61 44
| 900.000000
| ALIGN=LEFT | unknown; it is some angle. If this angle is for example 90°, then AI, which is shooting this weapon, will try to copy target's movements eg. when target strafes left, armed AI stops shooting and runs left too. If you set it 270°, armed AI is performing opposite actions eg. when you run left, armed AI runs right. While running, AI stops shooting.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x128
| BGCOLOR="#64AAAA" | 00 00 20 41
| 10.000000
| ALIGN=LEFT | Max inaccurancy angle; sets max angle between weapon's aiming vector and target's position. When AI exceeds this angle(by recoil or target running away), AI stops shooting and aims weapon again straight to the target, then resume shooting.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x12C
| BGCOLOR="#64AAAA" | 00 00 20 40
| 2.500000
| ALIGN=LEFT | unknown; always the same
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x130
| BGCOLOR="#64AAAA" | 00 00 96 43
| 300.000000
| ALIGN=LEFT | Weapon sound sphere radius. When somebody shoots, weapon creates this range. AIs which are inside this range notice there was a shot + they know WHO is the shooter and WHERE he stands (threat strong), can be seen with ai2_showsounds=1 (but you have to be in a large open area, since those ranges are quite big)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x134
| BGCOLOR="#64AAAA" | 00 00 40 41
| 12.000000
| ALIGN=LEFT | Minimal shooting distance; When AI is closer then min.shot.dist., it will stop shooting and attempt to go  away from the target until it again reaches higher distance then min.shot.dist. is. You can see its effect when AI is operating SBG and you get too close.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x138
| BGCOLOR="#64AAAA" | 00 00 61 44
| 900.000000
| ALIGN=LEFT | Maximal shooting distance; When AI is further then max.shot.dist., it isn't shooting but running towards target until it reaches max.shot.dist. limit. Then AI opens fire. You can see its effect when AI is far away and has w2_sap.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x13C
| BGCOLOR="#EBEBEB" | 05 00
| 5
| ALIGN=LEFT | unknown; always the same
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x13E
| BGCOLOR="#EBEBEB" | 01 00
| 1
| ALIGN=LEFT | weapon ID (used by [[OBD:ONCC#Shooting_skills_(0x15C_-_0x29)|AI shooting skills]])
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x140
| BGCOLOR="#EBEBEB" | 00 00 00 00
| 0
| ALIGN=LEFT | Fight timer, 240 for w4_psm, 200 for v6_vdg
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x144
| BGCOLOR="#8C8CCC" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown, something with grenades (150 for SBG, 160 for WMC)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x148
| BGCOLOR="#8C8CCC" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | unknown, something with grenades (0.5 for SBG, 0.3 for WMC)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x14C
| BGCOLOR="#8C8CCC" | 00 00 34 43
| 180.000000
| ALIGN=LEFT | Length of firingspread which aims from weapon. When AI collides with this firingspread, it tries to dodge/hide of it. Can be seen by ai2_showfiringspreads=1 (180 for w1_tap, 150 for w2_sap, 120 for w4_psm)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x150
| BGCOLOR="#8C8CCC" | 00 00 40 40
| 3.000000
| ALIGN=LEFT | Lenght of the firingspread's base side. Can be seen by ai2_showfiringspreads=1
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x154
| BGCOLOR="#8C8CCC" | 50 77 D6 3D
| 0.104719
| ALIGN=LEFT | angle between firingspread's base and its altitude(length). Can be seen by ai2_showfiringspreads=1 (0.1 for w1_tap, 0.21 for w2_sap)
|}
|}
;Transform matrix
:Probably defines the orientation, scaling and position of the firing spread. Didn't check.
----
===0x158 - 0x1D7===
;SECONDARY FIRING MODE
The only original weapon for which these fields are not all zero is '''w11_ba1'''.
They are the exact counterparts of the fields at 0xD8 - 0x157.


====Particle adjustment====
When adding particles in the <ONWCParticle> section, the last three values of <Transform> are the particle's start location.


----
In your 3D editor, any object can serve as a helpful reference: pick one point of the object and move it to the location from where the particle should be spawned. Copy the value into the XML file. (Caution: Mod Tool uses a comma as a decimal mark, but OniSplit's XML files use a period.)
----


==0x1D8 - 0x6D7==
==M3GM model==
;PARTICLES
===Export===
Every ONWC has 16 particle slots (80 = 0x50 bytes each.)
: ''onisplit -extract:obj output_folder input_folder\ONWCfile.oni''
: Version tips:
:: OniSplit v0.9.86.0 and v0.9.94.0 cannot extract OBJ or DAE using this method
:: OniSplit v0.9.61.0 can extract M3GM only as OBJ
:: OniSplit v0.9.41.0 can extract M3GM as OBJ or DAE


The number of slots actually used by the weapon is specified at 0xCA.
===Import===
In your 3D editor, the weapon must be positioned on the XZ plane and pointing into +X space (weapon rotation {0, 0, 0}).


Offsets are relative to the beginning of a slot.
The center will be located at {0, 0, 0}, while the weapon's grip ends at the approximate position {0.3, ___, -0.5} and {0.8, ___, -0.5}.
{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
!Offset
!Raw hex
!Value
!Meaning
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x00
| BGCOLOR="#FF00C8" | AE 6C 56 3D
| 0.052349
| ALIGN=LEFT | transformation matrix, xx term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x04
| BGCOLOR="#FF00C8" | 23 A6 7F 3F
| 0.998629
| ALIGN=LEFT | transformation matrix, xy term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x08
| BGCOLOR="#FF00C8" | C2 53 90 B3
| -6.720757e-8
| ALIGN=LEFT | transformation matrix, xz term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x0C
| BGCOLOR="#FF00C8" | 23 A6 7F 3F
| 0.998629
| ALIGN=LEFT | transformation matrix, yx term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x10
| BGCOLOR="#FF00C8" | AE 6C 56 BD
| -0.052349
| ALIGN=LEFT | transformation matrix, yy term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x14
| BGCOLOR="#FF00C8" | AF 8D A9 B7
| -0.000020
| ALIGN=LEFT | transformation matrix, yz term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x18
| BGCOLOR="#FF00C8" | BA 59 A9 B7
| -0.000020
| ALIGN=LEFT | transformation matrix, zx term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x1C
| BGCOLOR="#FF00C8" | 5B 02 85 35
| 0.000001
| ALIGN=LEFT | transformation matrix, zy term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x20
| BGCOLOR="#FF00C8" | 00 00 80 BF
| -1.000000
| ALIGN=LEFT | transformation matrix, zz term
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x24
| BGCOLOR="#FF00C8" | 6F 63 57 40
| 3.365444
| ALIGN=LEFT | x-offset of particle to weapon
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x28
| BGCOLOR="#FF00C8" | B3 1D 89 BC
| -0.016738
| ALIGN=LEFT | y-offset of particle to weapon
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x2C
| BGCOLOR="#FF00C8" | C5 C1 2A 3F
| 0.667019
| ALIGN=LEFT | z-offset of particle to weapon
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x30
| BGCOLOR="#F0F096" COLSPAN=2 | <TT>w1_tap_e01</TT>
| ALIGN=LEFT | weapon particle (06226-3RAPw1_tap_e01.BINA)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x40
| BGCOLOR="#00C864" | 00 00
| 0
| ALIGN=LEFT | unknown; always zero
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x42
| BGCOLOR="#00C864" | 00 00
| 0
| ALIGN=LEFT | unknown; always zero
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x44
| BGCOLOR="#00C864" | 01 00
| 1
| ALIGN=LEFT | ammo decrement (different for the 2 firing modes of '''w11_ba1''')
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x46
| BGCOLOR="#00C864" | 0C 00
| 12
| ALIGN=LEFT | delay between shots in frames (12 frames = 0.2 seconds)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x48
| BGCOLOR="#00C864" | 04 00
| 4
| ALIGN=LEFT | unknown (looks like another delay)
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x4A
| BGCOLOR="#00C864" | 00 00
| 0
| ALIGN=LEFT | number in frames for active firing mode (1st frame for activate). Used for '''w4_psm''' and '''w11_ba1'''
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x4C
| BGCOLOR="#00C864" | 00 00
| 0
| ALIGN=LEFT | &nbsp;0 : particle is fired with '''fire1'''<br> &nbsp;1 : particle is fired with '''fire2'''<br>-1 : particle is triggered by other particles
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x4E
| BGCOLOR="#00C864" | 00 00
| 0
| ALIGN=LEFT | delay before firing
|}
;Transformation matrix
:That's what defines orientation, stretching, etc.
:See [[OBD:CRSA|CRSA]] for details.


Now you can create an M3GM file from the geometry.


----
====New method====
----
To import or change weapon geometry, simply insert the M3GM's file name into ONWC's <Geometry> tag. For example:


==0x6D8 - 0x71F==
<Geometry>M3GMw1_tap_new</Geometry>
;ENDING
http://www6.fh-eberswalde.de/user/dkriesch/onistuff/images/onwc_e.gif
{| BORDER=1 WIDTH=100% CELLPADDING=2 CELLSPACING=0
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
!Offset
!Raw hex
!Value
!Meaning
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x6D8
| BGCOLOR="#00C8FF" COLSPAN=2 | <TT>weapon _empty</TT>
| ALIGN=LEFT | empty weapon sound<BR>(08992-weapon_empty.grp.[[OBD:OSBD|OSBD]])<BR>(08993-weapon_empty.imp.[[OBD:OSBD|OSBD]])
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x6F8
| BGCOLOR="#C80040" | 00 00 00 00
| 0
| ALIGN=LEFT | unknown; always zero
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x6FC
| BGCOLOR="#FFCD96" | 01 '''81 0E''' 00
| 3713
| ALIGN=LEFT | link to 03713-w1_glow.[[OBD:TXMP|TXMP]]
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x700
| BGCOLOR="#FFCD96" | 01 '''82 0E''' 00
| 3714
| ALIGN=LEFT | link to 03714-w1_glow_ammo.[[OBD:TXMP|TXMP]]
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x704
| BGCOLOR="#C8C864" | 00 00 80 3F
| 1.000000
| ALIGN=LEFT | x-scale factor of glow textures
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x708
| BGCOLOR="#C8C864" | 00 00 80 3F
| 1.000000
| ALIGN=LEFT | z-scale factor of glow textures
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x70C
| BGCOLOR="#C8C864" | 76 65 EB 3F
| 1.839034
| ALIGN=LEFT | x-offset of pickup handle
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x710
| BGCOLOR="#C8C864" | 96 4C A9 3D
| 0.082666
| ALIGN=LEFT | y-offset of pickup handle
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x714
| BGCOLOR="#C8C864" | 06 E2 14 3E
| 0.145393
| ALIGN=LEFT | z-offset of pickup handle
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x718
| BGCOLOR="#C8C864" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | hovering height of unheld weapon
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|0x71C
| BGCOLOR="#0096C8" | AD DE
| dead
| ALIGN=LEFT | blank filler
|}
;Glow textures
:They're applied to the lower face of the M3GM's bounding box. The factors above are the ratio between the x/z extent of that face and the half-length/width of the glow textures. So if both factors are 0.5, the glow textures fit the bounding box exactly.
;Pickup handle
:The tolerance is hardcoded. The offsets are not relative to the weapon's axes, but to the world axes (!).
:This is a rather nasty "feature" (actually, the offsets ''should'' be relative to the weapon's orientation)
:The way it's now, the pickup volume of a WMC is not necessarily next to the handle. That's why it's hard to pick up.


Don't use the file suffix ".oni". The file prefix "M3GM" can also be absent; it's optional here.


----
M3GM files can be created with [[Vago_(tool)|Vago]]. When you convert the ONWC from XML back to .oni, be sure that the M3GM file is in the same folder.
----
==Notes==


====Old method====
There are various tags which compose the mesh, but all you really need to know that you can replace that content with data from another M3GM.


----
You can create M3GM meshes from OBJ files.
----
: ''onisplit -create:m3gm output_folder -tex:weapon_tex input_folder/weapon.obj''
{|align=center
:: "-tex" is optional
![[OBD:Oni Binary Data|ONI BINARY DATA]]
:: The TXMP file must be created separately (if needed).
|-
![[OBD:ONVL|ONVL]] << [[OBD:File types|Other file types]] >> [[OBD:OPge|OPge]]
|-
!ONWC : Oni Weapon Class
|}


Then you can convert the file to XML and replace the ONWC's old M3GM XML code (in case you didn't start from scratch). Remember to change the links (#N) and instance IDs of the new data.


==a bit XML==
{{XML}}
<Flags>...</Flags>
  02 - NoHolster
  04 - UsesCells
  08 - TwoHanded
  10 - RecoilAffectsAiming
  20 - Automatic
  40 - 64
  80 - StunSwitcher
  01 - KnockdownSwitcher
  02 - Explosive
  04 - SecondaryFire
  08 - BarabbasWeapon
  10 - Heavy
  20 - AutoRelease
  40 - HasReleaseDelay
  80 - HasLaserSight
  02 - ScaleCrosshair
  08 - NoFade
  10 - DrainAmmo

Revision as of 13:02, 5 April 2021

ONWC : Oni Weapon Class
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

ONVL << Other file types >> OPge

switch to OBD page

General information

  • The XML on this page is compatible with OniSplit v0.9.61.0.
  • Vanilla ONWC files are stored in AE/AEInstaller/vanilla/level0_Final.dat.

File structure

ONWC
  | 
  +-- M3GM (embedded 3D mesh)
        |
        +-- PNTA <Points>
        +-- VCRA <VertexNormals>
        +-- VCRA <FaceNormals>
        +-- TXCA <TextureCoordinates>
        +-- IDXA <TriangleStrips>
        +-- IDXA <FaceNormalIndices>
        +-- TXMP <Texture> (link to external file)

XML tags

XML tag Type Description
<LaserSight> See THIS section below.
<AmmoMeter> See THIS section below.
<Geometry> link Weapon instance number (#N). For geometry importing, see THIS section below.
<Name> char[32] ONWCfile.oni (don't use file prefix/suffix)
<MouseSensitivity> float Weapon's mouse sensitivity (applies to AI too).
<Recoil> See THIS section below.
<RecoilAnimationType> link A recoil animation type.
<ReloadAnimationType> link A reload animation type.
<PauseAfterReload> int16 Pause after reloading, in 1/60 seconds.
<MaxShots> int16 Number of "shots". Let's say a weapon has 4 emitters each with <UsedAmmo>1 and the weapon shall be able to fire 3 times. Then <MaxShots> has to be 12 = 4 * 1 * 3.

A mismatched <MaxShots> number creates an infinite-ammunition bug.

<ParticleCount> int16 Number of attached particles.
<FiringModeCount> int16 Number of used firing modes (max of 2?).
<PauseBeforeReload> int16 Pause before reloading, in 1/60 seconds.
<ReleaseDelay> int16 Delay between the moment the trigger is released and the moment the weapon stops firing.
<Flags> flag Weapon options
NoHolster
UsesCells
TwoHanded
RecoilAffectsAiming
Even without this flag, there will still be recoil. Recoil makes the aim travel upwards as the trigger is held down.
If the flag is set, the aiming will remain elevated after firing the gun.
If flag isn't set, the upward movement stops earlier, and when the firing ends, the weapon will fall to the previous aiming angle.
Automatic
StunSwitcher
If the enemy is within shooting distance (between <MinShootingDistance> and <MaxShootingDistance>) and is knocked down, stunned or blown up, the AI with this weapon switches to melee for a time specified in a *fight timer* field.
KnockdownSwitcher
If the enemy is within shooting distance and is knocked down or blown up, the AI with this weapon switches to melee for a time specified in a *fight timer* field.
Explosive
SecondaryFire
BarabbasWeapon
If the enemy is within shooting distance and is knocked down or blown up, the AI with this weapon switches to melee for a time specified in a *fight timer* field.
Heavy
AutoRelease
HasReleaseDelay
HasLaserSight
ScaleCrosshair
NoFade
DrainAmmo
<FiringModes> Holds 2 <FiringModes> tags.
<AIFiringMode> See THIS section below.
<Particles> Holds 16 <ONWCParticle> tags.
<ONWCParticle> See THIS section below.
<EmptyWeaponSound> link OSBDfile.imp.oni (don't use file prefix/suffix)
<Glow> link TXMPfile.oni (don't use file suffix)
<GlowAmmo> link TXMPfile.oni (don't use file suffix)
<GlowTextureScale> float XZ scale factor of glow textures around weapon when lying on the ground.
<PickupHandleOffset> float XYZ offset of weapon's pickup handle when on the ground.
<HoveringHeight> float Hovering height of weapon when on ground.
Glow textures
They're applied to the lower face of the M3GM's bounding box. The factors in <GlowTextureScale> are the ratio between the X/Z extent of that face and the half-length/width of the glow textures. So if both factors are 0.5, the glow textures fit the bounding box exactly.
Pickup handle
The tolerance around the defined handle is hardcoded. The offsets are not relative to the weapon's axes, but to the world axes (!). This is a rather nasty "feature", as the offsets should definitely be relative to the weapon's orientation. The way it is now, the pickup volume of Barabas' Wave Motion Cannon is not necessarily near the handle. That's why it's hard to pick up sometimes.

<LaserSight>

Crosshair
The default crosshair appears where the laser sight contacts the environment, corpses, etc. A locked-on version of the crosshair appears when the laser sight contacts characters (including the shooter). An "aiming tunnel" is used by the w8_mbo as a complement to the crosshair (w2_sap, w5_sbg, w7_scc and w9_scr use the tunnel with no crosshair).
XML tag Type Description
<Origin> float X, Y, Z
<Stiffness> float X component of laser sight direction?
<AdditionalAzimuth> float Wikipedia definition of azimuth
<AdditionalElevation> float Wikipedia definition of elevation
<LaserMaxLength> float Maximum length of laser sight vector.
<LaserColor> color Laser sight color in BGRA
<NormalTexture> link Crosshair texture: TXMPfile.oni (don't use file suffix)
<NormalColor> color Crosshair background color in BGRA
<NormalScale> float Crosshair scale factor
<LockedTexture> link Locked-on crosshair texture: TXMPfile.oni (don't use file suffix)
<LockedColor> color Locked-on crosshair background color in BGRA
<LockedScale> float Locked-on crosshair scale factor
<TunnelTexture> link Aiming tunnel texture
<TunnelColor> color Tunnel background color in RGBA
<TunnelScale> float Tunnel scale factor
<TunnelCount> int32 Number of tunnel textures
<TunnelSpacing> float Spacing of tunnel textures

<AmmoMeter>

XML tag Type Description
<Icon> link TXMPfile.oni (don't use file suffix)
<Empty> link TXMPfile.oni (don't use file suffix)
<Fill> link TXMPfile.oni (don't use file suffix)

<Recoil>

XML tag Type Description
<Base> float Recoil base (e.g. for w1_tap and w2_sap)
<Max> float Recoil max
<Factor> float Recoil factor
<ReturnSpeed> float Recoil return speed
<FiringReturnSpeed> float Recoil firing return speed

<AIFiringMode>

w11_ba1 is the only vanilla weapon in Oni that uses the second firing mode.

Transform matrix
Probably defined the orientation, scaling and position of the firing spread, but it doesn't appear to be used.
XML tag Type Description
<Flags> flag NoWildShots is the only accepted value. When the AI first sights an enemy, their first shot will go wide if this flag is set (making them more lifelike and giving the player a break). Also see <MaxStartleMisses> tag below.
<InverseDirection> matrix4x3 Targeting inverse transform matrix. The inverse of the matrix that gives the targeting direction.
<Direction> vector3 Targeting direction. Sets the orientation of the firing spread.
<Origin> vector3 Targeting origin. Sets the deviation of the AI's aim from the target's origin
<PredictionSpeed> float Prediction speed. The supposed speed of the projectile, used by the AI to predict where to fire in order to hit a moving target (note that this doesn't strictly work for an accelerating projectile like the plasma rifle's).
<MaxInaccuracyAngle> float Maximum inaccuracy angle. Sets the max angle between the weapon's aiming vector and the target's position; when the AI exceeds this angle (whether due to recoil or the target evading them), they will stop shooting, re-aim the weapon straight at the target, then resume shooting.
<AimRadius> float Always the same. Possibly related to the inaccuracy angle above.
<AISoundRadius> float Weapon's sound sphere radius. The sound sphere is created momentarily every time the weapon fires, and is used to alert the AI (see HERE to read about about AI sound spheres).
<MinShootingDistance> float Minimum shooting distance. If the target is closer than this, the AI ceases firing and moves backward from the target till at least this distance is achieved. Note that this is given as a diameter, not a radius, so the effective distance from the AI to the target is half of this value.
<MaxShootingDistance> float Maximum shooting distance. If the target is farther than this distance, then the AI ceases firing and moves toward the target until it gets below this distance.
<MaxStartleMisses> float Probably the maximum number of times that an AI will fire wildly when surprised before he starts aiming. Also see NoWildShots flag above.
<SkillIndex> int16 ONCC skill index
<FightTimer> int32 Unknown timer; 240 for w4_psm, 200 for v6_vdg.
<ProjectileSpeed> float Ballistic projectile speed (150 for SBG, 160 for WMC).
<ProjectileGravity> float Ballistic projectile gravity, causing the AI to anticipate the arc their shot will follow. Can be negative for firing at the enemy's feet (0.5 for SBG, 0.3 for WMC).
<FireSpreadLength> float Length of weapon's supposed fire spread. The AI can utilize gunfire-dodging mechanics when it intersects with a fire spread (read HERE for details). Can be visualized with "ai2_showfiringspreads=1" (180 for w1_tap, 150 for w2_sap, 120 for w4_psm).
<FireSpreadWidth> float Base width of weapon's supposed fire spread; can be visualized with "ai2_showfiringspreads=1".
<FireSpreadSkew> float Skew in the weapon's supposed fire spread; can be visualized with "ai2_showfiringspreads=1" (0.1 for w1_tap, 0.21 for w2_sap).
Firing spread

Note that the dodging-oriented fire spread set here is entirely separate from the weapon's actual fire spread, that is, the conical gunfire that a weapon like the autopistol produces (see note at end of the PAR3 Emitters section). The dodging fire spread is separate in order to allow fine-tuning of the area from which the AI will attempt to escape, rather than simply relying on the calculated cone of weapons fire that is actually produced.

<ONWCParticle>

Transformation matrix
This is what defines particle orientation, stretching, etc. See CRSA for details.
XML tag Type Description
<Transform> matrix4x3 The transformation matrix (xx xy xz yx yy yz zx zy zz + x y z offset) of the particle to the weapon.
<ParticleClass> link BINA3RAPfile.oni (don't use file prefix/suffix)
<UsedAmmo> int16 Ammo to remove from current clip when weapon is fired (different for the 2 firing modes of w11_ba1).
<ShotDelay> int16 Normal delay between shots, in frames.
<RoughJusticeShotDelay> int16 'roughjustice' delay between shots, in frames.
<ActiveFrames> int16 Minimum number of frames that the weapon will be firing for; used for w4_psm and w11_ba1.
<TriggeredBy> int16
0 (particle is triggered by fire1)
1 (particle is triggered by fire2)
-1 (particle is triggered by both firing modes)
<DelayBeforeFiring> int16 Delay before firing (think of the WMC's long warm-up time).

Particle adjustment

When adding particles in the <ONWCParticle> section, the last three values of <Transform> are the particle's start location.

In your 3D editor, any object can serve as a helpful reference: pick one point of the object and move it to the location from where the particle should be spawned. Copy the value into the XML file. (Caution: Mod Tool uses a comma as a decimal mark, but OniSplit's XML files use a period.)

M3GM model

Export

onisplit -extract:obj output_folder input_folder\ONWCfile.oni
Version tips:
OniSplit v0.9.86.0 and v0.9.94.0 cannot extract OBJ or DAE using this method
OniSplit v0.9.61.0 can extract M3GM only as OBJ
OniSplit v0.9.41.0 can extract M3GM as OBJ or DAE

Import

In your 3D editor, the weapon must be positioned on the XZ plane and pointing into +X space (weapon rotation {0, 0, 0}).

The center will be located at {0, 0, 0}, while the weapon's grip ends at the approximate position {0.3, ___, -0.5} and {0.8, ___, -0.5}.

Now you can create an M3GM file from the geometry.

New method

To import or change weapon geometry, simply insert the M3GM's file name into ONWC's <Geometry> tag. For example:

<Geometry>M3GMw1_tap_new</Geometry>

Don't use the file suffix ".oni". The file prefix "M3GM" can also be absent; it's optional here.

M3GM files can be created with Vago. When you convert the ONWC from XML back to .oni, be sure that the M3GM file is in the same folder.

Old method

There are various tags which compose the mesh, but all you really need to know that you can replace that content with data from another M3GM.

You can 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 be created separately (if needed).

Then you can convert the file to XML and replace the ONWC's old M3GM XML code (in case you didn't start from scratch). Remember to change the links (#N) and instance IDs of the new data.