FANDOM


The lines are mixed from various weapons, so don't wonder about the random values. In fact this code could work, but I cannot imagine this weapon.


Weapons.xml:

Kits: 1 = Commando 2 = Soldier 3 = Commando + Soldier 4 = Gunner 5 = Commando +Gunner 6 = Soldier + Gunner 7 = Soldier + Gunner + Commando

Class: 1 = MG 2 = Pistol 3 = Shotgun 4 = SMG 5 = unknown 6 = Hand Grenade 7 = TNT 8 = RPG/GL


HeaderEdit

ObjectTemplate.create GenericFireArm bri_gl_TanMgl

  • Creates a new weapon

ObjectTemplate.saveInSeparateFile 1

  • Unknown

ObjectTemplate.geometry ger_smg_mp40_mod

  • Loads the given weapon mesh

GeometryTemplate.setSubGeometryLodDistance 1 0 5
GeometryTemplate.setSubGeometryLodDistance 1 1 15
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
GeometryTemplate.hasAdditiveAlpha 1

  • Unknown, seem to be static

ObjectTemplate.AnimationSystem3p Objects\soldiers\british_male_soldier\Animations\SMG_MP40\AnimationSystem3p.inc

  • Loads the according animation

WeaponHudEdit

ObjectTemplate.createComponent WeaponHud

  • New WeaponHud component

ObjectTemplate.weaponHud.weaponIcon Ingame\Weapons\weapon3010.tga
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\weapon3010.tga
ObjectTemplate.weaponHud.notSelectedIcon Ingame\Weapons\weapon3010n.tga

  • Icon Paths
  • weaponxxxxn is half transparent

ObjectTemplate.weaponHud.guiIndex 7

  • Tells which crosshair should be used (defined in Menu_server.zip\HUD\HudSetup\GUIIndex.txt)
  • 1= Sniper Rifle
  • 2= Normal Rifle (unused)
  • 3= Machine Gun
  • 4= Sub-Machine Gun
  • 5= Default Crosshair
  • 6= Pistol
  • 7= Shotgun
  • 8= Knife
  • 9= Grenade/TNT
  • 10= Tank Buster
  • 11= Tank
  • 12= Plane
  • 13= AA Gun

ObjectTemplate.weaponHud.hasRangeFinder 1
ObjectTemplate.weaponHud.addShowOnCamMode 3
ObjectTemplate.weaponHud.useCartridgeBar 1
ObjectTemplate.weaponHud.disableOnSprint 1
ObjectTemplate.weaponHud.descrString DESCRIPTION_WEAPON_BRI_GER_SHOTGUN_DEFAULT
ObjectTemplate.weaponHud.ignoreTargetDistance 1

  • Those are invisible, static or not implemented

ObjectTemplate.weaponHud.hudName "WEST_Custom_Item_3120"

  • Sets the weapon name given in the Localization/string.csv

FireEdit

ObjectTemplate.createComponent SingleFireComp

  • New SingleFireComp component

ObjectTemplate.fire.roundsPerMinute 225

  • Sets the delay between two shots. The higher RPM the faster the ammo will run out

ObjectTemplate.fire.addFireRate 0

  • 0= singel fire
  • 1= burst fire
  • 2= Full automatic

ObjectTemplate.fire.burstSize 0

  • If burst mode in on, how many shots will burst out

ObjectTemplate.fire.batchSize 12

  • How many bullets come out per shot - independent from burst and ammo size

ObjectTemplate.fire.projectileStartPositionStand 0.1/0.8/0

  • Where the shot comes out relative to the weapon or player

ObjectTemplate.fire.projectileStartPositionCrouch 0.1/-0.1/0

  • Same as above in crouch position

ObjectTemplate.fire.maxProjectilesInWorld 24

  • How many bullets/shots can exist at the same time, if it's too low the bullets will disappear during the fly cause they'll make place for the new ones.

ObjectTemplate.fire.busyUntilButtonRelease 0

  • 0 = do not freeze fire animation at the end of a shot.
  • 1 = freeze fire animation at end of a shot until fire button is released. Useful on scoped rifles so you can continue looking thru scope after the shot to see if you scored a hit/kill.

