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
}
}
SPRITEFLIP doesn't work in an anonymous function
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.
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.
- Major Cooke
- Posts: 8175
- 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
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
SpriteFlip only works on sprites that have rotations, and this only affects when viewed anywhere except the direct front and back.
In that case, what you want to do is
Code: Select all
ScaleX *= frandompick(-1.0, 1.0)
Re: SPRITEFLIP doesn't work in an anonymous function
That is not correct.Major Cooke wrote:SpriteFlip only works on sprites that have rotations, and this only affects when viewed anywhere except the direct front and back.
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.
Re: SPRITEFLIP doesn't work in an anonymous function
Cool guys! Thank You! I'll be using that trick!
Re: SPRITEFLIP doesn't work in an anonymous function
Here is a minimal DECORATE sample that definitely works for a single sprite:
If something doesn't work please post complete and runnable sample.
Code: Select all
actor a
{
states
{
spawn:
SBOX A 1
SBOX A -1
{
bSPRITEFLIP = random(0, 1);
}
stop
}
}