Buuut that, of course, didn't work for me. So here I am.QueryLandingPads ( ) -> { number piece1, number piece2, ... }
Called one time for units with landing pads. Should return a table with pieces which should be used as landing pads. The number of pieces returned also determines the number of pads, so for Lua unit scripts there is no QueryLandingPadCount.
UnitDef:
Code: Select all
unitDef = {
unitname = [[brefuel]],
name = [[Combat Air Base]],
description = [[Produces warplanes and support aircraft.]],
amphibious = false,
activateWhenBuilt = true,
acceleration = 0,
bmcode = [[0]],
brakeRate = 0,
buildCostEnergy = 0,
buildCostMetal = 0,
builder = false,
buildoptions = {
[[bfighter]],
[[bbomber]],
[[brocketplane]],
[[bradarplane]],
},
buildPic = [[bairport.png]],
buildTime = 1,
canMove = false,
canPatrol = true,
canstop = [[1]],
canBeAssisted = false,
category = [[SINK]],
isAirBase = true,
collisionVolumeOffsets = [[0 8 0]],
collisionVolumeScales = [[172 112 188]],
collisionVolumeTest = 1,
collisionVolumeType = [[box]],
corpse = [[DEAD]],
energyMake = 0.15,
energyUse = 0,
explodeAs = [[LARGE_BUILDINGEX]],
footprintX = 11,
footprintZ = 12,
idleAutoHeal = 0,
mass = 275,
maxDamage = 8500,
maxSlope = 15,
maxVelocity = 0,
maxWaterDepth = 0,
metalMake = 0.15,
minCloakDistance = 150,
noAutoFire = false,
objectName = [[bairport.s3o]],
seismicSignature = 4,
selfDestructAs = [[LARGE_BUILDINGEX]],
showNanoSpray = false,
side = [[NKG]],
sightDistance = 273,
smoothAnim = true,
sortbias = [[0]],
TEDClass = [[PLANT]],
turnRate = 0,
workerTime = 1,
yardMap = [[ooccccccooo ooccccccooo ooccccccooo
ccccccccooo ccccccccooo ccccccccooo ccccccccooc ccccccccooc ccccccccooc ooccccccooc ooccccccooc ccccccccooc]],
script = [[brefuel.lua]],
featureDefs = {
DEAD = {
description = [[Wreckage - Combat Air Base]],
blocking = true,
category = [[corpses]],
damage = 8000,
energy = 0,
featureDead = [[DEAD2]],
featurereclamate = [[SMUDGE01]],
footprintX = 7,
footprintZ = 6,
height = [[40]],
hitdensity = [[100]],
metal = 275,
object = [[bgenericwreckage.s3o]],
reclaimable = true,
reclaimTime = 275,
seqnamereclamate = [[TREE1RECLAMATE]],
world = [[All Worlds]],
},
DEAD2 = {
description = [[Debris - Combat Air Base]],
blocking = false,
category = [[heaps]],
damage = 8000,
energy = 0,
featurereclamate = [[SMUDGE01]],
footprintX = 11,
footprintZ = 12,
height = [[4]],
hitdensity = [[100]],
metal = 275,
object = [[b11x12heap.s3o]],
reclaimable = true,
reclaimTime = 275,
seqnamereclamate = [[TREE1RECLAMATE]],
world = [[All Worlds]],
},
},
}
return lowerkeys({ brefuel = unitDef })
Code: Select all
local building = piece "building"
local dish = piece "dish"
local nano = piece "nano"
local pad = piece "pad"
function script.Create(unitID)
end
function script.QueryLandingPads()
return pad
end
function script.Killed(recentDamage, maxHealth)
return 0
end
The final product for this will be an airport/refuel pad. I'm guessing that's no big deal, just combine the two?