SpawnPuff
Jump to navigation
Jump to search
native Actor SpawnPuff(class<Actor> pufftype, vector3 pos, double hitdir, double particledir, int updown, int flags = 0, Actor victim = null)
Usage
Spawns an actor as a puff. This should always be used when manually spawning puffs rather than the base Spawn function, because this will properly signal it to the game that the actor is a puff. Using this function ties into a number of internal behaviors; among other things, this lets the puff be replaced by particles if it has the ALLOWPARTICLES flag.
(New from 4.13.0) Spawning with this function will also give the actor a readonly ISPUFF flag and will store the actor responsible for the attack in the puff's DamageSource
field.
Parameters
- class<Actor> pufftype
- The actor class to spawn. This technically can be any actor, although only actors explicitly designed to be puffs are recommended.
- vector3 pos
- The absolute position to spawn the puff at.
- double hitdir
- The absolute angle that the spawned puff will receive. For hitscan attacks, the shooter's own angle is typically passed here.
- double particledir
- (Need more info)
- int updown
- Gives the spawned puff vertical velocity.
- int flags
- Flags to modify the spawned puff's behavior. Multiple flags can be combined with
|
. Available flags:- PF_HITTHING — spawn the puff as if the attack hit an actor (will follow its hitting an actor rules)
- PF_MELEERANGE — spawn the puff as if from a melee attack (will follow the melee attack puff state/sound rules)
- PF_TEMPORARY — the puff will not play sounds and will not be replaced by particles (Verification needed)
- PF_HITTHINGBLEED — spawn the puff as if the attack hit a bleeding actor (will follow its hitting a bleeding actor rules)
- PF_NORANDOMZ — disable random vertical offset on the spawned puff's position
- PF_HITSKY — spawn the puff as if the attack hit a sky (will try to enter its Death.Sky state)
- These flags define the conditions for spawning the puff; the exact state it enters and sound it plays will be determined by what flags, states and sounds are defined in it (see Puff usage and behavior for details).
- Actor victim
- Actor pointer. Allows to manually tell the puff that the attack hit this actor.
Return values
- Actor — returns the pointer to the spawned puff.
Examples
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. |
See also
- Puff