From ZDoom Wiki
Jump to navigation Jump to search

int SpawnDecal (int tid, str decalname [, int flags [, fixed angle [, int zoffset [, int distance]]]])


Creates a decal on a wall by tracing a line from the actor with the specified TID until hitting said wall, on which the decal is then created. If tid is 0, the tracing is done from the activator of the script.


  • tid: The TID of the actor.
  • decalname: The name of the decal to create, as defined in DECALDEF.
  • flags: These can be combined by using the | character:
    • SDF_ABSANGLE — If present, angle is an absolute angle. Otherwise, it is relative to the origin actor's angle.
    • SDF_PERMANENT — If present, the decal will stay indefinitely, and will not be removed if the maximum amount of decals present at once in a level is reached (this is controlled by the cl_maxdecals console variable).
    • SDF_FIXED_ZOFF — If present, zoffset is treated as a fixed-point value rather than an integer.
    • SDF_FIXED_DISTANCE — If present, distance is treated as a fixed-point value rather than an integer.
Default is 0.
  • angle: The direction in which to search for a wall. This is a fixed point angle. Default is 0.
  • zoffset: The offset from the middle of the origin actor for the Z height of the decal. Y-flipped decal will have reverse offset. Default is 0.
  • distance: The maximum distance to search for a wall. Default is 64.

Return value

The return value of the function is the number of decals spawned.


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 contributions are greatly appreciated.