Module hoggit.spawner
spawner.lua Spawning utilities for H.O.G.G.I.T.
Framework
Functions
HOGGIT.Spawner (grpName) | Spawner object that takes a group name from the ME. |
Spawn (self) | Spawns a copy of the "template" group in the mission editor Spawns the group at the same location and with the same parameters as the 'template' in the mission editor. |
SpawnAtPoint (self, point) | Same as 'Spawn', but takes an SSE Vec2 (table with an X and Y keys) |
SpawnInZone (self, zoneName) | Same as 'Spawn' but takes a zone name defined in the mission editor |
OnSpawnGroup (self, f, args) | Add a function with arguments to be called when this Spawner actually spawns a unit |
HOGGIT.SetupDefaultSpawners () | Setup the default table of spawners, one for every group in the .miz |
Functions
- HOGGIT.Spawner (grpName)
-
Spawner object that takes a group name from the ME.
Has flexible options for spawning a group once defined. One of these are created for each group that exists
in the .miz later on (stored in HOGGIT.spawners), but you can also define your own if you'd like to have groups
that have the same template in the .miz, but have different behaviors
(like spawning in a different location, or adding respawn options)
Example usage: With a group in your .miz with the name "Good Guys 1": local good_guys_spawn = HOGGIT.Spawner("Good Guys 1") local spawned_good_guys_group = good_guys_spawn:Spawn()
Parameters:
- grpName Name of a group defined in the mission editor
Returns:
-
HOGGIT.Spawner
- Spawn (self)
-
Spawns a copy of the "template" group in the mission editor
Spawns the group at the same location and with the same parameters as the 'template' in the mission editor.
Parameters:
- self HOGGIT.Spawner object
Returns:
-
Group
- SpawnAtPoint (self, point)
-
Same as 'Spawn', but takes an SSE Vec2 (table with an X and Y keys)
Parameters:
- self HOGGIT.Spawner object
- point Vec2
Returns:
-
Group
- SpawnInZone (self, zoneName)
-
Same as 'Spawn' but takes a zone name defined in the mission editor
Parameters:
- self HOGGIT.Spawner object
- zoneName Name of a zone that's defined in the mission editor
Returns:
-
Group
- OnSpawnGroup (self, f, args)
-
Add a function with arguments to be called when this Spawner actually spawns a unit
Parameters:
- self HOGGIT.Spawner
- f the function to be called, always called with spawned group as first param
- args table of additional arguments that the callback function will be called with
- HOGGIT.SetupDefaultSpawners ()
- Setup the default table of spawners, one for every group in the .miz