XML:ONWC: Difference between revisions
Paradox-01 (talk | contribs) m (particle adjustment) |
Paradox-01 (talk | contribs) m (i should install a dictionary again...) |
||
Line 443: | Line 443: | ||
'''import''' | '''import''' | ||
The weapon must be | The weapon must be positioned on XZ plane and pointing into +X (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 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 |
Revision as of 17:55, 20 June 2012
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
|
<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 |
|
<DelayBeforeFiring> | int16 | delay before firing |
particle adjustment
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
export
- onisplit -extract:obj output_folder input_folder\ONWCfile.oni
- version hint:
- onisplit v0.9.61.0 can extract M3GM only as obj
- onisplit v0.9.41.0 can extract M3GM as obj or dae
import
The weapon must be positioned on XZ plane and pointing into +X (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
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 -create:m3gm output_folder -tex:weapon_tex input_folder/weapon.obj
- -tex is optional
- The TXMP file must created separately (if needed).
Then you can convert the file to xml and replace the 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.