Module SpawnStatic
Core -- Spawn dynamically new STATICs in your missions.
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
API CHANGE HISTORY
The underlying change log documents the API changes. Please read this carefully. The following notation is used:
- Added parts are expressed in bold type face.
- Removed parts are expressed in italic type face.
Hereby the change log:
AUTHORS and CONTRIBUTIONS
Contributions:
Authors:
- FlightControl: Design & Programming
Global(s)
| SPAWNSTATIC |
SPAWNSTATIC class, extends Base#BASEThe SPAWNSTATIC class allows to spawn dynamically new Statics. |
Type SPAWNSTATIC
| SPAWNSTATIC.CountryID | |
| SPAWNSTATIC:NewFromStatic(SpawnTemplatePrefix, CountryID) |
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:SpawnFromPointVec2(PointVec2, Heading, (, NewName) |
Creates a new Static from a POINT_VEC2. |
| SPAWNSTATIC:SpawnFromZone(Zone, Heading, (, NewName) | |
| 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:
- SPAWNSTATIC.SpawnFromPointVec2(): Spawn a new group from a POINT_VEC2 coordinate. (The group will be spawned at land height ).
- SPAWNSTATIC.SpawnFromZone(): Spawn a new group in a Zone.
Type SpawnStatic
Type SPAWNSTATIC
Field(s)
- SPAWNSTATIC:NewFromStatic(SpawnTemplatePrefix, CountryID)
-
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. -
CountryID:
Return value
-
- 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: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: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
-
- #number SPAWNSTATIC.SpawnIndex