Problems with A_OverlayOffset

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
Ershantik
Posts: 19
Joined: Sat Dec 23, 2023 4:04 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 7

Problems with A_OverlayOffset

Post by Ershantik »

I'm trying to make an overlay that starts offscreen and then slowly moves in from the left.

Code: Select all

EFCT A 1 A_OverlayOffset(LEFTLAYER, -73, 0)
EFCT A 35 A_OverlayOffset(LEFTLAYER, 73, 0, WOF_ADD)
The sprite is being interpolated, but the problem is that it's happening too fast. It's moving into position almost immediately instead of over 35 tics, and nothing I do is changing it. How can I slow down the offset so that it's spread out over every tic of the frame?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Problems with A_OverlayOffset

Post by Jarewill »

You will have to move the overlay over many frames instead, interpolation only happens between single tics:
EFCT AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_OverlayOffset(LEFTLAYER, 2.085, 0, WOF_ADD)
Ershantik
Posts: 19
Joined: Sat Dec 23, 2023 4:04 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 7

Re: Problems with A_OverlayOffset

Post by Ershantik »

Thanks, that works. Still, that seems very inconvenient for moving sprites over long distances.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Problems with A_OverlayOffset

Post by ramon.dexter »

You need to understand the differency in definition.

EFCT A 35 means "show sprite efcta for 35 tics".
While
EFCT AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 means "show 35 different franes of efcta for 1 tick each".
Pretty different, don't you think?
Ershantik
Posts: 19
Joined: Sat Dec 23, 2023 4:04 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 7

Re: Problems with A_OverlayOffset

Post by Ershantik »

Fair enough. Either way, I ended up reducing the number of frames and increasing the offset to make it move faster, so it's not too bad now. Thanks for the advice.
Post Reply

Return to “Scripting”