SpawnBuilding (Harvest)

From OxeyeWiki

Revision as of 21:29, 2 December 2009 by 166 MMX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

spawnBuilding(type, x, y[, progress])

Places a new building in the game. The "type" parameter is the string ID of the building, which is "SPARKPRODUCER", "SPARKMOVER", "HARVESTER", "DEFENSETOWER", "MISSILETURRET", "EAGLEUPGRADE" and "TEMPESTUPGRADE" for the seven default buildings. Check the creativeBuildings.txt file in the sandbox folder to find the creative buildings' ID strings.

The "progress" parameter is used to define whether the building should be in a construction box or completed. The default is 1.0, which means it will be placed completed. Values less than 1.0 will place a construction box instead, with a certain amount of energy already.

Parameter Expected Type Description
type Number The building identifier name to spawn.
x Number The x world coordinate.
y Number The y world coordinate.
progress Number The progress in percent from 0 to 1.
Returns

Returns nothing.

Harvest Library

Example

-- Place a half-completed eagle turret in the game
harvest.spawnBuilding("EAGLEUPGRADE", 0, 0, 0.5)

Resources

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox