A Duke Corpse Flag

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A Duke Corpse Flag

Re: A Duke Corpse Flag

by Enjay » Sat Nov 30, 2013 3:02 am

TXTX wrote:Also i edited the code a bit to keep up with the actor's unique scales for my mod. Should help if you need it.

Code: Select all

A_SetScale((random(0,1)*2-1)*ScaleX, ScaleY)
I'm sure that it will. Thank you.

Re: A Duke Corpse Flag

by Blzut3 » Fri Nov 29, 2013 10:44 pm

I've opened a bug report. Since this flag is otherwise unneeded this thread can be closed.

Re: A Duke Corpse Flag

by TXTX » Thu Nov 28, 2013 1:32 pm

I have used sprite mirroring the original way but with some actors having a lot of sprites I was looking for another method.

By not having enough room I mean like the archvile's sprites where he goes all the way to a-z and then to slashes with the fifth letter.

Code: Select all

VILE Y 0
VILE Z 0
VILE [ 0
VILE \ 0
VILE ] 0
Isn't the sprite letter limit from a-z and "[\]"?

Seems the only way to add mirrored deaths for actors with a lot of sprites is to duplicate and rename them for full compatibility if i'm not mistaken.
Enjay wrote:FWiW, the reason I wasn't using negative scaling and was using the sprite naming instead was mainly because I was already applying random scale factors to my own enemies in their spawn state to randomise the size of the enemies slightly.
Also i edited the code a bit to keep up with the actor's unique scales for my mod. Should help if you need it.

Code: Select all

A_SetScale((random(0,1)*2-1)*ScaleX, ScaleY)

Re: A Duke Corpse Flag

by Enjay » Thu Nov 28, 2013 12:24 pm

FWiW, the reason I wasn't using negative scaling and was using the sprite naming instead was mainly because I was already applying random scale factors to my own enemies in their spawn state to randomise the size of the enemies slightly.

However, I hope that -ve scaling is allowed because I've been using that on special effects like smoke clouds and so on.

As far as I know the sprite naming version should work even in vanilla (although I'm not sure how you'd get it to randomly pick a death state). If you look at the sprite naming for the hell knight, arachnotron and spiderdemon they basically do this for some of their frames.

Re: A Duke Corpse Flag

by Nash » Thu Nov 28, 2013 5:57 am

Best to ask Randi if negative scale is officially supported or not and the fact that it only works in OpenGL is a bug or not. Could be a legit feature that somehow managed to not work due to an oversight in the software renderer (it's happened before - if I remember correctly - with regards to texture mirroring; they were reported by MaxEd IIRC)

Re: A Duke Corpse Flag

by TheMightyHeracross » Thu Nov 28, 2013 5:29 am

You shouldn't use that method, because it only works in GL, and screws regular ZDoom users over. Use the original way suggested by Enjay.

Re: A Duke Corpse Flag

by TXTX » Thu Nov 28, 2013 2:48 am

Wow this works! :shock:

Never thought of negative scaling. Impressive!

Re: A Duke Corpse Flag

by Blue Shadow » Thu Nov 28, 2013 2:03 am

I'm interested to know if this trick is actually "legally"supported by the OpenGL renderer and is not some kind of an undefined behavior.

Re: A Duke Corpse Flag

by Ed the Bat » Thu Nov 28, 2013 1:13 am

Blzut3 wrote:Interesting. I'm getting invisible actors when I set the scale negative. Didn't think too much about it since the wiki claims only positive values are legal for the xscale property.
I... don't know what to tell ya. Calling A_SetScale(-xscale,yscale) produces a horizontally-flipped duplicate of what my actor would normally look like.
EDIT: I figured it out! This negative scale trick only works in GL mode. Software doesn't allow it.

Re: A Duke Corpse Flag

by Blzut3 » Thu Nov 28, 2013 1:08 am

Interesting. I'm getting invisible actors when I set the scale negative. Didn't think too much about it since the wiki claims only positive values are legal for the xscale property.

Re: A Duke Corpse Flag

by Ed the Bat » Thu Nov 28, 2013 12:02 am

Blzut3 wrote:If only negative scales worked?
They do. That's how I randomly flip actor's sprites.

Re: A Duke Corpse Flag

by Blzut3 » Wed Nov 27, 2013 11:59 pm

Simpler version:

Code: Select all

Death:
  "####" "#" 0 A_SetScale(random(0,1)*2-1, 1)
  goto Super::Death
If only negative scales worked?

Re: A Duke Corpse Flag

by wildweasel » Wed Nov 27, 2013 7:44 pm

And yet, the only thing I see here is the missed opportunity that someone should have named their example actor "Flimp." =P

Re: A Duke Corpse Flag

by Ethril » Wed Nov 27, 2013 6:17 pm

Ed the Bat wrote:A_SetScale(-scalex,scaley) should mirror it. Maybe use that with a Jump to randomize it.
Just make sure you revert it during the Raise state (if applicable) otherwise things start to look weird. ;)

basically, do something like this

Code: Select all

actor FlipImp : DoomImp replaces DoomImp
{
 states
 {
  Death:
    TROO I 0 A_Jump(128,"Flippity")
	goto Super::Death
  Flippity:
    TROO I 0 A_SetScale(-1.0,1.0)
	goto Super::Death
  Raise:
    TROO I 0 A_SetScale(1.0,1.0)
	goto Super::Raise
 }
}

Re: A Duke Corpse Flag

by Ed the Bat » Wed Nov 27, 2013 6:09 pm

A_SetScale(-scalex,scaley) should mirror it. Maybe use that with a Jump to randomize it.

Top