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!)

Rolling and Scaling a FLATSPRITE

Postby SPZ1 » Tue Nov 21, 2017 9:19 pm

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 allExpand view
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
SPZ1
 
Joined: 02 Aug 2017
Location: Illinois

Re: Rolling and Scaling a FLATSPRITE

Postby Jaxxoon R » Wed Nov 22, 2017 12:01 am

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
Jaxxoon R
 
Joined: 04 May 2014

Re: Rolling and Scaling a FLATSPRITE

Postby Graf Zahl » Wed Nov 22, 2017 1:26 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Rolling and Scaling a FLATSPRITE

Postby SPZ1 » Wed Nov 22, 2017 7:09 am

They seem to be able to roll infinitely without a problem... It is the scaling that gets messy :(
User avatar
SPZ1
 
Joined: 02 Aug 2017
Location: Illinois

Re: Rolling and Scaling a FLATSPRITE

Postby Major Cooke » Wed Nov 22, 2017 6:20 pm

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.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests