How to ramp up rotation?

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!)
Moebius
Posts: 48
Joined: Thu Jan 28, 2021 1:45 am

How to ramp up rotation?

Post by Moebius »

I have two large models that are concentric and counter rotate. I can get the final rotation I want in MODELDEF. But they're rotating from the get go at full speed.

Code: Select all

Model newreactorinnerring
{
	Path "Models"
	Model 0 "newreactorinnerring.obj"
	SurfaceSkin 0 0 "lfw20.png"
	Scale 1.0 1.0 1.2
	ROTATING
	Rotation-Speed 6
	Rotation-Center 0 0 0
	Rotation-Vector 0 0 -1

	USEACTORPITCH
	USEACTORROLL

	FrameIndex MDCA A 0 0
}
Model newreactorouterring
{
	Path "Models"
	Model 0 "newreactorouterring.obj"
	SurfaceSkin 0 0 "lfw31b.png"
	SurfaceSkin 0 1 "lfw4.png"
	SurfaceSkin 0 2 "mctc10.png"
	Scale 1.0 1.0 1.2
	ROTATING
	Rotation-Speed 2
	Rotation-Center 0 0 0
	Rotation-Vector 0 0 1

	USEACTORPITCH
	USEACTORROLL

	FrameIndex MDCA A 0 0
}
I want them to slowly pick up speed when triggered.

Anyone have a solution?
Gez
 
 
Posts: 17633
Joined: Fri Jul 06, 2007 3:22 pm

Re: How to ramp up rotation?

Post by Gez »

If you want to control their rotation in-game, you should not use MODELDEF for that and instead have the actors [wiki=A_SetAngle]change their angle in code[/wiki].

The MODELDEF rotation function is if you want models to always rotate. If you've ever played a game like Quake 3 Arena where the pickups are constantly rotating in place, that should give you an idea of the use-case for it.

Return to “Scripting”