A_SpawnObjectRelative

From SRB2 Wiki
Jump to navigation Jump to search

A_SpawnObjectRelative is an action which is used to spawn an Object of a type determined by Var2's lower 16 bits similarly to A_SpawnObjectAbsolute, but with the location relative to the actor instead. The location's relative Z position to the actor is determined by Var2's upper 16 bits, its relative X position by Var1's upper 16 bits, and its relative Y position by Var1's lower 16 bits. The expressions for this are:

  • Var1 = (X×65536)+Y
  • Var2 = (Z×65536)+type

If the actor is in reverse gravity when this action is called, the Object spawned will have MF2_OBJECTFLIP added to its secondary flags. The spawned Object's angle will be set to the actor's own angle.

Attributes Use
Var 1 Upper 16 bits: X position
Lower 16 bits: Y position
Var 2 Upper 16 bits: Z position
Lower 16 bits: Object type

  Actions – Spawners [view]
A_BubbleSpawnA_FanBubbleSpawnA_GhostMeA_ParticleSpawnA_RockSpawnA_SmokeTrailerA_SpawnFreshCopyA_SpawnObjectAbsoluteA_SpawnObjectRelativeA_ConnectToGroundA_WhoCaresIfYourSonIsABee