Simplemagicgrower
Based on game build 714014 | Last updated: 2026-03-03
Overview
SimpleMagicGrower is a helper component that drives incremental magical growth for an entity by repeatedly invoking Growable:DoGrowth() until a specified target stage (last_stage) is reached. It leverages the growable component, performs recursive delayed calls to Grow() between stages, and automatically terminates growth when the target is reached—releasing the magicgrowth tag and calling Growable:StartGrowing() once more to resume normal growth scheduling.
Usage example
local inst = CreateEntity()
inst:AddComponent("growable")
inst:AddComponent("simplemagicgrower")
inst.components.simplemagicgrower:SetLastStage(3)
inst.components.simplemagicgrower:StartGrowing()
Dependencies & tags
Components used: growable
Tags: Adds magicgrowth when growth begins; removes magicgrowth when growth completes.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
last_stage | number? | nil | The stage index (1-based) at which the sequential growth process stops. Must be set before calling Grow() or StartGrowing(). |
Main functions
SetLastStage(last_stage)
- Description: Sets the target growth stage at which the sequential growth sequence will stop.
- Parameters:
last_stage(number) — the stage index (matchingself.stagefromgrowable) to halt sequential growth. - Returns: Nothing.
Grow()
- Description: Performs a single growth step via
Growable:DoGrowth()and schedules the next step using a random-time delay (math.random()seconds) unlesslast_stageis reached. - Parameters: None.
- Returns: Nothing.
- Error states: Returns early with no effect if
growablecomponent is missing orlast_stageisnil.
StartGrowing()
- Description: Initializes the growth sequence by adding the
magicgrowthtag and callingGrow()for the first time. - Parameters: None.
- Returns: Nothing.
Events & listeners
- Listens to: None.
- Pushes: None.