QuakeEx

From ZDoom Wiki
Jump to: navigation, search

bool QuakeEx (int tid, int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, sound sfx [, int flags [, fixed mulwavex [, fixed mulwavey [, fixed mulwavez [, int falloff [, int highpoint [, fixed rollintensity [, fixed rollwave]]]]]]]]);

Usage

This is an extended version of Radius_Quake2 with the ability to create an earthquake effect to manipulate the player's view along a specific axis, either in direct map axis or along the camera based upon the flags. It also allows adjusting the Z axis (quaking up and down). It also follows the same functionality, and creates an earthquake around the calling actor. In addition, it can also manipulate the ins and outs of an earthquake.

Parameters

  • tid: Thing ID of map thing(s) for quake foci (if 0, the activator is used as the sole focus)
  • intensityX/Y/Z: Strength of earthquake, ranging from 1 to 9, along a particular axis.
  • duration: Duration in tics
  • damrad: Radius of damage in map units
  • tremrad: Radius of tremor in map units
  • sound: Accompanying sound effect for the tremor.
  • flags: Can be combined with the pipe "|" character. All flags are compatible with each other:
  • QF_RELATIVE — Adjust the X and Y intensities to quake along the camera view's front and side respectively.
  • QF_SCALEDOWN — Scales the intensity over the duration, going from full at the start of the quake to 0 upon finishing. Can be combined with QF_SCALEUP.
  • QF_SCALEUP — Scales the intensity over the duration, going from 0 at the start of the quake to full upon finishing. Can be combined with QF_SCALEDOWN.
  • QF_WAVE — Changes the quake from a randomly generated one to a sine wave, and are further controlled by mulwavex/y/z. Intensity is known as 'amplitude' in this form.
  • QF_MAX — Requires QF_SCALEDOWN and QF_SCALEUP. Fully scaled quakes will gradually scale from 0 to half intensity, and back to 0. This changes 0 to start from the defined intensity instead.
  • QF_FULLINTENSITY — Requires QF_SCALEDOWN and QF_SCALEUP. Fully scaled quakes will only scale in to the half intensity from their origins. This changes half to full intensity instead.
  • mulwavex/y/z: Only used with QF_WAVE. Specifies the number of waves per second the wave quake goes through while active. Default is 1. These are float values, so precision can be achieved.
  • falloff: Determines how far away the quake will start to reduce its amplitude based on distance. Takes the same arguments at tremrad in map units. Anything inside this will experience the full effect of the quake. Default is 0, which is no falloff.
  • highpoint: Only used with QF_SCALE<DOWN/UP>. Determines how far into the quake in tics for the quake to reach the peak of its shaking (or lack thereof if QF_MAX is included). Default is 0, or directly half way.

The following are Graficon.gif (GZDoom only: not supported by ZDoom)

  • rollintensity: The camera roll is affected in a similar way to intensityX/Y/Z if specified. Unlike normal intensity, this is not capped. If QF_WAVE is used, can also be negative to allow randomization. This feature does not rely upon the standard intensities and can be used separately (placing 0 in intensity and mulwave properties), but the flags affect it exactly the same.
  • rollwave: Similar to mulwavex/y/z, but for rolling.


Regular random quakes can stack with wave quakes, but to achieve this effect, one call to QuakeEx with QF_WAVE specified must happen with another call to the same function without QF_WAVE. This allows for cameras to shake along the wave, as the wave takes priority over where the jittering regular quakes positions. Wave quakes also will pause when the game is paused in any manner. Normally, regular quakes persist through an opened console for example, but wave quakes will always halt when a menu or console pause occurs. Similarly, rolling quakes follow the same behavior.

Contrarily to the Radius_Quake action special, the radii for damage and tremor are given directly in map units, not in "tiles" of 64x64 map units. This must be kept in mind when updating a script from Radius_Quake to QuakeEx.

Return value

Returns false if either the activator is null or there are no actors with the specified tid. Otherwise, it returns true.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.


See also