[DECORATE] Sprite Flip Flag?

Moderator: GZDoom Developers

Post Reply
User avatar
Ravick
Posts: 2003
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

[DECORATE] Sprite Flip Flag?

Post by Ravick »

In Blood's MAPEDIT, you could press 'F' at a sprite, or a sprite based thing, just like a monster, and it'd appear with its sprites flipped in game. I mean, a Cultist could appear to be left handed or right handed, simply by having or not having received an 'F' at the map editing. If the mapper pressed 'F' twice, it'd be upside down in game, and with a third "F", the monster would be upside down and left handed.

It probably has been suggested before, but I haven't seem any topic about it. So, I'd like to suggest a "FLIPPED" flag, that tells the engine to draw the sprites 1 and 5 side-inverted, (and, if the actor has actually 8 rotations, swap the corresponding ones). I't be nice to have side-variation in monsters, for example, so they'd not look to be all clones from the same guy. The same for decorations, effects and so on.

Well, as always, just an idea. :)
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [DECORATE] Sprite Flip Flag?

Post by Major Cooke »

Code: Select all

A_SetScale(ScaleX * -1)
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Xaser »

That'll flip the 2-4 rotations as well, which ain't gonna work.

[Also the parser accepts "XScale -1.0" in the actor definition anyhow; still will muck up the rotations though.]
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [DECORATE] Sprite Flip Flag?

Post by Graf Zahl »

You can't do a flip on a single rotation without messing around with the sprite itself. Actually, for this to work you not only have to flip the sprite rotations but also the rotation angle.
User avatar
Ravick
Posts: 2003
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Ravick »

Humm... Couldn't it be to "just" tell the engine to, lets say, additionally to flipping the '1' and the '5' sprites, draw the '8' sprite in place of the '2', the '3' in place of the '7', the '4' in place of the '6', and vice-versa?
I mean, somewhere in the hard code, it is told that the XXXXA2 is to be draw when the actor is seem from some angles. Couldn't it be told that, if the flag is on, the sprite XXXXA8 is to be drawn instead?
This would be needed only for actors that actually have 8 rotations sprites, I think. For those who have just 5, just like the imp, for example, maybe just flip the '1' and '5' cold work.

Well, I'm just guessing here. I'm seem this only from a "user view", not as a developer. (And I remember old discussions about the use of the word "just" in feature suggestions, XD ) Of course it maybe would be very hard to do, and would not worth the effort.

I'm just tossing some ideas in hope that they may be useful. :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [DECORATE] Sprite Flip Flag?

Post by Graf Zahl »

Wasn't that exactly what I was saying? Yes, if an animation is marked 'flipped' it needs to do precisely that.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Rachael »

This is on my "to-do" list. I'd like to see this feature as well and it does look interesting enough to implement.

But if someone beats me to it, don't let me stop you, I don't know when I will get to this. (Having other things I've been meaning to do for quite some time...)
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Rachael »

Attachments
flippers.pk3
test pk3
(355 Bytes) Downloaded 74 times
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Xaser »

I've been spending too much time on GitHub. I was looking for the "Add Your Reaction" button so I could post the "Hooray!" image.

For the sake of it anyway:
Image


[EDIT] Or I could do that on the PR like a brainful person would. Welp, time to double-dip.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Matt »

So does this flag flip the X of the sprite generally, or only the 1/5(/0?) ones?
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Rachael »

It flips all of them but you won't notice it if the sprite does not have full rotations. It piggybacks the mirror code.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [DECORATE] Sprite Flip Flag?

Post by Major Cooke »

Just to make sure the idea is clear here, from reading what the posts above say, it takes A8A2 and reads it as A2A8 instead, correct?

I.e. a lump with ZOMBA2A8 is instead read as ZOMBA8A2 and vice versa
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [DECORATE] Sprite Flip Flag?

Post by Rachael »

No. A8A2 is going to be A8A2 in the end.

What it will do is if you have a singular A8 frame and singular A2 frame, it will use a reversed A2 frame in place of A8 and a reversed A8 in place of A2. But that's it.

It's the exact same mechanics as what happens when you view the sprites in a mirror.

If you still don't understand how it is working, please download the attached pk3 and run it. I can't repeat the same thing over and over again until you understand it - you just have to try it yourself.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”