Creating smooth 2d animator with render overlay

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
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Creating smooth 2d animator with render overlay

Post by Apeirogon »

Say, I want create some animation like generic fire source (thing which constantly change sprite/texture to create illusion of actual fire) inside render over/underlay.
I should store "state" of the fire (fire frame, time from last frame change, etc) and hardcode all used textures or there are another way? I ask because I want to draw not only one fire source and not like ten fire source.

In other words, is there are something like "2d actor" in engine, which also exported to Zscript, or I should create naive/simple state machine for 2d animations myself if I want something like this?
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Creating smooth 2d animator with render overlay

Post by Apeirogon »

Apparently no, so I create this
viewtopic.php?f=105&t=69210
Problem with it, it didnt have smooth enough textures translation, since texture changing is bounded to logical state (very very primitive state) of an entity. And Im not sure how change texture without breaking it.

The only solution that comes to my mind is to create two different "tick" virtuals. One for progressing in logical states (which should be called every 1/35 seconds) and another for rendering states (for each frame). But again, Im not sure that it is the best solution, because I dont have work experience with pure 2D engines and an idea of how they works under the hood.
Post Reply

Return to “Scripting”