⏲️Timers
< Modding | Components
Modding/Components/TimersComponents
- 🔟 Values
- 🎛️ Modes
- 🎚️Toggles
- ⚡ Triggers
- ⏲️Timers
- WeaponAutoTargetRules
- Weapon (modding)
- TypedResourceGrid
- TurretWeapon
- Thruster (modding)
- Storage components
- ShipRenderLayerRules
- SelfBuffProvider
- Rotation (modding)
- ResourceStorageProxy
- ResourceStorage
- ProgressBar
- PartUIToggle
- PartToggledComponents
- PartSprite
- PartComponent
- Other components
- OperationalPartComponent
- OperationalChainablePartComponent
- MultiValue
- Modding/Components/UI
- Modding/Components/PartToggleProxy
- Modding/Components/DistanceThreshold
- Modding/Components/Buffs
- InlineResourceConverter
- GridBuffProvider
- FtlDrive
- FlexResourceGrid
- FixedWeapon
- Emitter
- DeathEffects
- ContinuousEffects
- CircleBuffProvider
- ChainablePartComponent
- BuffableValue
- BeamEmitter
- BaseResourceStorage
- BasePartBuffProvider
- BaseCollider
- AreaBuffProvider
- Airlock (modding)
(source ref)
(quote)
(alias)
Timers are components that count up or down from a given float-type number when triggered.
You use them when you want to keep track of time for any reason, such as causing a delayed effect or scaling something based on time for example.
Timers act both as a toggle and a trigger. While it counts, the toggle is off, and when it finishes counting, the trigger fires.
(inheritance)
(use)
Name | Type | Required? | Buffable? | Default value | Description |
---|---|---|---|---|---|
Duration | float | Yes | Yes | ||
Autostart | bool | - | - | If the timer starts without needing to be triggered. | |
Repeats | bool | - | - | ||
StartTrigger | (Trigger) | - | - | Any trigger referenced here starts the timer when it becomes true (unless inverted). Calling it while the timer is running does nothing. | |
StopTrigger | (Trigger) | - | - | The opposite of StartTrigger .
| |
ResetTrigger | (Trigger) | - | - | A referenced trigger will reset the timer to whatever Duration it was set to.
| |
DurationAfterResetTrigger | float | - | Yes | When reset, what number the timer's value should be. | |
TriggerWhenStarted | bool | - | - | If this is set to True, in addition to triggering when it ends, the timer will trigger the same components when it starts. | |
StartExpired | bool | - | - | If this is set to True, when started, the timer's value will be 0. | |
InvertToggle | bool | - | - | If this is set to True, the toggle part of the timer is inverted. |
Notes
Nothing yet.
Examples
Chaingun
GunIsFiringTimer //Is on if we have fired a shot
{
Type = Timer
Duration = &../ShellChangingValueTween/OffTweenDuration
StartTrigger = BulletEmitter
ResetTrigger = BulletEmitter
StartExpired = true
InvertToggle = true
}
GunIsFiring
{
Type = MultiToggle
Toggles = [GunIsFiringTimer, CombinedBulletSplitters]
Mode = All
}
RateOfFireRampUpBuff
{
Type = SelfBuffProvider
BuffType = RateOfFire //used as divide by the fixed weapon fire rate
BuffAmount = 1
BuffMultiplier = RateOfFireTween
}
RateOfFireTween
{
Type = ValueTween
OffValue = 1
OnValue = 10.5 //30 shots per second if base value 0.35
OnTweenDuration = 10
OffTweenDuration = (&OnTweenDuration) / 2 //cooldown is half the ramp up
IsOnToggle = GunIsFiring
}
For reference, this is how it ends up in-game :