SPRITEFLIP doesn't work in an anonymous function

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Guest

SPRITEFLIP doesn't work in an anonymous function

Post by Guest »

I found out today that bSPRITEFLIP doesn't work in an anonymous function!


ACTOR Tree01 8701 {
Height 209
Radius 68
+SOLID
States {
Spawn:
TREE A 1
TREE A 1 {
bSPRITEFLIP = random(FALSE, TRUE);
}

Stop
}
}
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: SPRITEFLIP doesn't work in an anonymous function

Post by Major Cooke »

That's not how it works. That tree doesn't have any rotations installed and is just TREEA0 for a sprite name, right?

In that case, what you want to do is

Code: Select all

ScaleX *= frandompick(-1.0, 1.0)
SpriteFlip only works on sprites that have rotations, and this only affects when viewed anywhere except the direct front and back.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: SPRITEFLIP doesn't work in an anonymous function

Post by Rachael »

Major Cooke wrote:SpriteFlip only works on sprites that have rotations, and this only affects when viewed anywhere except the direct front and back.
That is not correct.

SpriteFlip works on objects without rotations, and also works on the direct front and back as well as all rotations. All it does is simply mirror the rotation angle and flips the sprite.
User avatar
SPZ1
Posts: 244
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois
Contact:

Re: SPRITEFLIP doesn't work in an anonymous function

Post by SPZ1 »

Cool guys! Thank You! I'll be using that trick!
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: SPRITEFLIP doesn't work in an anonymous function

Post by _mental_ »

Here is a minimal DECORATE sample that definitely works for a single sprite:

Code: Select all

actor a
{
	states
	{
	spawn:
		SBOX A 1
		SBOX A -1
		{
			bSPRITEFLIP = random(0, 1);
		}
		stop
	}
}
If something doesn't work please post complete and runnable sample.
Post Reply

Return to “Closed Bugs [GZDoom]”