DefineUpgradeButton (Harvest)
From OxeyeWiki
(Difference between revisions)
(Created page with '{{HarvestMethod | defineUpgradeButton(oldBuilding, newBuilding) | Defines an upgrade button for 'upgradeBuildingId'. | {{MethodParam|oldBuilding|String|The building identifier na...') |
|||
Line 6: | Line 6: | ||
| | | | ||
{{MethodParam|oldBuilding|String|The building identifier name of the building that is upgradable.}} | {{MethodParam|oldBuilding|String|The building identifier name of the building that is upgradable.}} | ||
- | {{MethodParam| | + | {{MethodParam|newBuilding|String|The building identifier name of the building that it will be upgraded to.}} |
| | | | ||
Returns nothing. | Returns nothing. |
Latest revision as of 19:27, 2 December 2009
defineUpgradeButton(oldBuilding, newBuilding) | ||
Defines an upgrade button for 'upgradeBuildingId'. | ||
Parameter | Expected Type | Description |
oldBuilding | String | The building identifier name of the building that is upgradable. |
newBuilding | String | The building identifier name of the building that it will be upgraded to. |
Returns | ||
Returns nothing. |
Example
harvest.defineUpgrade("SUPERSOLARPLANT", "Super-duper Solar Plant", "This is a really good solar plant.", 300, 100, 30.0, "SparkProducer") harvest.defineUpgradeButton("SPARKPRODUCER", "SUPERSOLARPLANT") local function runSuperSolarPlant(entity, params, deltaTime) params.timer = params.timer or 0 params.timer = params.timer + deltaTime if params.timer > 0.5 then params.timer = params.timer - 0.5 local id = entity:getId() harvest.spawnEnergySpark(id) end end hook.add("SUPERSOLARPLANT_Update", runSuperSolarPlant)