PlaceObjects
Objects
Creation
5.1 OC
int
id
definition
ID of the object to be created
int
amount
Count of objects to be created
string
material_name
Material in which object are to be created. This can be a material name or a string as follows:
material_index
Create in
"GBackSolid"
Objects are created in solid material. Also see GBackSolid().
"GBackSemiSolid"
Objects are created in solid or liquid material. Also see GBackSemiSolid().
"GBackLiquid"
Objects are created in liquid material. Also see GBackLiquid().
"GBackSky"
Objects are created in mid-air. Also see GBackSky().
int
x
Left boundary coordinate of the target rectangle (x coordinate).
int
y
Top boundary coordinate of the target rectangle (y coordinate).
int
width
Width of the target rectangle. If not specified, the right landscape boundary.
int
height
Height of the target rectangle. If not specified, the bottom landscape boundary.
bool
on_surface
If true
, all objects will be created above the upper surface of the specified material (this might be outside the target rectangle).
bool
no_stuck
If true
, placement will not ensure that objects are in solid material. This is needed e.g. when placing objects in liquids.
Creates the specified number of objects in the specified target rectangle and target material (optional). Returns the number of iterations or -1 if creation has failed.
If there is only very little of the target material present in the landscape, placement calculation will take longer.
However, endless retry loops are avoided.
PlaceObjects(Loam,20,"Earth",100,0,200)
Create 20 chunks of loam in earth within the coordinates 100,0 and 200,LandscapeHeight().
PlaceObjects(Fish,10,"GBackLiquid",0,0,0,LandscapeHeight()/2,0,1);
Creates a total of 10 fishes in all liquids found in the upper half of the landscape.
CreateObject
Tyron2004-08