Difference between revisions of "Shooting"

From WikiManual
Jump to: navigation, search
m
Line 1: Line 1:
 
The .shoot command is one of the most vital in DB. With it a bot can feed, dispose of waste, shoot poison or venom, and affect another bots memory.  
 
The .shoot command is one of the most vital in DB. With it a bot can feed, dispose of waste, shoot poison or venom, and affect another bots memory.  
  
Basics
+
== Basics ==
 
Whenever a non zero value is stored in .shoot, a shot is produced. This shot by default fires directly along the bot's eye's vector (that is, which direction it's looking). The shot's basic strength and range are determined by a bot's body.  
 
Whenever a non zero value is stored in .shoot, a shot is produced. This shot by default fires directly along the bot's eye's vector (that is, which direction it's looking). The shot's basic strength and range are determined by a bot's body.  
  
'''Shot Types:'''
+
=== Shot Types: ===
  
'''Feeding Shots'''
+
=== Feeding Shots ===
 
*-1 - [[Energy]] Shots
 
*-1 - [[Energy]] Shots
*-2 - Give energy Shoot, bread and butter feeding type  
+
*-2 - Give energy Shoot, bread and butter feeding type.  -1 and -6 shots also ''return'' this.
*-6 - [[Body]] Shots  
+
*-6 - [[Body]] Shots
  
 
'''Waste Poison and Venom'''
 
'''Waste Poison and Venom'''
Line 17: Line 17:
  
  
'''Memory shots'''
+
=== Memory shots ===
  
 
By storing positive numbers in .shoot another bot's memory can be overwritten by what's stored in .shootval. This can be used to either mess up another bot or to exchange some vital information between bots.
 
By storing positive numbers in .shoot another bot's memory can be overwritten by what's stored in .shootval. This can be used to either mess up another bot or to exchange some vital information between bots.
Line 26: Line 26:
 
  cond
 
  cond
 
  'you figure it out
 
  'you figure it out
  'Icarus fires if:<nowiki>
+
  'Icarus fires if:
  *.shup</nowiki> -2 !=
+
  *.shup -2 !=
  start<br>
+
  start
 
  .aimdx .shoot store
 
  .aimdx .shoot store
 
  314 .shootval store
 
  314 .shootval store
Line 37: Line 37:
 
--------------------------------------------------------------------------------
 
--------------------------------------------------------------------------------
  
Defenses and Attacking
+
== Defenses and Attacking ==
 
For 2.36 and later, check out [[How defenses and attacks work]]  
 
For 2.36 and later, check out [[How defenses and attacks work]]  
  
Advanced Uses of Shootval
+
== Advanced Uses of Shootval ==
 
As of 2.36, you may 'power up' a shot's strength and range.
 
As of 2.36, you may 'power up' a shot's strength and range.
  
Line 51: Line 51:
 
This will also work in a way with venom and waste shots. The increase is linear instead of logarithmic though, and you spend the resource amount instead of energy. See venom and waste. Note that storing negative numbers for venom or waste shots has no effect, the shootval must be positive. (I think)  
 
This will also work in a way with venom and waste shots. The increase is linear instead of logarithmic though, and you spend the resource amount instead of energy. See venom and waste. Note that storing negative numbers for venom or waste shots has no effect, the shootval must be positive. (I think)  
  
Advanced Shooting Commands
+
== Advanced Shooting Commands ==
 
.backshot and .aimshoot allow for more control over how the shot is produced.
 
.backshot and .aimshoot allow for more control over how the shot is produced.
  
Line 70: Line 70:
 
will fire a shot directly 90 degrees to the left of the bot's eye.
 
will fire a shot directly 90 degrees to the left of the bot's eye.
  
=== Sysvars ===
+
== Sysvars ==
 
* [[Definitions]]
 
* [[Definitions]]
 
* [[.up|Movement (.up, .dn. .dx, .sx)]]
 
* [[.up|Movement (.up, .dn. .dx, .sx)]]

Revision as of 08:38, 22 September 2005

The .shoot command is one of the most vital in DB. With it a bot can feed, dispose of waste, shoot poison or venom, and affect another bots memory.

Basics

Whenever a non zero value is stored in .shoot, a shot is produced. This shot by default fires directly along the bot's eye's vector (that is, which direction it's looking). The shot's basic strength and range are determined by a bot's body.

Shot Types:

Feeding Shots

  • -1 - Energy Shots
  • -2 - Give energy Shoot, bread and butter feeding type. -1 and -6 shots also return this.
  • -6 - Body Shots

Waste Poison and Venom

  • -4 - Waste Shots(coupled with .shootval to determine waste size)
  • ? - Poison Shots(fired automatically at attacker provided defender has poison, cannot be fired manually through the DNA)
  • ? - Venom Shots(can be fired at other bot provided venom stored)


Memory shots

By storing positive numbers in .shoot another bot's memory can be overwritten by what's stored in .shootval. This can be used to either mess up another bot or to exchange some vital information between bots.

Here's how you'd make another bot turn. Light's Icarus used this to dominate F2 league for a while.


cond
'you figure it out
'Icarus fires if:
*.shup -2 !=
start
.aimdx .shoot store
314 .shootval store
stop

This will make any bot that you hit turn 90 degrees to the right.


Defenses and Attacking

For 2.36 and later, check out How defenses and attacks work

Advanced Uses of Shootval

As of 2.36, you may 'power up' a shot's strength and range.

Storing a negative value in .shootval will make body shots (-6) and energy shots (-2) have a longer range.

Storing positive values in .shootval will make body shots (-6) and energy shots (-1 and -2) become more powerful.

The multiplier is roughly log2(.shootval). That's log base 2. So spend 4 energy in .shootval and you'll double your shot strength or range, but spend 8 energy and you only triple shot strength or range.

This will also work in a way with venom and waste shots. The increase is linear instead of logarithmic though, and you spend the resource amount instead of energy. See venom and waste. Note that storing negative numbers for venom or waste shots has no effect, the shootval must be positive. (I think)

Advanced Shooting Commands

.backshot and .aimshoot allow for more control over how the shot is produced.

Storing a positive number in .backshoot or increasing .backshoot by one, will instruct the bot to fire backwards if a non zero value is stored in .shoot.

Saving energy by using the increase operator:

.backshoot inc
6 .shoot store

.aimshoot follows .backshot's syntax, but allows you to specify an angle to shoot at. The number stored here represents the angle from the bot's eye vector (direction it's facing) running counter-clockwise.

Example

314 .aimshoot store
-2 .shoot store

will fire a shot directly 90 degrees to the left of the bot's eye.

Sysvars