ObjectTemplate.fire.alwaysFireFromWeapon 0

  • unknown (values: 0 or 1)

ObjectTemplate.fire.fireCompleteDelay 0.5

  • The delay in seconds before shooting, occurs after switching weapons or free fall.

ObjectTemplate.fire.criticalHitChance 0.05

  • Critical hit chance

ObjectTemplate.fire.criticalHitDamage 2

  • Critical hit damage

ObjectTemplate.fire.allowZoomOnRof 1

  • Optional line if the weapon uses zoom (see #Zoom)
  • 0 = no zoom; that line is useless
  • 1 = zoom is used

AmmoEdit

ObjectTemplate.createComponent DefaultAmmoComp

  • New DefaultAmmoComp component

ObjectTemplate.ammo.ammoType 1

  • unknown, static

ObjectTemplate.ammo.nrOfMags 4

  • -1 = infinte
  • 0 = unknown
  • >0 = How many total clips/magazines the gun starts with, including the one pre-loaded in the gun. (e.g. 4 means one in the gun plus 3 spares)

ObjectTemplate.ammo.magSize 12

  • Number of rounds in a single clip/magazine. If weapon reloads one round at a time (vs a clip or mag) this is the total number of rounds, not mags. A round is considered a mag, and nrOfMags becomes the number of rounds reloaded on each reload sequence.

ObjectTemplate.ammo.reloadTime 3.5

  • Reload time (in secs) to change clip/magazine

ObjectTemplate.ammo.forceWeaponSwitchWhenNoAmmo 0

  • 0 = Nothing happens if ammo runs out
  • 1 = When ammo is empty the weapon switches to the pre-used weapon

ObjectTemplate.ammo.reloadWithoutPlayer 1

  • 0 = Off (Reloading is cancelled when switching to another weapon)
  • 1 = On (Reload will continue)

ObjectTemplate.ammo.autoReload 0

  • 0 = Off (Manually)
  • 1 = On

RecoilEdit

A recoil component is not required for a weapon; it's optional.

ObjectTemplate.createComponent SoldierBasedRecoilComp

  • New SoldierBasedRecoilComp component

ObjectTemplate.recoil.hasRecoilForce 1

  • 0 = no recoil
  • 1 = recoil

ObjectTemplate.recoil.goBackOnRecoil 0

  • Step back in metres

ObjectTemplate.recoil.recoilForceUp CRD_NONE/0.8/1.5/0

  • First value: vertical recoil type
    • CRD_NONE : Normal
    • CRD_UNIFORM : Random, very unstable
  • Second value:
    • How much it will distance from the origin spot
  • Third value:
    • How much it will return to the orinin spot after the maximum amplitude was reached
  • Fourth value:
    • Unknown, static

ObjectTemplate.recoil.recoilForceLeftRight CRD_NONE/-0.45/0.45/0

  • Same as Recoil up, but horizontal
  • Positive value is equal to a recoil in left direction
  • Negative value is equal to a recoil in right direction

ObjectTemplate.recoil.recoilGraphFrameCount 2
ObjectTemplate.recoil.recoilGraphExponent 6
ObjectTemplate.recoil.recoilGraphTotalMovement 0.6

  • Unknown, static

DeviationEdit

A deviation component is not required for a weapon; it's optional.

It is not clear what the deviation value actually means, but you could say: The value is the angle in which the projectiles leave the gun.

If you remove certain deviation components, those components will be ignored. It is not recommended to remove the mindev lines.

There are three types of deviation comps:

  • TargetDeviationComp
  • SimpleDeviationComp
  • SoldierDeviationComp


ObjectTemplate.createComponent SoldierDeviationComp

  • New SoldierDeviationComp component, default in Heroes

ObjectTemplate.deviation.minDev 0.5

  • 0= Zero
  • 0.5= Medium
  • 1= High
  • 40= Very High (e.g. Unscoped Rifle)

ObjectTemplate.deviation.subProjectileDev 2.2

  • If your weapon fires batches of projectiles, use this to set the deviation of the projectiles within the cluster


ObjectTemplate.deviation.minDevModZoom 0

  • The minimum factor for the deviation while the soldier is zoomed in.
  • All values will be multiplied with this value.

ObjectTemplate.deviation.setFireDev 0 0 0 (<Max> <Add> <Sub>) ObjectTemplate.deviation.setTurnDev 0 0 0 0 (<Max> <AddPitch> <AddYaw> <Sub>) ObjectTemplate.deviation.setSpeedDev 0 0 0 0 (<Max> <AddForward> <AddStrafe> <Sub>) ObjectTemplate.deviation.setMiscDev 0 0 0 (<Max> <AddJump> <Sub>)

  • Max = The maximum value that is possible in this deviation type.
  • Sub = The standard value to start from. (the minimum value)
  • Add = The deviation to add if the weapon fires one time.
  • AddPitch = The deviation to add if the player is pitching.
  • AddYaw = The deviation to add if the player is yawing to the left or right.
  • AddForward = The deviation to add if the player is moving forward or backward.
  • AddStrafe = The deviation to add if the player is moving to the left or right.
  • AddJump = The deviation to add if the player is jumping.

ObjectTemplate.deviation.syncDev 1

  • unknown


General information:

Deviation of 0 = No deviation
Deviation of 1 = Some deviation
Deviation of 2 = A lot of deviation
Deviation of 0 and multiplier of 10 = 0 deviation
Deviation of 1 and multiplier of 3 = 3 deviation
Deviation of 2 and multiplier of 0.5 = 1 deviation

SoundEdit

ObjectTemplate.createComponent DefaultSoundComp

  • New Sound Component

AnimationEdit

ObjectTemplate.createComponent DefaultAnimationComp

  • New Animation Component

ZoomEdit

A zoom component is only required if the weapon has zoom; see #Fire.

ObjectTemplate.createComponent DefaultZoomComp

  • New Zoom Component

ObjectTemplate.zoom.zoomDelay 0.18
ObjectTemplate.zoom.zoomOutAfterFire 1

  • 0 = Gun exits zoom mode after each shot. Must re-engage zoom each shot.
  • 1 = Gun stays in zoom mode after each shot.

ObjectTemplate.zoom.addZoomFactor 0.5

  • 1 divided by ZoomFactor value = magnification of zoom (e.g. 1 / 0.125 = 8x zoom). Multiple lines (zoom levels) can be added and gun will cycle thru each level, then exit zoom mode. You can have: ObjectTemplate.zoom.addZoomFactor 0.5, plus a second line: ObjectTemplate.zoom.addZoomFactor 0.125. Gun will zoom to a 2x on first zoom activation, then to 8x on second, then exit zoom on third.

ObjectTemplate.zoom.zoomLod 1
ObjectTemplate.zoom.addZoomFactor 0 9
ObjectTemplate.zoom.addZoomFactor 0.25 3
ObjectTemplate.zoom.disableMuzzleWhenZoomed 1
ObjectTemplate.zoom.useZoomFineTuning True
ObjectTemplate.zoom.zoomFineTuneSteps 12

  • Unknown

GunSwayEdit

Only used at Sniper Rifles, unknown

AdditionsEdit

ObjectTemplate.addTemplate e_muzz_shotgun
ObjectTemplate.setPosition 0/0.14/1.21

  • Unkown

ObjectTemplate.projectileTemplate ger_shotgun_SR_Projectile

ObjectTemplate.keepProjectiles 10

  • Time to keep the projectile in the world after you or the weapon dies

ObjectTemplate.velocity 350

  • Projectile velocity

ObjectTemplate.itemIndex 1
ObjectTemplate.altItemIndex 10
ObjectTemplate.delayToUse 0.2
ObjectTemplate.weaponsItemType WITShotgun
ObjectTemplate.allowEmoteAnimation 1
ObjectTemplate.inheritParentSpeedSoldier 0
ObjectTemplate.inheritParentSpeedVehicle 1
ObjectTemplate.isDefaultWeapon 1
ObjectTemplate.unstealthOnDeploy 0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.