ASTEROID FIELD

An asteroid field is an area filled with individual asteroids that can be destroyed and looted. An asteroid field works in a similar way to a junkyard, but the key difference is that an asteroid field is a global object (world.ics) and a junkyard is saved in local space (Sector_#.ics)

An asteroid field assembly file slightly differs from a standard assembly file. Each mode used in an asteroid field has to have its OWN *.asb file. Hereís a copy/paste example:

ASSEMBLY FILE (SINGLE ASTEROID)

	txt
	StaticMesh:
	{
		MeshName:	Spg2\Models\Asteroids\Necalli\ast01.mdl
		Position:	0	0	0
		Rotation: 	0	0	0
		Scale:		1	1	1
	}
	StaticMesh:
	{
		MeshName:	Spg2\Models\Asteroids\Necalli\ast01_LOD_Mid.mdl
		Position:	0	0	0
		Rotation: 	0	0	0
		Scale:		1	1	1
	}
	StaticMesh:
	{
		MeshName:	Spg2\Models\Asteroids\Necalli\ast01_LOD_Far.mdl
		Position:	0	0	0
		Rotation: 	0	0	0
		Scale:		1	1	1
	}
	StaticMesh:
	{
		MeshName:	Spg2\Models\Asteroids\Necalli\ast01_LOD_XFar.mdl
		Position:	0	0	0
		Rotation: 	0	0	0
		Scale:		1	1	1
	}

	CollisionMesh:	
	{	
		MeshName:	Spg2\Models\Asteroids\Standard11\1_ColShot.mdl
	}	

	ConvexCollisionMeshes:	
	{	
		MeshName:	Spg2\Models\Asteroids\Standard11\1_ColHit.mdl
	} 
	

There are 4 StaticMesh *.mdl files linked. These 4 represent the 4 level of detail models in this order: close, medium range, far, very far. The last two are of course Collision meshes. The first for shooting, and the second for object-to-object collision.

The best practice is to keep ALL individual StaticMesh models at size of 1 unit. The game and the World Editor handle the scaling.


ASTEROID FILE (*.ast)

Itís always good to look at an example, so hereís one:

	Asteroid:
	{
		ModelName:	Spg2\Models\Asteroids\Necalli\ast01.asb
	}
	Asteroid:
	{
		ModelName:	Spg2\Models\Asteroids\Necalli\ast02.asb
	}
	Asteroid:
	{
		ModelName:	Spg2\Models\Asteroids\Necalli\ast03.asb
	}
	Asteroid:
	{
		ModelName:	Spg2\Models\Asteroids\Necalli\ast04.asb
	}
	Asteroid:
	{
		ModelName:	Spg2\Models\Asteroids\Necalli\ast05.asb
	}
	...
	

Once you've got all your individual asteroids (*.asb) ready, you can compile the asteroidField file (*.ast). The *.ast file contains links to all assembly files (individual asteroids) the asteroid field will use in-game. Simply list all of them and that's it!

SCRIPT EVENTS

OnDestroySmall Triggered when smaller asteroids are destroyed
OnDestroyBig Triggered when the larger asteroids are destroyed

MAP FILE PARAMETERS

	AsteroidField:	
	{	
		ModelId:	4
		Position:	124875.33	0.00	102213.53
		NamePosition:	122897.00	0.00	93054.00
		Rotation:	0.00	0.00	0.00
		KeyName:	fjordAST
		Name:	Fjord
		Small:	6000	3.00	8.00
		Midium:	2000	40.00	80.00
		Big:	200	80.00	350.00
		Blobs:	60
		FoundCommodities:	22
		0	0	0.00
		Asteroids:	8160
		...
		Events:	
		{	
			OnDestroySmall:	Spg2\Scripts\AsteroidDestroy_Talgarno.sal
			OnDestroyBig:	Spg2\Scripts\AsteroidDestroy_Talgarno.sal
		}	
	}
	
ModelId Specific asteroid field file ([ Base\EditorAsteroids.wdt ]) used by this object type instance
Position Object global position. Positions of blobs and individual asteroids are then saved as offsets to this central position, making it possible to move an entire asteroid field around.
NamePosition XYZ coordinates to place the asteroid field name on the Starchart in-game. Y axis is ignored, so you can leave it at 0.00
Rotation DEPRECATED
KeyName Object keyname used for accessing via scripts
Name Specific name of this object instance
Small Minimum and maximum size, and number of small asteroids
Midium Minimum and maximum size, and number of medium-size asteroids
Big Minimum and maximum size, and number of large asteroids
Blobs Asteroid fields are placed on the map as blobs (spheres) inside which the individual asteroids are generated. Set these via the World Editor!
FoundCommodities A list of all commodities that can be dropped as loot when destroying asteroids. The series of parameters below this line is compiled in this form: CommodityId | Quantity | ChanceToDrop. Set these via the World Editor!
Asteroids Position of each generated asteroid is saved in this series of parameters. Generate asteroid fields via the World!
Events { } Set of events with linked scripts