<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mygamingtalk.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Weapon</id>
	<title>Weapon - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mygamingtalk.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Weapon"/>
	<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Weapon&amp;action=history"/>
	<updated>2026-04-17T02:11:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Weapon&amp;diff=1549&amp;oldid=prev</id>
		<title>Palota: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Weapon&amp;diff=1549&amp;oldid=prev"/>
		<updated>2023-02-13T07:02:37Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:02, 13 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Weapon&amp;diff=1548&amp;oldid=prev</id>
		<title>Palota: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Weapon&amp;diff=1548&amp;oldid=prev"/>
		<updated>2021-07-13T19:07:25Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Weapon Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
== Weapon ==&lt;br /&gt;
=== Properties ===&lt;br /&gt;
==== Name ====&lt;br /&gt;
Name of the weapon.&lt;br /&gt;
==== WeaponId ====&lt;br /&gt;
The id of the weapon. Should correspond to an entry in the global WEAPON table. This id MUST match the numeric weapon id expected by the mod interface.&lt;br /&gt;
&lt;br /&gt;
==== MinUseTime ====&lt;br /&gt;
The minimum time the bot should maintain the weapon once selected.&lt;br /&gt;
==== PrimaryFire ====&lt;br /&gt;
Returns a reference to the primary [[Weapon#Fire Mode | Fire Mode]]&lt;br /&gt;
==== SecondaryFire====&lt;br /&gt;
Returns a reference to the secondary[[Weapon#Fire Mode | Fire Mode]]&lt;br /&gt;
&lt;br /&gt;
==Fire Mode==&lt;br /&gt;
=== Properties ===&lt;br /&gt;
==== RequiresAmmo ====&lt;br /&gt;
This weapon requires ammo to operate. The type of ammo is determined by the [[Weapon#Fire_Mode|Properties|AmmoType]].&lt;br /&gt;
==== WaterProof ====&lt;br /&gt;
The weapon can be fired underwater. If false, the weapon will not be considered when the user is underwater.&lt;br /&gt;
==== HasClip ====&lt;br /&gt;
The weapon has a clip. Helps determine how ammo checking is performed.&lt;br /&gt;
==== InheritsVelocity ====&lt;br /&gt;
The weapon projectile inherits the velocity of the player when fired. This is used for a bit more accuracy in the projectile leading calculations.&lt;br /&gt;
==== ManageHeat ====&lt;br /&gt;
The weapon can overheat, so the bot should oscillate the firing to attempt to keep from overheating.&lt;br /&gt;
==== IgnoreReload ====&lt;br /&gt;
Ignore this weapon if it needs to reload. Normally bot would switch to weapons to reload them if they have no target. This option disables that.&lt;br /&gt;
==== RequiresTargetOutside ====&lt;br /&gt;
This weapon requires that the target is outdoors.&lt;br /&gt;
==== RequiresShooterOutside ====&lt;br /&gt;
This weapon requires that the shooter is outdoors.&lt;br /&gt;
==== WeaponType ====&lt;br /&gt;
The type of weapon this fire mode is.&lt;br /&gt;
* melee - Melee attacks are close range. Bots attack only if desirability is greater than default desirability.&lt;br /&gt;
* instant - Instant hit means no leading or projectile velocity is necessary.&lt;br /&gt;
* projectile - Bot will lead targets based on projectile velocity.&lt;br /&gt;
* grenade - Not yet implemented. Same as projectile.&lt;br /&gt;
* item - cannot be used in combat (dynamite, landmine, syringe, ammo pack, ...).&lt;br /&gt;
&lt;br /&gt;
==== MustBeOnGround ====&lt;br /&gt;
The bot must be standing on the ground to use this weapon(not airborne).&lt;br /&gt;
==== FireOnRelease ====&lt;br /&gt;
The weapon is fired when the fire button is released, as opposed to firing when the fire button is pressed.&lt;br /&gt;
==== UseMortarTrajectory ====&lt;br /&gt;
The weapon should use the mortar trajectory when calculating trajectory.&lt;br /&gt;
==== MaxAimError ====&lt;br /&gt;
The maximum aim error to use for the fire mode. Aim Error is a Vector2(x,y), where x is the horizontal aim error and y is the vertical aim error.&lt;br /&gt;
==== AimOffset ====&lt;br /&gt;
The offset where to aim at players. AimOffset is a Vector3(x,y,z) that represents a world offset to aim the weapon.&lt;br /&gt;
==== PitchOffset ====&lt;br /&gt;
Normally a projectile comes out along the aim vector of the bot, but some weapons can come out at an angle. PitchOffset is the pitch offset(in degrees) the projectile shoots at.&lt;br /&gt;
==== ShootButton ====&lt;br /&gt;
The button id of the button used to fire the weapon. Defaults to BTN.ATTACK1&lt;br /&gt;
==== LowAmmoThreshold ====&lt;br /&gt;
Used for ammo desirability calculations. This is the threshold the weapon will be considered low on ammo.&lt;br /&gt;
==== LowAmmoPriority ====&lt;br /&gt;
When the ammo is below the threshold above, this is the priority used for the desirability of the ammo.&lt;br /&gt;
====LowAmmoGetAmmoAmount====&lt;br /&gt;
Ammo amount to get from a cabinet. Used for mortar.&lt;br /&gt;
==== FuseTime ====&lt;br /&gt;
The countdown timer the projectile takes before it explodes/activates.&lt;br /&gt;
==== AmmoType ====&lt;br /&gt;
The ammo id the weapon uses. Depending on the game, this may be a duplicate of the weapon id or it may be an actual ammo id, from the global AMMO table.&lt;br /&gt;
==== ProjectileSpeed ====&lt;br /&gt;
The speed the projectile flies at. Only relevant to projectile fire modes.&lt;br /&gt;
==== MinChargeTime ====&lt;br /&gt;
The minimum time the bot should charge this weapon before shooting. Normally used with FireOnRelease property. Used as a minimum range for a random charge time, along with MaxChargeTime.&lt;br /&gt;
==== MaxChargeTime ====&lt;br /&gt;
The maximum time the bot should charge this weapon before shooting. Normally used with FireOnRelease property. Used as a maximum range for a random charge time, along with MinChargeTime.&lt;br /&gt;
==== DelayAfterFiring ====&lt;br /&gt;
How long the bot should wait to choose this weapon again after firing.&lt;br /&gt;
==== ProjectileGravity ====&lt;br /&gt;
The gravity multiplier used for the projectile. Used to calculate trajectory of the projectile. Projectiles that aren&amp;#039;t effected by gravity will have a ProjectileGravity of 0. A projectile that has half gravity is a 0.5, while full gravity is 1.0&lt;br /&gt;
==== DefaultDesirability ====&lt;br /&gt;
Default desirability is the desirability used for choosing a weapon when the bot has no target. The highest default desirability will be equipped when the bot has no target, after all weapons that need reloading is considered.&lt;br /&gt;
==== MinAimAdjustmentTime ====&lt;br /&gt;
Minimum time between new calculations of aim error.&lt;br /&gt;
==== MaxAimAdjustmentTime ====&lt;br /&gt;
Maximum time between new calculations of aim error.&lt;br /&gt;
&lt;br /&gt;
==== CalculateDefaultDesirability ====&lt;br /&gt;
Script function callback to calculate the default desirability. Should return a 0-1 desirability value.&lt;br /&gt;
==== CalculateDesirability ====&lt;br /&gt;
Script function callback to calculate the desirability of the weapon. Should return a 0-1 desirability value. This callback will be passed the [[TargetInfo]] of the current target.&lt;br /&gt;
==== CalculateAimPoint ====&lt;br /&gt;
Script function callback to calculate an aim point for the weapon. Should return a Vector3 world aim position. This callback will be passed the [[TargetInfo]]of the current target.&lt;br /&gt;
&lt;br /&gt;
=== Not used properties ===&lt;br /&gt;
==== SplashDamage ====&lt;br /&gt;
The weapon produces splash damage, and should be disfavored when there are allies in the target area.&lt;br /&gt;
==== HasZoom ====&lt;br /&gt;
The weapon has a zoom mode.&lt;br /&gt;
==== Stealth ====&lt;br /&gt;
The weapon should be favored when stealth is desired.&lt;br /&gt;
==== NeedsInRange ====&lt;br /&gt;
The bot must be within the MinRange and MaxRange to use, even if that means the bot should chase the target. Typically used for melee weapons.&lt;br /&gt;
==== MaxEquipMoveMode ====&lt;br /&gt;
The fastest the bot should move when this weapon is equipped (run, walk, still).&lt;br /&gt;
==== Offhand ====&lt;br /&gt;
Weapon can be used simultaneously with another weapon, such as offhand grenades.&lt;br /&gt;
==== ManualDetonation ====&lt;br /&gt;
The weapon projectile must be manually detonated.&lt;br /&gt;
==== SniperWeapon ====&lt;br /&gt;
The weapon is a sniper weapon, and should be considered for use for goals that require a sniper weapon.&lt;br /&gt;
==== ZoomButton ====&lt;br /&gt;
The button id of the button used to zoom the weapon. Defaults to BTN.AIM&lt;br /&gt;
==== MinRange ====&lt;br /&gt;
The minimum range the bot should consider using this fire mode.&lt;br /&gt;
==== MaxRange ====&lt;br /&gt;
The maximum range the bot should consider using this fire mode.&lt;br /&gt;
==== PreShoot ====&lt;br /&gt;
Script function callback to that is called just before the weapon is fired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
====SetBurstRange====&lt;br /&gt;
This function can be called multiple times in order to set several ranges for burst firing. Whenever the target is within one of the ranges, the bot will use controlled burst fire as set up by this function.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039; (minrange, maxrange, numrounds, mindelay, maxdelay)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; none&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example:&amp;#039;&amp;#039;&amp;#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // from 200-500 units away, set up a 3 shot burst rate, with a 1-2 second delay between each burst&lt;br /&gt;
 w.PrimaryFire.SetBurstRange(200, 500, 3, 1, 2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====SetDesirabilityRange====&lt;br /&gt;
This function can be called multiple times to assign a desirability to use the weapon when the target is within a given range of the bot.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039; (minrange, maxrange, desirability)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; none&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example:&amp;#039;&amp;#039;&amp;#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // between 200 and 500 range, we want the desirability to be 0.5&lt;br /&gt;
 w.PrimaryFire.SetDesirabilityRange(200, 500, 0.5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====SetTargetBias====&lt;br /&gt;
Sets a bias multiplier for a target type. This bias will be multiplied with the desirability when calculating the desirability of a weapon versus a target.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039; (targettype, bias)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; none&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example:&amp;#039;&amp;#039;&amp;#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // make this weapon 1.5 times more likely to be used against heavy vehicles&lt;br /&gt;
 w.PrimaryFire.SetTargetBias(CLASS.VEHICLE_HVY, 1.5);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
</feed>