Structs:WorldEvent

From ZDoom Wiki
Jump to navigation Jump to search

WorldEvent is a ZScript struct used to pass around data by event handler World* virtual functions, such as WorldThingSpawned, WorldLoaded and many others. Like with most other struct-using functions, the purpose of the struct is to easily pass varying and sometimes large amounts of data without having to rely on individual arguments in each function.

Note: Which values are available and which remain null is wholly determined by which event handler function you're overriding. As such, looking at this struct in isolation is arguably not particularly useful. This page exists mainly for the sake of completeness of documentation.


Fields

Readonly

  • bool IsSaveGame
Utilized by WorldLoaded and WorldUnloaded in a StaticEventHandler. True if a save is being loaded.
  • bool IsReopen
Utilized by WorldLoaded. True if the map is a part of a hub and is being revisited.
  • String NextMap
Utilized by WorldUnloaded. Contains the name of the next map.
  • Actor Thing
Utilized by multiple WorldThing* events. Contains a pointer to the actor that the event is triggered for/by.
  • Actor Inflictor
Utilized by WorldThingDied and WorldThingDamaged. Contains a pointer to the puff or the projectile that dealt damage to the actor.
  • int Damage
Utilized by all events that somehow interact with damage, be it an actor or a line.
  • Actor DamageSource
  • AName DamageType
  • AEDmgFlags DamageFlags
  • Adouble DamageAngle
These are utilized by WorldThingDamaged.
  • Line ActivatedLine
Utilized by WorldLineActivated/WorldLinePreactivated. Contains a pointer to the relevant Line.
  • int ActivationType
Utilized by WorldLineActivated/WorldLinePreactivated. Contains the Line's activation type.
  • SectorPart DamageSectorPart
  • Line DamageLine
  • Sector DamageSector
  • int DamageLineSide
  • vector3 DamagePosition
  • bool DamageIsRadius
These are utilized by WorldSectorDamaged and WorldLineDamaged.
  • State CrushedState
Utilized by WorldThingGround. Contains a pointer to the crushed actor's Crush state.

Modifiable

  • bool ShouldActivate
Utilized by WorldLinePreActivated. If set to false, the line's activation will be blocked.
  • int NewDamage
Utilized by WorldSectorDamaged and WorldLineDamaged. Allows modifying the damage dealt to the Line/Sector

See also