Autoselect


The Autoselect message is run when one of four events occurs. The chart below lists the events and corresponding senderrefs. Autoselect must return a value to whatever called it. If the player is mounting the weapon or SelectWeapon() has been used, autoselect only needs to return a value greater than -1. But if it's a powerup or misc cog, there's a good chance that all weapons are being queried and the one with the highest returned value will be selected. The Weapon Section's notes includes a chart of the default autoselect return values.


SenderSee the chart below.
SourceThe player whose weapon is being queried.

Sender TypeSystem (1).
Source TypeThing (3).

SleepableNo.

SenderMeaning
-1Player is mounting the weapon.
0Next / Prev Weapon keys query the weapon.
Also used when a cog queries for the weapon's priority.
1A miscellanious cog has queried for the best weapon.
2A powerup cog has queried for the best weapon.