int xsize;           // each size is 8 units 
 int zsize;                    // each size is 8 units  

/*77new
 - Added canFireControl unitdef tag.
 (new udef tag, turnInPlace) 
 - Added maxRepairSpeed tag for builders. 
 - accuracy, sprayangle and similar tags work for starburst missiles.
- Added avoidNeutral (targetting) and collideNeutral (projectiles) weapon tags. 
 - missiles obey burnblow=1 (existing tag), the missile will explode in midair
 - Added capturable tag.
 - Implemented 'y' value for yardmaps which means this square is not blocked.
 -  noChaseCatagory.
 - Added per-weapon highTrajectory tag (int, default 2).
 - Added impactOnly weapon tag (bool, default false), for projectile weapons
 - Added shieldRechargeDelay weapon tag (float, default 0). like the idle autoheal
 - Added 'sonarStealth' unitDef tag.
 - Added new stockpileTime weapondef tag.  seperate reload and stockpile times 
 -  extractSquare unitdef tag.
 - Added moveState and fixed fireState unitdef tags.
 - Added strafeToAttack tag. Moving sideways when in range but not shooting optionalbehaviour,
 - Added verticalSpeed (float, default: 3.0) unitDef tag  for non-fighter/bomber
 - Added the 'customParams' table to both featureDefs and weaponDefs
   (accessible via the lua FeatureDefs and WeaponDefs' tables).
 - only add ".wav" extension for unitdef sounds if it is missing
 - MeleeWeapon obey impulseFactor.
- Custom collision volumes:
   - collisionVolumeType (either: "ellipsoid","cylT" where 'T' is one of {X, Y, Z}, "box")
   - collisionVolumeScales (float3)
   - collisionVolumeOffsets (float3)
   - collisionVolumeTest (0: per-frame hit detection, 1: raytraced)
   - all these tags are the same for Features 



Range= 	maximum range of the weapon. If noexplode, disappear after range . If burnblow, explode after range
ReloadTime= 	time between shots.paralyzed, stops counting down.
Rendertype= 	rendertypes : 0 - Laser, 1 - Model, 3 - Plasma, 4 - Unit explosion (usally), 5 - Flamethrower, 6 - Dropped, 7 - Lightning. no documented rendertype=2. 3 and 4 interchangeable, both  plasma/EMG/whatever shot;  for compatibility. 	

Model 	3d model. 3DO modesl do not need a .3do extension, but S3O 


MyGravity= For ballistic weapons (Cannon and Bomb), overrides the map gravity parameters.corect gravity is around 0.2(strongly recommanded to use it because if the map havent 100 gravity then the weapon balistic hit short or far ) 
Ballistic= is mutually exclusive to LineOfSight and Dropped

LineOfSight= 	enable missile and beamweapons :if 0 then balistic 
Dropped =	RenderType=6 exclusive to Ballistic and LineOfSight
ManualBombSettings= 	For Bombers, use burst and burstrate tags instead of hardcoded values.


BurnBlow= 	The weapon blows up when it reaches range the target was at when the weapon fired. Only(rendertype=4)

TargetMoveError= 	If very low or not set at all,always hit (unless micromanagement of the person controlling the target). high (about 0.3 or above),difficulty even tracking target between 0 and 1. Beyond 1, useless. 
MovingAccuracy= 	accuracy while moving. 
Tolerance= 	"real" aim  be off weapon  fire accurately at the target. (if >=32000 weapon fire without aiming )
Turret= 	turret that rotates. Set to 0 if weapon is forward firing, 
WeaponVelocity= 	The speed the weapon moves 
avoidFeature=0;//evite de viser les morts
ProximityPriority= 	multiplier distance priority calculation.negative prefer distant targets.

Leadbonus= 	multiplied unit's experience and added to the lead limit. 	leadbonus=1;
LeadLimit= 	Limits the maximum distance a unit will lead a target (default is -1 which means infinite). 

PredictBoost= 	How much predict unit speeds (similar to targetMoveError). Default 0 for non-burnblow, 0.5 for burnblow weapons. (0.0-1.0).
TargeBorder= 	TryTarget at the edge of collision sphere (radius*tag_value, [-1;1]) instead of its centre.between 0 and 1. Defaults to 1 for Melee type weapons, 0 otherwise.
FireStarter= 	set trees on fire.to just explode or tip over.0 and 100. 

CraterBoost= 	Adds a constant factor to the terraform the explosion does.  (default 0)
CraterMult= 	Multiplies terraform explosion  (default :=impulsFactor) 
ExplosionSpeed= 	Explosion animation speed/time. (only used by BeamLaser and LightingCannon?) gd=max(30, DefaultDamage/20);expSpeed=(8+(gd*2.5))/(9+(sqrt(gd)*.7))/2;
EdgeEffectiveness= percent o maximum damage to the outer edge AreaOfEffect. between 0 and 1.
ImpulseFactor= 	multiplier default damage and AreaOfEffect. including negative
ImpulseBoost= 	constant added on impulsefactor.  including negative 


NoExplode= 	 continue on its path.
GroundBounce= 	projectile will bounce on land or the ocean floor). Can be 0 or 1, defaults to 0 (off) 
BounceRebound= 	vertical velocity a projectile keeps when it bounces.0 for a sticky bomb, 2 for a flubber bomb. Defaults to 1
BounceSlip= 	horizontal velocity a projectile keeps when it bounces.0 for a sticky bomb,2 for a flubber bomb. Defaults to 1
NumBounce= 	number of times bounce. -1 for infinite. Defaults to -1
WaterBounce= 	projectile bounce on  surface water. 0 or 1, defaults to 0 (off) 

Projectiles= 	fires  many projectiles at once (shotgun style). (sprayangle or different firepoints)
SprayAngle= 	 wide angle of burst similar to Accuracy, except that if no sprayangle, all the shots at the same spot,

Paralyzer= 	not cause damage but paralyze . damage value to the target's HP overwhelmed, be paralyzed.1 or 0. 
ParalyzeTime= 	time the target will be paralyzed (In seconds?)refreshed every time hit by the weapon.

NoSelfDamage= 	 not damage the unit that fired it. 1 or 0. 	
 

FlightTime= 	numeric value. 
WeaponTimer= 	How long until  second phase.  missile VLaunch turn to target after number of seconds has expired. non-VLaunch missiles with a TurnRate go randomly off-course after.
Turnrate= 	guided turn.between 0 and 64000. If set to 0, can't turn ; relative to a weapon's velocity; 
Guidance= 	correcting trajectory mid-flight.not track a moving target. missile and torpedo. 1 or 0. rendertype=1, lineofsight=1, and selfprop=1; guidance=1;
Selfprop= 	for acceleration,  Guidance, StartVelocity, WeaponAcceleration, WeaponVelocity. 1 or 0. 	
Dance= 	For missles, unlike wobble it doesn't rotate 
StartVelocity= 	 starting speed  accelerate. 
Tracks= 	missile tracks a moving target.1 or 0.
TrajectoryHeight= 	height of the arc missile weapon.(Higher speed, higher arc)(Lower range lower arc). Requires Guidance and Turnrate when over 1. 
VLaunch= 	launch the weapon vertically. missile with a TurnRate. Cannot be used as Turret.1 or 0. 
WeaponAcceleration= 	accelerate from its StartVelocity to  WeaponVelocity. Increases velocity every second by the amount 
Wobble= 	The amount a missile wobble off-course. Requires TurnRate. Turnrate wrestle wobble to keep the weapon on course, wobble must be high enough to have any effect. between 0 and 64000. 
FixedLauncher= 	missiles, starburst , torpedoes, projectile spawn with the orientation of the shooting not check if allies in the way,conflicts with trajectoryHeight
SmokeTrail= 	projectile leave a smoke trail  1 or 0. 	

SubMissile= 	TorpedoLaunchers, travel like a missile outside of water.not emit a smoketrail,plane considered a fighter, not a bomber. 1 or 0. 	
FireSubmersed= 	fire underwater,can hit underwater targets.0 or 1. 
WaterWeapon= 	Dropped can fire under water.1 or 0.


CommandFire 	attack ground only fire once,attack units fire until the target is dead. If CanDgun=1 in its FBI,dgun button.

Coverage 	range for anti-weapon shown on the minimap 
Interceptor 	intercept missiles with the Cruise tag.
Targetable 	weapon will be automatically targeted by 1 Interceptor weapons. 

Stockpile 	stockpiled,  1 or 0. build ammo in menu for shoot 

InterceptedByShieldType 	Bitfield  resulting binary. set to one shield with that digit intercept Maxium of 32 unique types. 

EnergyPerShot 	Energy used per shot. If  available,  able to shoot. Stockpile weapon wll cost to build.
MetalPerShot 	Metal used per shot. If not available,dont fired. Stockpile weapon cost to build. 


SoundHit 	sound when weapon hits.reference a .wav file in the .\Sounds directory.
SoundHitVolume  between 0 and 1. 	
SoundStart 	sound when weapon begins only once if in a burst. reference a .wav file in the .\Sounds directory.
SoundStartVolume 	between 0 and 1. 
SoundTrigger 	sound every time a shot in a burst sequence. 1 or 0. 


Size 	visible size of projectiles. Default size is 2 + min(damage / 400, areaOfEffect / 10).
CollisionSize 	physical size of projectiles, percentage of size for flamethrower and absolute value emg, plasma and laser. 
HeightBoostFactor 	height range boost (more than 1 means increased range, 0 means the cannon has fixed range regardless of height difference to target. default on weapon init, based on range tag and theoretical max range.). including negative (<0 := automatically calculated).
HeightMod 	Changes the sphere weapon range into an ellipsis. larger 1.0 the weapon can't shoot as height as far, i.e. 0.5 means it can shoot twice as height as far not work well with beam weapons, use minIntensity (0..1) tag to fix
CylinderTargetting 	cylinder instead of sphere:half height=unitradius*cylinderTargetting Defaults to 1 for Melee type weapons, 0 otherwise. not BeamLaser 


ToAirWeapon 	only targetting units capable of flying. 0 or 1. 

 	
TwoPhase 	Weapon operates in two phases. Unused in 76b1 and 77b1! 1 or 0. 


BeamLaser 	 lasers instantly hit their targets. Rendertype 0. 
Mutually exclusive to BeamWeapon.	beamlaser=1;BeamTime How long to fire the laser before waiting for ReloadTime to start.
BeamDecay 	 speed of the fadeout (each frame the beam's intensity is multiplied with that value). Can be between 0 and 1.
BeamTTL 	 time (in frames) the beam will stay after being fired.
CoreThickness 	Thickness of the core of a laser (the part which use rgbcolor2)
DynDamageExp 	Exponent of the range damage formula, 0 (the default) disables dynamic damage. 1 means linear scaling.BeamLasers and LightingCannons.
DynDamageInverted 	Inverts the damage curve (more damage at far range).BeamLasers and LightingCannons.dynDamageInverted=0;
DynDamageMin 	Minimum dynamic range damage value.BeamLasers and LightingCannons.
DynDamageRange 	 instead of the range value BeamLasers and LightingCannons
HardStop 	LaserCannon,  hard stops or fade out. 0 or 1. 
LargeBeamLaser beamlaser alternate graphics effect. Can be 0 or 1. 
PulseSpeed 	LargeBeamLaser, how fast the pulsating effect at the beam start 
ScrollSeed 	LargeBeamLaser. How fast the beam apears to be moving towards it target. 
TileLength 	LargeBeamLaser. length before the texture is repeated (tiled).

LaserFlareSize  multiplier for thickness.  (default: 15) 
SweepFire 	on continous beam lasers (default 0) continue firing while it aims for a new target.  1 or 0.

Duration 	seconds a beam weapon fired before reload time.controls the length of the beam projectiles.rendertype 0 and 7 
FallOffRate 	beamweapon fades out after maximum range. 0 is never fade out, 1 is finish at max range, the default 0.5 
LodDistance 	Minimum camera distance  beamweapon  to rectangle. Can be set to any numeric value. (default: 1000) 
MinIntensity 	For beamlasers hit minimum intensity (damage coeffcient dependent on distance - range 0 to 1). 

Intensity 	Alpha (brighness and washout effect)rendertype 0, 3, or 4 weapon. 
Thickness 	Thickness of a beamweapon or beamlaser, default is 2. 

RGBColor 	rendertype 0, 3, 4, 7  RED_GREEN_BLUE . rgbcolor=1 0.3 1; - this would make evul-purple
RGBColor2 	 rendertype 0 (laser) . Defaults to white. RGBColor2=0 1 0; - weird green middle 

ColorMap 	Only used by flamethrower.colorMap=1 0 0 1  0 1 0 1;(red to green fade)
FlameGFXTime 	flamethrower stay graphical effect (doesnt damage) after maxrange.percent, 1.2 makes it remain 20% beyond maxrange.
SizeGrowth 	 how fast flame projectiles will grow in size.sizegrowth=0.6;








NOTE: Variables that are defined by either a 1 or a 0 are BOOLEAN, where 1 means TRUE and 0 means FALSE.

NOTE 2: "Any numerical value" for things that relate to angles really means any value between 0 and 64,000 since that's between 0 and 360 degrees in spring measurement. Setting it higher than 64,000 will bring it 'full circle' so to speak.

Texture Tags
Weapon 	Used Texture Tags
AircraftBomb 	texture1 = projectile
PlasmaCannon 	texture1 = projectile
EmgCannon 	texture1 = projectile
FlameThrower 	texture1 = flame
LaserCannon 	texture1 = beam
texture2 = beamend
LightingCannon 	texture1 = beam
BeamLaser 	texture1 = beam
texture2 = beamend
texture3 = flare

LargeBeamLaser 	texture1 = beam
texture2 = beamend
texture3 = muzzle
texture4 = flare

MissileLauncher 	texture1 = flare
texture2 = smoketrail
Shield 	texture1 = shield
StarburstLauncher 	texture1 = flare
texture2 = smoketrail
texture3 = flame
TorpedoLauncher 	texture1 = projectile

NOTE: All textures need to be `atlased`. So you have to define them in the resources.tdf and use the reference name in the texture tags.

Plasma Visuals
Variable 	Description 	Examples
AlphaDecay 	How much a plasma particle is more transparent than the previous particle. Can be set to any numerical value. (default: 1) 	AlphaDecay=0.95;
NoGap 	If set to 1, the distance between plasma particles is proportional to the size of the two particles. If set to 0, the distance between plasma particles will be proportional to the size of the first particle. Can be set to 1 or 0. (default: 1) 	NoGap=0;
Separation 	Distance between each plasma particle. Can be set to any number value. (default: 1) 	Separation=5;
SizeDecay 	How much a plasma particle is smaller than the previous within the same plasma shot. Can be set to any numerical value. (default: 0) 	SizeDecay=0.2;
Stages 	Number of particles used in one plasma shot. Can be set to any number value. (default: 5) 	Stages=20;



Shield/Repulsor Descriptions
Variable 	Description 	Examples
ExteriorShield 	If set to 1, the shield/repulsor will not have any effect on weapons fired from within its field. Can be 1 or 0. 	exteriorshield=1;
IsShield 	If set to 1, this "weapon" is no longer a weapon, is now a repulsor or a shield, based on the other properties given to it. Can be 1 or 0. 	isshield=1;
ShieldAlpha 	How clearly visible the shield is, if you have VisibleShield turned on. Value is between 0 and 1. 	shieldalpha=0.4;
ShieldEnergyUse 	The amount of energy used to repulse or destroy weapons. Will be used constantly while the weapon is in its area of effect if it is a repulsor, will be used only once on impact if it is a shield. 	shieldenergyuse=1500;
ShieldForce 	The force applied to weapons, an arbitrary number. Set to 1, it will not deflect very well. Only for use on repulsor-type. Can be set to any numerical value. 	shieldforce=1.75;
ShieldBadColor 	The color the shield is when it is at 0% strength, if you have VisibleShield turned on. Defined in R G B format. 	shieldbadcolor=0 1 0;
ShieldGoodColor 	The color the shield is when it is at 100% strength, if you have VisibleShield turned on. 	shieldgoodcolor=1 0 0;
ShieldInterceptType 	Bitfield representing the types of weapons that this shield can intercept. The best way to think about this is to think of it as the resulting binary. Every digit of binary that is set to one means that a weapon with that digit set to one will be intercepted by this shield, for instance, the example will result in the shield blocking weapons with types 2 and/or 3. Maxium of 32 unique types. See Shield Interception Tag Use26. 	ShieldInterceptType=6;
ShieldMaxSpeed 	The maximum speed the repulsor will push weapons away at. Only for use on repulsor-type. Can be set to any numerical value. 	shieldmaxspeed=400;
ShieldPower 	How much "power" a shield can store. "Power" is not the same as energy; think of it as the shield/repulsor's private battery source. It can be drained completely by defending against weapons, even if you have lots of energy. Power is drained by the affected weapons damage. Can be set to any numerical value. 	shieldpower=1000;
ShieldPowerRegen 	How quickly the shield regenerates its "power", even when under attack. Regenerates the amount specified every second. Can be set to any numerical value. 	shieldpowerregen=25;
ShieldPowerRegenEnergy 	How much energy is required to keep the shield regenerating its "power". For instance, you might have it set so that 100 units of energy are necessary for every 25 units of "power". 	shieldpowerregenenergy=100;
ShieldRadius 	Defines the size of the area the shield/repulsor protects. Can be set to any numerical value. 	shieldradius=500;
ShieldRepulsor 	If set to 1, the "shield"-type weapon will repulse projectiles. If set to 0, it will destroy them. Can be set to 1 or 0. 	shieldrepulsor=1;
ShieldStartingPower 	If set the shield starts with this much power instead of 0. Can be set to any numerical value. 	shieldStartingPower=100;
SmartShield 	If set to 1, the shield/repulsor will not affect owned/allied weapons. Can be set to 1 or 0. 	smartshield=1;
VisibleShield 	If set to 1, the shield will be visible. Only for use on shield-type. Can be set to 1 or 0. 	visibleshield=1;
VisibleShieldHitFrames 	Numbers of frames how long the shield should be visible after it got hit (the alpha value fades after the hit). Can be set to any numerical value. (default: 0 frames) 	visibleShieldHitFrames=5;
VisibleShieldRepulse 	If set to 1, the repulsing effect will be visible. Only for use on repulsor-type. Can be set to 1 or 0. 	visibleshieldrepulse=1;


*/

