Module SpawnStatic

Core -- Spawn dynamically new STATICs in your missions.

Banner Image


SPAWNSTATIC spawns static structures in your missions dynamically. See below the SPAWNSTATIC class documentation.


Demo Missions

SPAWNSTATIC Demo Missions source code

SPAWNSTATIC Demo Missions, only for beta testers

ALL Demo Missions pack of the last release


YouTube Channel

SPAWNSTATIC YouTube Channel


Author: FlightControl

Contributions:


Global(s)

SPAWNSTATIC

SPAWNSTATIC class, extends Base#BASE

The SPAWNSTATIC class allows to spawn dynamically new Statics.

Type SPAWNSTATIC

SPAWNSTATIC.CategoryID
SPAWNSTATIC.CoalitionID
SPAWNSTATIC.CountryID
SPAWNSTATIC:NewFromStatic(SpawnTemplatePrefix, SpawnCountryID)

Creates the main object to spawn a Static defined in the ME.

SPAWNSTATIC:NewFromType(SpawnTypeName, SpawnShapeName, SpawnCategory, CountryID)

Creates the main object to spawn a Static based on a type name.

SPAWNSTATIC:ReSpawn(PointVec2, Heading, ()

Creates the original Static at a POINT_VEC2.

SPAWNSTATIC:ReSpawnAt(Coordinate, Heading)

Creates the original Static at a POINT_VEC2.

SPAWNSTATIC:Spawn(Heading, (, NewName)

Creates a new Static at the original position.

SPAWNSTATIC:SpawnFromPointVec2(PointVec2, Heading, (, NewName)

Creates a new Static from a POINT_VEC2.

SPAWNSTATIC:SpawnFromZone(Zone, Heading, (, NewName)

Creates a new Static from a Zone.

SPAWNSTATIC.SpawnIndex
SPAWNSTATIC.SpawnTemplatePrefix
SPAWNSTATIC.SpawnTypeName

Global(s)

#SPAWNSTATIC SPAWNSTATIC

SPAWNSTATIC class, extends Base#BASE

The SPAWNSTATIC class allows to spawn dynamically new Statics.

Through creating a copy of an existing static object template as defined in the Mission Editor (ME), SPAWNSTATIC can retireve the properties of the defined static object template (like type, category etc), and "copy" these properties to create a new static object and place it at the desired coordinate.

New spawned Statics get the same name as the name of the template Static, or gets the given name when a new name is provided at the Spawn method.
By default, spawned Statics will follow a naming convention at run-time:

  • Spawned Statics will have the name _StaticName#nnn_, where StaticName is the name of the Template Static, and nnn is a counter from 0 to 99999.

SPAWNSTATIC construction methods

Create a new SPAWNSTATIC object with the SPAWNSTATIC.NewFromStatic():

  • SPAWNSTATIC.NewFromStatic(): Creates a new SPAWNSTATIC object given a name that is used as the base of the naming of each spawned Static.

Spawn methods

Groups can be spawned at different times and methods:

Type SpawnStatic

Type SPAWNSTATIC

Field(s)

SPAWNSTATIC.CategoryID
SPAWNSTATIC.CoalitionID
SPAWNSTATIC.CountryID
SPAWNSTATIC:NewFromStatic(SpawnTemplatePrefix, SpawnCountryID)

Creates the main object to spawn a Static defined in the ME.

Parameters

  • #string SpawnTemplatePrefix : is the name of the Group in the ME that defines the Template. Each new group will have the name starting with SpawnTemplatePrefix.

  • SpawnCountryID :

Return value

#SPAWNSTATIC:

SPAWNSTATIC:NewFromType(SpawnTypeName, SpawnShapeName, SpawnCategory, CountryID)

Creates the main object to spawn a Static based on a type name.

Parameters

  • #string SpawnTypeName : is the name of the type.

  • SpawnShapeName :

  • SpawnCategory :

  • CountryID :

Return value

#SPAWNSTATIC:

SPAWNSTATIC:ReSpawn(PointVec2, Heading, ()

Creates the original Static at a POINT_VEC2.

Parameters

  • Core.Point#POINT_VEC2 PointVec2 : The 2D coordinate where to spawn the static.

  • #number Heading : The heading of the static, which is a number in degrees from 0 to 360.

  • #string ( : ptional) The name of the new static.

Return value

#SPAWNSTATIC:

SPAWNSTATIC:ReSpawnAt(Coordinate, Heading)

Creates the original Static at a POINT_VEC2.

Parameters

  • Core.Point#COORDINATE Coordinate : The 2D coordinate where to spawn the static.

  • #number Heading : The heading of the static, which is a number in degrees from 0 to 360.

Return value

#SPAWNSTATIC:

SPAWNSTATIC:Spawn(Heading, (, NewName)

Creates a new Static at the original position.

Parameters

  • #number Heading : The heading of the static, which is a number in degrees from 0 to 360.

  • #string ( : ptional) The name of the new static.

  • NewName :

Return value

#SPAWNSTATIC:

SPAWNSTATIC:SpawnFromPointVec2(PointVec2, Heading, (, NewName)

Creates a new Static from a POINT_VEC2.

Parameters

  • Core.Point#POINT_VEC2 PointVec2 : The 2D coordinate where to spawn the static.

  • #number Heading : The heading of the static, which is a number in degrees from 0 to 360.

  • #string ( : ptional) The name of the new static.

  • NewName :

Return value

#SPAWNSTATIC:

SPAWNSTATIC:SpawnFromZone(Zone, Heading, (, NewName)

Creates a new Static from a Zone.

Parameters

  • Core.Zone#ZONE_BASE Zone : The Zone where to spawn the static.

  • #number Heading : The heading of the static, which is a number in degrees from 0 to 360.

  • #string ( : ptional) The name of the new static.

  • NewName :

Return value

#SPAWNSTATIC:

#number SPAWNSTATIC.SpawnIndex
SPAWNSTATIC.SpawnTemplatePrefix
SPAWNSTATIC.SpawnTypeName

Type SPAWNSTATIC.SpawnZoneTable