Rolling and Scaling a FLATSPRITE

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!)
User avatar
SPZ1
Posts: 205
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Rolling and Scaling a FLATSPRITE

Post by SPZ1 »

This code below is how I first figured that it would be done. Unfortunately, it didn't work and a bunch of variations didn't work either. Is there any way to do this?
Note: The 'DONE' state is being switched to with an ACS script so it is not the problem..

Code: Select all

ACTOR Septagram_Floor 19201 {
	Height 512
	Radius 256
	Scale 0.5	//128x128
	+FLATSPRITE
	//+ROLLSPRITE
	+ROLLCENTER
	States {
		Spawn:
			SEPT G 1 BRIGHT {
				roll += 3;	
			}

			Loop
		Done:
			SEPT G 1 BRIGHT {
				roll += 3;
				scaleX -= 0.05;
				scaleY -= 0.05;

				//A_SetScale(scaleX, scaleX);
			
				if (scaleX <= 0.0){
					return state("Null");
				}else{
					return state("Done");
				}
			
		
			}

			Loop
	}
}
User avatar
Jaxxoon R
Posts: 772
Joined: Sun May 04, 2014 7:22 pm

Re: Rolling and Scaling a FLATSPRITE

Post by Jaxxoon R »

Considering it looks like you want this to be some kind of floor decoration, I'd suggest adjusting the angle instead of the actor's roll. You've also got the rollsprite flag commented out, so even if you were to adjust the roll there'd be no visual effect.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 47988
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Rolling and Scaling a FLATSPRITE

Post by Graf Zahl »

The main problem with FLATSPRITEs is that they were basically thrown into the engine due to public pressure without ever thinking through the implementation. Don't try to do any more involved stuff with them as it's really not properly defined. As long as you don't try to tilt or roll them they should be ok, but no guarantees beyond that.
User avatar
SPZ1
Posts: 205
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Re: Rolling and Scaling a FLATSPRITE

Post by SPZ1 »

They seem to be able to roll infinitely without a problem... It is the scaling that gets messy :(
User avatar
Major Cooke
Posts: 8059
Joined: Sun Jan 28, 2007 3:55 pm

Re: Rolling and Scaling a FLATSPRITE

Post by Major Cooke »

Use angle instead because flat sprites are horizontal without pitch.

Think of roll as doing a barrel roll. Or just like a dog rolling over and playing dead.

Return to “Scripting”