Components: ⏲️Timers

From Cosmoteer Wiki
< Modding‎ | Components(Redirected from Components: ⏲️Timers)
Modding/Components/Timers
Jump to navigation Jump to search

What they are for

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.


Parameters

There are currently 10 available parameters specific to Timer.

  • Mandatory :
  • Optional :
    • Autostart (True / False)
    • Repeats (True / False)
    • 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) - buffable : When reset, what number the timer's value should be.
    • TriggerWhenStarted (True / False) : If this is set to True, in addition to triggering when it ends, the timer will trigger the same components when it starts.
    • StartExpired (True / False) : If this is set to True, when started, the timer's value will be 0.
    • InverseToggle (True / False) : If this is set to True, whatever toggle triggers this timer will be inverted (as far as this timer is concerned).

Example 1 - 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 :

Expand
Chaingun alt-details.png

((TBA))