(solved) A_SprayDecal creates decals higher than actor

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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!)
Post Reply
User avatar
Jekyll Grim Payne
 
 
Posts: 1076
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

(solved) A_SprayDecal creates decals higher than actor

Post by Jekyll Grim Payne »

I want to attach several decals to the puff for reasons. So the decal value is "none" and I use A_SprayDecal(varname) to spawn one of the possible decals. However, it spawns clearly too high.



Notice how the puff spawns below the crosshair position (which is normal with the default attackzoffset value) but the decal appears higher (in fact, at the height of the crosshair). The puff is a standard bulletpuff physics-wise.
Last edited by Jekyll Grim Payne on Sat Jan 12, 2019 5:55 am, edited 1 time in total.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: A_SprayDecal creates decals higher than actor

Post by Arctangent »

I imagine it has to do with the fact that SprayDecal fires its linetrace from the center of the calling actor, meaning that if the puff's got the default BulletPuff height ( which itself is the default Actor height), then the decal would be offset upwards by 8mu. Potentially even more visually, due to differences in how the puff graphic and the decal graphic are offset.

Probably simple enough to fix by setting the puff's height to 1 or 2. 0 height might not have any issues when given to something like a puff, but it kinda goes without saying that anything relating to collision being set to 0 will likely result in some dodgy nonsense.
User avatar
Jekyll Grim Payne
 
 
Posts: 1076
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: A_SprayDecal creates decals higher than actor

Post by Jekyll Grim Payne »

You're right! I didn't even realize my puff's height wasn't 1. Thanks a lot, that fixed it.
Post Reply

Return to “Scripting”