A_Lower

void A_Lower [(int lowerspeed)]

Usage

This function must be called in a weapon's Deselect state sequence. It should not be used anywhere else. It is responsible for lowering the weapon until it is off the screen and for selecting another weapon when it is done.

Each time the function is called, the weapon moves further down the screen until it has reached the fully lowered position. You can therefore make a weapon lower faster than the default by calling the function more than once within the same tic, or by passing the desired speed directly.


Warning: Do not call this function repeatedly in the same state inside another function, anonymous or otherwise. All calls to A_Lower are executed fully inside the other function, even if the weapon has reached its ready position, resulting in unwanted side effects.

Parameters

  • lowerspeed: how much the weapon is lowered by. Default is 6.

Examples

Here is an example of a basic Deselect state that makes use of this function to move the weapon down towards the lowered position and then select a new weapon:

Deselect:
   SHTG A 1 A_Lower
   Loop

This will lower the weapon down off the screen when a new weapon is selected. Once it has reached the fully lowered position, A_Lower will change to the new weapon that was selected.


This weapon lowers from view twice as fast as normal:

Deselect:
   FAST A 1 A_Lower(12)
   Loop

See also

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.