XML:ONWC

From OniGalore
Revision as of 10:16, 20 April 2012 by Paradox-01 (talk | contribs)
Jump to navigation Jump to search


Template:XMLModdingHints

The xml code on this page is compatible with onisplit v0.9.61.0

general information

  • ONWC files are stored at Edition\install\VanillaDats\level0_Final\level0_Final (AE 2010-05a)


file structure

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


ONWC: Oni Weapon Class

XML tag type description
<LaserSight> see HERE
<AmmoMeter> see HERE
<Geometry> link weapon instance number (#N)
<Name> char[32] ONWCfile.oni (don't use file prefix/suffix)
<MouseSensitivity> float weapon mouse sensitivity (applies on AI, too)
<Recoil> see HERE
<RecoilAnimationType> link an recoil animation type
<ReloadAnimationType> link an reload animation type
<PauseAfterReload> int16 pause after reload in 1/60 seconds
<MaxShots> int16 amount of shots
<ParticleCount> int16 amount of particles
<FiringModeCount> int16 amount of used firing modes (max = 2 ?)
<PauseBeforeReload> int16 pause before reload in 1/60 seconds
<ReleaseDelay> int16 release delay; delay between the moment the trigger is released and the moment the weapon stops firing
<Flags> flag weapon options
NoHolster
UsesCells
TwoHanded
RecoilAffectsAiming
Automatic
StunSwitcher
if enemy is inside shooting distance (between min and max) and is knockdowned/stuned or blownupped, AI with this weapon switches to melee for a time specified in a *fight timer* field
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
Explosive
SecondaryFire
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
Heavy
AutoRelease
HasReleaseDelay
HasLaserSight
ScaleCrosshair
NoFade
DrainAmmo
<FiringModes> holds 2 <FiringModes> tags
<AIFiringMode> see HERE
<Particles> holds 16 <ONWCParticle> tags
<ONWCParticle> see HERE
<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 x z scale factor of glow textures
<PickupHandleOffset> float x y z offset of pickup handle
<HoveringHeight> float hovering height of unheld weapon
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.


<LaserSight>

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
XML tag type description
<Origin> float x y z
<Stiffness> float x-component of laser sight direction ?
<AdditionalAzimuth> float wikipedia:Azimuth
<AdditionalElevation> float wikipedia:Elevation
<LaserMaxLength> float maximal length of laser sight vector
<LaserColor> color laser sight color: B G R A
<NormalTexture> link crosshair texture: TXMPfile.oni (don't use file suffix)
<NormalColor> color crosshair background color: B G R A
<NormalScale> float crosshair scale factor
<LockedTexture> link locked crosshair texture: TXMPfile.oni (don't use file suffix)
<LockedColor> color locked crosshair background color: B G R A
<LockedScale> float locked crosshair scale factor
<TunnelTexture> link tunnel texture
<TunnelColor> color tunnel background color: R G B A
<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 original weapon that use also the second firing mode.

Transform matrix
Probably defines the orientation, scaling and position of the firing spread. It doesn't appear to be used.
XML tag type description
<Flags> flag NoWildShots
<InverseDirection> matrix4x3 targeting inverse transform matrix - the inverse of the matrix that gives the targeting direction
<Direction> vector3 targeting direction; sets orientation of firingspread
<Origin> 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)
<PredictionSpeed> 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
<MaxInaccuracyAngle> 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
<AimRadius> float aim_radius; always the same; possible related to the inaccuracy angle above
<AISoundRadius> float weapon sound sphere radius; defines radius of the A.I. sound sphere (gunfire type, see HERE about A.I. sound spheres) which is created for a short moment when this weapon is fired
<MinShootingDistance> 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
<MaxShootingDistance> 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
<MaxStartleMisses> float maximum startle misses; probably the maximum number of shots an ai can miss when suprised before he starts aiming
<SkillIndex> int16 ONCC skill index
<FightTimer> int32 fight 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, can be negative for firing at the enemy's feet (0.5 for SBG, 0.3 for WMC)
<FireSpreadLength> float length of a firingspread; A.I. can utilize gunfire dodge mechanics when it collides with some firingspread (read HERE); can be seen by *ai2_showfiringspreads=1* (180 for w1_tap, 150 for w2_sap, 120 for w4_psm)
<FireSpreadWidth> float length of the firingspread's base; can be seen by ai2_showfiringspreads=1
<FireSpreadSkew> float firingspread's skew; can be seen by ai2_showfiringspreads=1 (0.1 for w1_tap, 0.21 for w2_sap)


<ONWCParticle>

Transformation matrix
That's what defines orientation, stretching, etc.
See CRSA for details.
XML tag type description
<Transform> matrix4x3 transformation matrix xx xy xz yx yy yz zx zy zz + x y z offset of particle to weapon
<ParticleClass> link BINA3RAPfile.oni (don't use file prefix/suffix)
<UsedAmmo> int16 ammo decrement (different for the 2 firing modes of w11_ba1)
<ShotDelay> int16 normal delay between shots in frames
<RoughJusticeShotDelay> 'roughjustice' delay between shots in frames
<ActiveFrames> int16 number in frames for active firing mode (1st frame for activate); 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


M3GM

Are there some tags which make together the mesh but you basically need to know that you can replace that content with data from another M3GM.

You can create M3GM meshes from obj files. OniSplit v0.9.61.0 refuse to create a single M3GM. Instead, use OniSplit v0.9.41.0

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.