Menu
IntroductionPhysics ObjectsForce EntitiesAdvanced UsageFurther Information
Power Scaling
Gyro 2.1a

Gyro_Force_SetPowerScale(entity force, float scale)
This function may be used to scale the effective strength of a force's affector components during runtime. The given scale may be any value above zero and, on newly created forces, defaults to 1.0. Repeated applications of this function are not cumulative, meaning that scaling by 2.0 and then 3.0 will not produce six times the power, only three times, as this was the last applied scale. This is an important consideration to make when dealing with the function below.

Gyro_Force_SetPowerScaleRate(entity force, float scalerate)
With this function, the above power scale of a force may be set to change automatically over time. The given scalerate value determines by how much the force's scale increases every second - starting at a scale of 1.0 with a scalerate of 0.5, for example, will cause the scale to rise to 1.5 a second later, then 2.0 a second after that. You may also provide a negative scalerate to create diminshing or otherwise short-term forces. Should the total scale ever reach or fall below zero the force entity will be destroyed automatically, unless instructed otherwise by the application of the persistent property.

Note: Similar functions are provided to control a force's range scale.