(DECORATE & Zscript) A projectile that puffs on a monster on impact

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Pandut
Posts: 232
Joined: Tue Mar 23, 2010 4:47 pm
Preferred Pronouns: No Preference
Graphics Processor: nVidia with Vulkan support
Location: existential dread

(DECORATE & Zscript) A projectile that puffs on a monster on impact

Post by Pandut »

AKA me losing my damn mind and most likely overlooking something extremely simple.

In a nutshell. I have a projectile that once it hits a bleeding/nonbleeding actor I would like it to attach a unique puff to that actor.

I've tried A_SpawnItemEx, A_FireBullets, A_CustomRailgun. The only one that works (but very inconsistently) is A_CustomRailgun. I'm looking for a sure-fire way for a puff to be attached to a monster every time.
Spoiler:
This is the projectile script in DECORATE. For context this is a 'Flare' that once it hits a monster actor it sets them on fire. The puff controls the 'Fire'. The puffs are written in Zscript.
Spoiler:
This is the Puff actor, written in Zscript. Both this and 'wpglob' are the same code, they just spawn different 'HitActors'. The HitActors are particle FX and a tick-based damage handlers.

A_SpawnItemEx does nothing in its current state. A_FireBullets had a weird issue of attaching the puff to the *player* depending on their angle from the target.

For AoE puff checks, A_CustomRailgun works perfectly fine but I'm looking for a consistent single-target application method. I hope I am just overthinking this and the solution is just .. right there. But I can't find it xD.

Return to “Scripting”