Lanie Posted September 24, 2023 (edited) Dear Doomers, i already know how to add costum sprites as a decorate, e. g. a trashcan (see below). Can you tell me, how to add animated sprites as decorat? actor Trash 25511 { //$Category Obstacles Radius 32 Height 64 +SOLID States { Spawn: TRAS A -1 Stop } } Thank you, Lanie. Edited September 24, 2023 by Lanie 0 Quote Share this post Link to post
0 ShallowB Posted September 24, 2023 The exact same way, just add more frames. If you want an animated trashcan with two frames, you need a TRAS A and TRAS B frame. Change that -1 to the amount of tics you want each frame to last. And if you want it to loop, change that "Stop" to a "Loop". https://zdoom.org/wiki/Creating_non-interactive_decorations 1 Quote Share this post Link to post
0 Gez Posted September 24, 2023 And if your decoration does not have anything special going on (the examples on the wiki include something that alternates between full-bright and not, and something that calls action functions), you can have all your states on a single line, like this: actor Trash 25511 { //$Category Obstacles Radius 32 Height 64 +SOLID States { Spawn: TRAS ABCDEFGH 5 Loop } } Here the trash can goes through eight frames of animation (A to H), staying for five tics (1/7th of a second) each, so the total animation cycle lasts for about 1.143 seconds, and looping back to the start of the animation when finished. If you do want to do fancy effects on certain frames only, then you will have to separate those frames. Here's another example where the trash can emits a sound on the F frame: actor Trash 25511 { //$Category Obstacles Radius 32 Height 64 +SOLID States { Spawn: TRAS ABCDE 5 TRAS F 5 A_StartSound("trashcan/noise") TRAS GH 5 Loop } } (This example assumes that the sound "trashcan/noise" is defined somewhere in SNDINFO. It's not a vanilla sound so it doesn't exist by default, this is just for example.) 1 Quote Share this post Link to post
0 Lanie Posted September 24, 2023 1 hour ago, Gez said: And if your decoration does not have anything special going on (the examples on the wiki include something that alternates between full-bright and not, and something that calls action functions), you can have all your states on a single line, like this: actor Trash 25511 { //$Category Obstacles Radius 32 Height 64 +SOLID States { Spawn: TRAS ABCDEFGH 5 Loop } } Here the trash can goes through eight frames of animation (A to H), staying for five tics (1/7th of a second) each, so the total animation cycle lasts for about 1.143 seconds, and looping back to the start of the animation when finished. If you do want to do fancy effects on certain frames only, then you will have to separate those frames. Here's another example where the trash can emits a sound on the F frame: actor Trash 25511 { //$Category Obstacles Radius 32 Height 64 +SOLID States { Spawn: TRAS ABCDE 5 TRAS F 5 A_StartSound("trashcan/noise") TRAS GH 5 Loop } } (This example assumes that the sound "trashcan/noise" is defined somewhere in SNDINFO. It's not a vanilla sound so it doesn't exist by default, this is just for example.) Thank you for your great answers! I have 2 follow-up questions: 1.) Do I put the aditional pictures/frames into the same S/Start // S/END group like the orignal decoration-sprite? (and add them to the patch-table) 2.) and more importantly: Do i need to define this animation also in the ANIMDEF-File or is it enough to code into the decoration-file? 0 Quote Share this post Link to post
0 Gez Posted September 24, 2023 48 minutes ago, Lanie said: 1.) Do I put the aditional pictures/frames into the same S/Start // S/END group like the orignal decoration-sprite? Yes. 48 minutes ago, Lanie said: (and add them to the patch-table) No. The patch table is there for texture patches, not for sprites. It's only useful to add a sprite to the patch table if you want to put it on a wall texture as well. 51 minutes ago, Lanie said: 2.) and more importantly: Do i need to define this animation also in the ANIMDEF-File or is it enough to code into the decoration-file? Also no. ANIMDEFS is also something that is relevant for textures, not for sprites. Sprites are animated according to their actor's state table, so there's no need to bring in a secondary animation that would work at cross-purpose with the first. 1 Quote Share this post Link to post
Question
Lanie
Dear Doomers,
i already know how to add costum sprites as a decorate, e. g. a trashcan (see below). Can you tell me, how to add animated sprites as decorat?
actor Trash 25511 { //$Category Obstacles Radius 32 Height 64 +SOLID States { Spawn: TRAS A -1 Stop } }
Thank you, Lanie.
Edited by LanieShare this post
Link to post
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.