XML:ONWC: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (changing link from http->https)
(clarified unused field <MaxStartleMisses>)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{XML_File_Header | type=ONWC | prev=ONVL | next=OPge | name=Oni Weapon Class }}
{{XML_File_Header | prev=ONVL | type=ONWC | next=OPge | name=Oni Weapon Class}}


__TOC__
==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.


'''general information'''
==File structure==
* The xml code on this page is compatible with onisplit '''v0.9.61.0'''
{{Tree list}}
* vanilla ONWC files are stored at/inside
*ONWC
** Edition/install/VanillaDats/level0_Final/level0_Final '''(AE v6)'''
**M3GM (embedded 3D mesh)
** AE/AEInstaller/vanilla/level0_Final.dat '''(AE v7)'''
***PNTA <Points>
 
***VCRA <VertexNormals>
 
***VCRA <FaceNormals>
'''file structure'''
***TXCA <TextureCoordinates>
 
***IDXA <TriangleStrips>
ONWC
***IDXA <FaceNormalIndices>
  |
***TXMP <Texture> (link to external file)
  +-- M3GM (embedded 3D mesh)
{{Tree list/end}}
        |
        +-- PNTA <Points>
        +-- VCRA <VertexNormals>
        +-- VCRA <FaceNormals>
        +-- TXCA <TextureCoordinates>
        +-- IDXA <TriangleStrips>
        +-- IDXA <FaceNormalIndices>
        +-- TXMP <Texture> (link to external file)
 
 
==ONWC: Oni Weapon Class==


