(solved) A_SprayDecal creates decals higher than actor

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.

(solved) A_SprayDecal creates decals higher than actor

Postby Jekyll Grim Payne » Thu Jan 10, 2019 2:28 pm

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 6:55 am, edited 1 time in total.
User avatar
Jekyll Grim Payne
 
Joined: 21 Jul 2008

Re: A_SprayDecal creates decals higher than actor

Postby Arctangent » Thu Jan 10, 2019 4:15 pm

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
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: A_SprayDecal creates decals higher than actor

Postby Jekyll Grim Payne » Thu Jan 10, 2019 4:38 pm

You're right! I didn't even realize my puff's height wasn't 1. Thanks a lot, that fixed it.
User avatar
Jekyll Grim Payne
 
Joined: 21 Jul 2008


Return to Scripting

Who is online

Users browsing this forum: XxMiltenXx and 2 guests