File upandaway/components/skyflyspawner.lua

Component for spawning things on flowers.

Author:

simplex

Functions

SkyflySpawner:GetDelay () Returns the delay, possibly calling the configured one.
SkyflySpawner:GetSpawnFlower () Gets a flower to spawn a fly on.
SkyflySpawner:Reboot () Stops spawning and then calls Touch().
SkyflySpawner:SetDelay (dt) Sets the delay between spawns.
SkyflySpawner:SetFlyPrefab (prefab) Sets the fly prefab.
SkyflySpawner:SetMaxDistance (ds) Maximum distance from player to spawn.
SkyflySpawner:SetMaxFlies (n) Sets the fly cap.
SkyflySpawner:SetMinDistance (ds) Minimum distance from player to spawn.
SkyflySpawner:SetMinFlySpread (ds) Minimum distance between flies.
SkyflySpawner:SetPersistence (b) Sets whether entities spawned should be kept across reloading.
SkyflySpawner:StartSpawning () Sets up the spawning task.
SkyflySpawner:StopSpawning () Stops the spawning task, if any.
SkyflySpawner:Touch () Starts or stops spawning according to the number of flies already tracked.
SkyflySpawner:Track (fly) Adds a fly to the tracking list, if it's not there already.
SkyflySpawner:Untrack (fly) Removes a fly from the tracking list.

Tables

SkyflySpawner Component for spawning things on flowers.


Functions

SkyflySpawner:GetDelay ()
Returns the delay, possibly calling the configured one.
SkyflySpawner:GetSpawnFlower ()
Gets a flower to spawn a fly on.
SkyflySpawner:Reboot ()
Stops spawning and then calls Touch().
SkyflySpawner:SetDelay (dt)
Sets the delay between spawns.

Parameters

  • dt: A positive number or a function, receiving self.inst and returning the delay.
SkyflySpawner:SetFlyPrefab (prefab)
Sets the fly prefab.

Parameters

  • prefab:
SkyflySpawner:SetMaxDistance (ds)
Maximum distance from player to spawn.

Parameters

  • ds:
SkyflySpawner:SetMaxFlies (n)
Sets the fly cap.

Parameters

  • n:
SkyflySpawner:SetMinDistance (ds)
Minimum distance from player to spawn.

Parameters

  • ds:
SkyflySpawner:SetMinFlySpread (ds)
Minimum distance between flies.

Parameters

  • ds:
SkyflySpawner:SetPersistence (b)
Sets whether entities spawned should be kept across reloading.

Parameters

  • b: A boolean.
SkyflySpawner:StartSpawning ()
Sets up the spawning task.
SkyflySpawner:StopSpawning ()
Stops the spawning task, if any.
SkyflySpawner:Touch ()
Starts or stops spawning according to the number of flies already tracked.
SkyflySpawner:Track (fly)
Adds a fly to the tracking list, if it's not there already. Sets up "entitysleep" and "enterlimbo" callbacks for removing it.

Parameters

  • fly:
SkyflySpawner:Untrack (fly)
Removes a fly from the tracking list. Removes the event listeners.

Parameters

  • fly:

Tables

SkyflySpawner
Component for spawning things on flowers.

Valid XHTML 1.0!