reuse other sprites for facing the same directions

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
Lagi
Posts: 677
Joined: Sat Jun 23, 2018 12:51 pm
Location: Thou shalt alter thy beliefs with new evidence

reuse other sprites for facing the same directions

Post by Lagi »

Is it possible to use for one animation set, sprite from other set. To cover the same direction?

I start drawing some monsters attack (and its a demanding task :D ) so when my monster is making MONS A5 attack, I would like to reuse MONT B5, without copy-paste and renaming MONT B5 into MONS A5.

edit:
I know I can name MONT A5 => MONT A 0 - but I would like to have views of different angles (infights or multi)
User avatar
22alpha22
Posts: 303
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: reuse other sprites for facing the same directions

Post by 22alpha22 »

You can define sprite rotation frames in the TEXTURES lump and use duplicate frames without actually having to copy the sprite. I use this method all the time to save space in my projects.

An example:
Sprite SENTB5, 39, 49
{
Offset 19, 49
Graphic SENTA5, 0, 0
}
User avatar
Lagi
Posts: 677
Joined: Sat Jun 23, 2018 12:51 pm
Location: Thou shalt alter thy beliefs with new evidence

Re: reuse other sprites for facing the same directions

Post by Lagi »

can you provide some more explanation? It doesnt work for me:

I take size of each replaced sprite, and put it as the size of Fake sprite canvas.

patch from graphic is start drawn from top left to right bottom. Offset doesn't matter because the size of both frames is the same.

Still in game I see that nothing is drawn for other angles. Help. pls.

edit:
ok, I need offset. Its the same coorinates that are used to placed monster weapon in Slade.
Spoiler:
EDIT2:
ehh... if one like to be pixel perfect he would have to write down 4x coordinate for each sprite and then retype it into Textures. Its easier and faster to copy sprite, download advance renamer, mass change 4 letters, upload to your mod - price? +15kb of mod size per sprite (in an period of time when you dl GB of data in minutes).
Post Reply

Return to “Scripting”