==XML tags==
{|class="wikitable" width=100%
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=120px| '''XML tag'''
|width=60px| '''type'''
|width=60px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <LaserSight>
| <LaserSight>
|
|
| see [[#<LaserSight>|HERE]]
| See [[#<LaserSight>|THIS]] section below.
|-
|-
| <AmmoMeter>
| <AmmoMeter>
|
|
| see [[#<AmmoMeter>|HERE]]
| See [[#<AmmoMeter>|THIS]] section below.
|-
|-
| <Geometry>
| <Geometry>
| link
| link
| [[#M3GM|Weapon instance]] number (#N). For geometry import/exchange see [[#new_method|HERE]].
| [[#M3GM model|Weapon instance]] number (#N). For geometry importing, see [[#New method|THIS]] section below.
|-
|-
| <Name>
| <Name>
Line 50: Line 42:
| <MouseSensitivity>
| <MouseSensitivity>
| float
| float
| weapon mouse sensitivity (applies on AI, too)
| Weapon's mouse sensitivity (applies to AI too).
|-
|-
| <Recoil>
| <Recoil>
|
|
| see [[#<Recoil>|HERE]]
| See [[#<Recoil>|THIS]] section below.
|-
|-
| <RecoilAnimationType>
| <RecoilAnimationType>
| link
| link
| an recoil [[XML:StNA#animation_types|animation type]]
| A recoil [[XML:StNA#Animation_types|animation type]].
|-
|-
| <ReloadAnimationType>
| <ReloadAnimationType>
| link
| link
| an reload [[XML:StNA#animation_types|animation type]]
| A reload [[XML:StNA#Animation_types|animation type]].
|-
|-
| <PauseAfterReload>
| <PauseAfterReload>
| int16
| int16
| pause after reload in 1/60 seconds
| Pause after reloading, in 1/60 seconds.
|-
|-
|valign=top| <MaxShots>
|valign=top| <MaxShots>
|valign=top| int16
|valign=top| int16
| amount of shots
| 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.


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.
 
A mismatching <MaxShots> number creates an infinite ammunition bug.
|-
|-
| <ParticleCount>
| <ParticleCount>
| int16
| int16
| amount of particles
| Number of attached particles.
|-
|-
| <FiringModeCount>
| <FiringModeCount>
| int16
| int16
| amount of used firing modes (max = 2 ?)
| Number of used firing modes (max of 2?).
|-
|-
| <PauseBeforeReload>
| <PauseBeforeReload>
| int16
| int16
| pause before reload in 1/60 seconds
| Pause before reloading, in 1/60 seconds.
|-
|-
| <ReleaseDelay>
| <ReleaseDelay>
| int16
| int16
| release delay; delay between the moment the trigger is released and the moment the weapon stops firing
| Delay between the moment the trigger is released and the moment the weapon stops firing.
|-
|-
|valign=top| <Flags>
|valign=top| <Flags>
|valign=top| flag
|valign=top| flag
| weapon options
| Weapon options
: NoHolster
: NoHolster
: UsesCells
: UsesCells
: TwoHanded
: TwoHanded
: RecoilAffectsAiming
: RecoilAffectsAiming
:: Without this flag there will be still recoil. In any case the recoil makes the aim go upwards.
:: Even without this flag, there will still be recoil. Recoil makes the aim travel upwards as the trigger is held down.
:: If flag is set: the aiming will stay the same after firing the gun.
:: 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 fire ended the arm will fall to the previous aiming position. ([https://youtu.be/eq91flq6YkU w1_tap observation])
:: 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
: Automatic
: StunSwitcher
: StunSwitcher
:: if enemy is inside shooting distance (between min and max) and is knockdowned/stunned or blownupped, AI with this weapon switches to melee for a time specified in a *fight timer* field
:: 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
: KnockdownSwitcher
:: if enemy is inside shooting distance (between min and max) and is knockdowned or blownupped, AI with this weapon switches to melee for a time specified in a *fight timer* field
:: 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
: Explosive
: SecondaryFire
: SecondaryFire
: BarabbasWeapon
: BarabbasWeapon
:: if enemy is inside shooting distance (between min and max) and is knockdowned or blownupped, AI with this weapon switches to melee for a time specified in a *fight timer* field
:: 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
: Heavy
: AutoRelease
: AutoRelease
Line 121: Line 111:
| <FiringModes>
| <FiringModes>
|
|
| holds 2 <FiringModes> tags
| Holds 2 <FiringModes> tags.
|-
|-
| <AIFiringMode>
| <AIFiringMode>
|
|
| see [[#<AIFiringMode>|HERE]]
| See [[#<AIFiringMode>|THIS]] section below.
|-
|-
| <Particles>
| <Particles>
|
|
| holds 16 <ONWCParticle> tags
| Holds 16 <ONWCParticle> tags.
|-
|-
| <ONWCParticle>
| <ONWCParticle>
|
|
| see [[#<ONWCParticle>|HERE]]
| See [[#<ONWCParticle>|THIS]] section below.
|-
|-
| <EmptyWeaponSound>
| <EmptyWeaponSound>
Line 149: Line 139:
| <GlowTextureScale>
| <GlowTextureScale>
| float
| float
| x z scale factor of glow textures
| XZ scale factor of glow textures around weapon when lying on the ground.
|-
|-
| <PickupHandleOffset>
| <PickupHandleOffset>
| float
| float
| x y z offset of pickup handle
| XYZ offset of weapon's pickup handle when on the ground.
|-
|-
| <HoveringHeight>
| <HoveringHeight>
| float
| float
| hovering height of unheld weapon
| Hovering height of weapon when on ground.
|}
|}


; Glow textures
; 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.
: 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
; Pickup handle
: The tolerance is hardcoded. The offsets are not relative to the weapon's axes, but to the world axes (!).
: 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.
: 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.
 


===<LaserSight>===
===<LaserSight>===
; Crosshair
; Crosshair
: Default crosshair appears where the laser sight hits environment, corpses, etc
: 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).
: 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


{|class="wikitable" width=100%
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=120px| '''XML tag'''
|width=60px| '''type'''
|width=60px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <Origin>
| <Origin>
| float
| float
| x y z
| X, Y, Z
|-
|-
| <Stiffness>
| <Stiffness>
| float
| float
| x-component of laser sight direction ?
| X component of laser sight direction?
|-
|-
| <AdditionalAzimuth>
| <AdditionalAzimuth>
| float
| float
| [[wikipedia:Azimuth]]
| [[wikipedia:Azimuth|Wikipedia definition of azimuth]]
|-
|-
| <AdditionalElevation>
| <AdditionalElevation>
| float
| float
| [[wikipedia:Elevation]]
| [[wikipedia:Elevation|Wikipedia definition of elevation]]
|-
|-
| <LaserMaxLength>
| <LaserMaxLength>
| float
| float
| maximal length of laser sight vector
| Maximum length of laser sight vector.
|-
|-
| <LaserColor>
| <LaserColor>
| color
| color
| laser sight color: B G R A
| Laser sight color in BGRA
|-
|-
| <NormalTexture>
| <NormalTexture>
| link
| link
| crosshair texture: TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
| Crosshair texture: TXMPfile<font color="#777777">.oni (don't use file suffix)</font>
|-
|-
| <NormalColor>
| <NormalColor>
| color
| color
| crosshair background color: B G R A
| Crosshair background color in BGRA
|-
|-
| <NormalScale>
| <NormalScale>
| float
| float
| crosshair scale factor
| Crosshair scale factor
|-
|-
| <LockedTexture>
| <LockedTexture>
| link
| link
| locked crosshair texture: TXMPfile<font color="#777777">.oni (don't use file suffix)</font>  
| Locked-on crosshair texture: TXMPfile<font color="#777777">.oni (don't use file suffix)</font>  
|-
|-
| <LockedColor>
| <LockedColor>
| color
| color
| locked crosshair background color: B G R A
| Locked-on crosshair background color in BGRA
|-
|-
| <LockedScale>
| <LockedScale>
| float
| float
| locked crosshair scale factor  
| Locked-on crosshair scale factor  
|-
|-
| <TunnelTexture>
| <TunnelTexture>
| link
| link
| tunnel texture
| Aiming tunnel texture
|-
|-
| <TunnelColor>
| <TunnelColor>
| color
| color
| tunnel background color: R G B A
| Tunnel background color in RGBA
|-
|-
| <TunnelScale>
| <TunnelScale>
| float
| float
| tunnel scale factor  
| Tunnel scale factor  
|-
|-
| <TunnelCount>
| <TunnelCount>
| int32
| int32
| number of tunnel textures
| Number of tunnel textures
|-
|-
| <TunnelSpacing>
| <TunnelSpacing>
| float
| float
| spacing of tunnel textures
| Spacing of tunnel textures
|}
|}


===<AmmoMeter>===
===<AmmoMeter>===
{|class="wikitable" width=100%
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=120px| '''XML tag'''
|width=60px| '''type'''
|width=60px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <Icon>
| <Icon>
Line 268: Line 251:
| TXMPfile<font color="#777777">.oni (don't use file suffix)</font>  
| TXMPfile<font color="#777777">.oni (don't use file suffix)</font>  
|}
|}


===<Recoil>===
===<Recoil>===
{|class="wikitable" width=100%
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=120px| '''XML tag'''
|width=60px| '''type'''
|width=60px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <Base>
| <Base>
| float
| float
| recoil base (e.g. for w1_tap and w2_sap)
| Recoil base (e.g. for w1_tap and w2_sap)
|-
|-
| <Max>
| <Max>
| float
| float
| recoil max
| Recoil max
|-
|-
| <Factor>
| <Factor>
| float
| float
| recoil factor
| Recoil factor
|-
|-
| <ReturnSpeed>
| <ReturnSpeed>
| float
| float
| recoil return speed
| Recoil return speed
|-
|-
| <FiringReturnSpeed>
| <FiringReturnSpeed>
| float
| float
| recoil firing return speed
| Recoil firing return speed
|}
|}


===<AIFiringMode>===
===<AIFiringMode>===
w11_ba1 is the only original weapon that use also the second firing mode.
w11_ba1 is the only vanilla weapon in Oni that uses the second firing mode.


; Transform matrix
; Transform matrix
: Probably defines the orientation, scaling and position of the firing spread. It doesn't appear to be used.
: Probably defined the orientation, scaling and position of the firing spread, but it doesn't appear to be used.


{|class="wikitable" width=100%
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=120px| '''XML tag'''
|width=60px| '''type'''
|width=60px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <Flags>
| <Flags>
| flag
| flag
| NoWildShots
| 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>
| <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; sets orientation of firingspread
| Targeting direction. Sets the orientation of the firing spread.
|-
|-
| <Origin>
| <Origin>
| vector3
| vector3
| targeting origin; sets deviation of A.I.'s aim from target's origin (target's origin + this vector = direction where to aim and fire)
| Targeting origin. Sets the deviation of the AI's aim from the target's origin
|-
|-
| <PredictionSpeed>
| <PredictionSpeed>
| float
| float
| prediction speed; numeric speed of the projectile A.I. prediction takes into account when calculating where to fire in order to hit moving target
| 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>
| <MaxInaccuracyAngle>
| float
| float
| 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
| 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>
| <AimRadius>
| float
| float
| aim_radius; always the same; possible related to the inaccuracy angle above
| Always the same. Possibly related to the inaccuracy angle above.
|-
|-
| <AISoundRadius>
| <AISoundRadius>
| float
| float
| weapon sound sphere radius; defines radius of the A.I. sound sphere (gunfire type, see [[AI#Vision and hearing|HERE]] about A.I. sound spheres) which is created for a short moment when this weapon is fired
| 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>
| <MinShootingDistance>
| float
| float
| minimal shooting distance; if target is closer than min.shoot.dist then A.I. ceases fire and moves away from the target till at least min.shoot.dis. is achieved; diameter, not a radius, so effective distance from A.I. to target is half of this value
| 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>
| <MaxShootingDistance>
| float
| float
| maximal shooting distance; if target is further than max.shoot.dist then A.I. ceases fire and moves towards the target until at least max.shoot.dis. is achieved
| 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>
| <MaxStartleMisses>
| float
| float
| maximum startle misses; probably the maximum number of shots an AI can miss when surprised before he starts aiming
| Unused. If used, this would be the maximum number of times that an AI's shots will have extra inaccuracy when he begins aiming at a target. Also see NoWildShots flag above.
|-
|-
| <SkillIndex>
| <SkillIndex>
Line 359: Line 340:
| <FightTimer>
| <FightTimer>
| int32
| int32
| fight timer, 240 for w4_psm, 200 for v6_vdg
| Unknown timer; 240 for w4_psm, 200 for v6_vdg.
|-
|-
| <ProjectileSpeed>
| <ProjectileSpeed>
| float
| float
| ballistic projectile speed (150 for SBG, 160 for WMC)
| Ballistic projectile speed (150 for SBG, 160 for WMC).
|-
|-
| <ProjectileGravity>
| <ProjectileGravity>
| float
| float
| ballistic projectile gravity, can be negative for firing at the enemy's feet (0.5 for SBG, 0.3 for WMC)
| 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>
| <FireSpreadLength>
| float
| float
| length of a firingspread; A.I. can utilize gunfire dodge mechanics when it collides with some firingspread (read [[AI#Basic combat behaviors|HERE]]); can be seen by *ai2_showfiringspreads=1* (180 for w1_tap, 150 for w2_sap, 120 for w4_psm)
| 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>
| <FireSpreadWidth>
| float
| float
| length of the firingspread's base; can be seen by ai2_showfiringspreads=1
| Base width of weapon's supposed fire spread; can be visualized with "ai2_showfiringspreads=1".
|-
|-
| <FireSpreadSkew>
| <FireSpreadSkew>
| float
| float
| firingspread's skew; can be seen by ai2_showfiringspreads=1 (0.1 for w1_tap, 0.21 for w2_sap)
| 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).
|}
|}


;Fire spread
;Firing spread
Note that the dodging fire spread set here is entirely separate from the weapon's <u>actual</u> fire spread, that is, the conical bullet fire 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.
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.
 


===<ONWCParticle>===
===<ONWCParticle>===
; Transformation matrix
; Transformation matrix
: That's what defines orientation, stretching, etc.
: This is what defines particle orientation, stretching, etc. See [[OBD:CRSA|CRSA]] for details.
: See [[OBD:CRSA|CRSA]] for details.


{|class="wikitable" width=100%
{|class="wikitable" width=100%
|width=120px| '''XML tag'''
|width=120px| '''XML tag'''
|width=60px| '''type'''
|width=60px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <Transform>
| <Transform>
| matrix4x3
| matrix4x3
| transformation matrix xx xy xz yx yy yz zx zy zz + x y z offset of particle to weapon
| The transformation matrix (xx xy xz yx yy yz zx zy zz + x y z offset) of the particle to the weapon.
|-
|-
| <ParticleClass>
| <ParticleClass>
Line 406: Line 385:
| <UsedAmmo>
| <UsedAmmo>
| int16
| int16
| ammo decrement (different for the 2 firing modes of w11_ba1)
| Ammo to remove from current clip when weapon is fired (different for the 2 firing modes of w11_ba1).
|-
|-
| <ShotDelay>
| <ShotDelay>
| int16
| int16
| normal delay between shots in frames
| Normal delay between shots, in frames.
|-
|-
| <RoughJusticeShotDelay>
| <RoughJusticeShotDelay>
| int16
| int16
| 'roughjustice' delay between shots in frames  
| 'roughjustice' delay between shots, in frames.
|-
|-
| <ActiveFrames>
| <ActiveFrames>
| int16
| int16
| number in frames for active firing mode (1st frame for activate); Used for w4_psm and w11_ba1
| Minimum number of frames that the weapon will be firing for; used for w4_psm and w11_ba1.
|-
|-
|valign=top| <TriggeredBy>
|valign=top| <TriggeredBy>
Line 429: Line 408:
| <DelayBeforeFiring>
| <DelayBeforeFiring>
| int16
| int16
| delay before firing
| 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.


====particle adjustment====
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.)
When adding particles in <ONWCParticle> section then the last three values of <Transform> are the particle start location.  


Inside the 3D editor any object can serve as a helpful reference: pick one point of it 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 decimal mark, onisplit's xml files use a point.)
==M3GM model==
 
===Export===
 
==M3GM==
===export===
: ''onisplit -extract:obj output_folder input_folder\ONWCfile.oni''
: ''onisplit -extract:obj output_folder input_folder\ONWCfile.oni''
: version hint:
: Version tips:
:: onisplit v0.9.86.0 and v0.9.94.0 can not extract obj or dae (using this method)
:: 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.61.0 can extract M3GM only as OBJ
:: onisplit v0.9.41.0 can extract M3GM as obj or dae
:: OniSplit v0.9.41.0 can extract M3GM as OBJ or DAE


===import===
===Import===
In your 3D editor the weapon must be positioned on XZ plane and pointing into +X (weapon rotation 0, 0, 0).
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 is located in 0, 0, 0 while the weapon grasp ends at approximate position: X=0,3 Y=# Z=-0,5 and X=0,8 Y=# Z=-0,5
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 a M3GM file from the geometry.
Now you can create an M3GM file from the geometry.


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


  <Geometry>M3GMw1_tap_new</Geometry>
  <Geometry>M3GMw1_tap_new</Geometry>


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


File prefix M3GM can be absent from the name, 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.


M3GM files can be created with [[Vago_(tool)|Vago]].
====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.


When you convert the ONWC from xml back to oni be sure that the M3GM file is in the same folder.
You can create M3GM meshes from OBJ files.
 
 
====old method====
There are some tags which make together the mesh but you basically 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''
: ''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 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.
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.


{{XML}}
{{XML}}

Latest revision as of 16:54, 6 March 2024

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 Unused. If used, this would be the maximum number of times that an AI's shots will have extra inaccuracy when he begins aiming at a target. 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.