Skip to content
Permalink
Browse files

Add roost as a starting point for chickens

Add proper tex2 and normal map for chickens
  • Loading branch information...
ForbodingAngel committed May 27, 2019
1 parent 3c36896 commit 1ee2faab4e9ffc4980880b876b2e5da2da16acb6
@@ -159,7 +159,7 @@ function UnitDef_Post(name, uDef)
end

--Override groundplate used
if uDef.usegrounddecal == true then
if uDef.usegrounddecal == true and uDef.customparams and uDef.customparams.customgrounddecal ~= true then
uDef.buildinggrounddecaltype = "groundplate.dds"
end

@@ -56,7 +56,9 @@ Shared.buildListeCommanderFactory = {
}

Shared.buildListChicken = {
[[croost]]
[[croost]],
[[chicken1]],
[[chicken2]],
}

local turrets = {
Binary file not shown.
Binary file not shown.
@@ -1,33 +1,49 @@
base = piece('base')
base, emit, arm, launcher = piece('base', 'emit', 'arm', 'launcher')
local SIG_AIM = {}

-- state variables
isMoving = "isMoving"
terrainType = "terrainType"

function script.Create()
StartThread(common.SmokeUnit, {base, turret, barrel1})
StartThread(common.SmokeUnit, {base})
StartThread(BuildFX)
building = false
Move(base, y_axis, -1, 50)
end

common = include("headers/common_includes_lus.lua")
common = include("headers/common_includes_lus.lua")

local nanoPoints = {}
function BuildFX()
while(building == true) do
EmitSfx (emit, 1024)
Sleep(550)
end
end

function RestoreAfterDelay()
if building == false then
Sleep(2000)
Turn(emit, y_axis, 0, 5)
end
end

nanoPoints[i] = piece("base")
local nanoPoints = piece("emit")

Spring.SetUnitNanoPieces(unitID, nanoPoints)
Spring.SetUnitNanoPieces(nanoPoints)

function script.StartBuilding(heading, pitch)
-- TODO: This is where you would add your unpack / point towards animation
Turn(emit, y_axis, heading, 100)
SetUnitValue(COB.INBUILDSTANCE, true)
building = true
StartThread(BuildFX)
end
function script.StopBuilding()
-- TODO: This is where you would add your pack-up animation
SetUnitValue(COB.INBUILDSTANCE, false)
building = false
StartThread(RestoreAfterDelay)
end

function script.Killed()
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,106 @@
unitDef = {

activateWhenBuilt = true,
acceleration = 1,
brakeRate = 0.24,
buildAngle = 2048,
buildCostEnergy = 0,
buildCostMetal = buildCostMetal,
buildingMask = 0,
buildDistance = 1500,
builder = true,
buildTime = 5,
buildPic = "chicken_unitpics/roost.png",
capturable = false,
CanAttack = false,
CanAssist = true,
canBeAssisted = true,
CanCapture = false,
CanRepair = true,
canRestore = false,
canGuard = true,
canMove = true,
canPatrol = true,
canreclaim = false,
category = "BUILDING NOTAIR ECO",
description = [[Generates Metal from Resource Nodes]],
energyStorage = 0,
energyUse = energyUse,
explodeAs = "largeBuildingExplosionGenericRed",
makesMetal = 0,
footprintX = 2,
footprintZ = 2,
iconType = "eco",
idleAutoHeal = .5,
idleTime = 2200,
maxDamage = 1000,
maxSlope = 90,
maxVelocity = 0.001,
maxReverseVelocity = 0.001,
maxWaterDepth = 5000,
metalStorage = 0,
metalMake = 0,
name = humanName,
objectName = objectName,
movementClass = "HOVERHBOT4",
pushResistant = true,
script = script,
onoffable = false,
radarDistance = 0,
repairable = false,
selfDestructAs = "largeBuildingExplosionGenericRed",
selfDestructCountdown = 15,
side = "CORE",
sightDistance = 200,
smoothAnim = true,
unitName = unitName,
workerTime = 1,
capturespeed = 0.25,
TerraformSpeed = 2147000,
ReclaimSpeed = 0,
-- 0.03125 = 1 hp per second
repairspeed = 0.5,
yardMap = "yyyyyyyyy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yyyyyyyyy",
sfxtypes = {
pieceExplosionGenerators = {
"deathceg3",
"deathceg4",
},

explosiongenerators = {
"custom:blacksmoke",
--primaryCEG,
--"custom:skyhatelaser",
},
},
buildoptions = Shared.buildListChicken,
sounds = {
underattack = "other/unitsunderattack1",
select = {
"other/gdmex",
},
},
weapons = {
},
customParams = {
--RequireTech = tech,
unittype = "building",
metal_extractor = metalMultiplier,
iseco = 1,
needed_cover = 3,
death_sounds = "generic",
armortype = armortype,
noenergycost = true,
--normaltex = "unittextures/lego2skin_explorernormal.dds",
--buckettex = "unittextures/lego2skin_explorerbucket.dds",
factionname = "chickens",
--corpse = "energycore",
helptext = [[]],
customgrounddecal = true,
},
useGroundDecal = true,
BuildingGroundDecalType = "chickengroundplate.dds",
BuildingGroundDecalSizeX = 18,
BuildingGroundDecalSizeY = 18,
BuildingGroundDecalDecaySpeed = 0.9,
}
@@ -150,6 +150,7 @@ return {
},
customparams = {
unittype = "mobile",
normaltex = "unittextures/greenchicken_normals.dds",
},
},
}
@@ -81,7 +81,7 @@ return {
weaponvelocity = 2000,
wobble = 0,
damage = {
default = 6000,
default = 0,
},
},
},
@@ -1,75 +1,28 @@
-- UNITDEF -- CROOST --
--------------------------------------------------------------------------------

local unitName = "croost"
unitName = [[croost]]

--------------------------------------------------------------------------------

local unitDef = {
acceleration = 0,
activatewhenbuilt = true,
-- autoheal = 1.8,
bmcode = "0",
brakerate = 0,
buildcostenergy = 1,
buildcostmetal = 500,
builddistance = 500,
builder = true,
buildpic = "chicken_unitpics/roost.png",
buildtime = 1,
category = "BIO BUILDING",
collisionvolumeoffsets = "0 0 0",
collisionvolumescales = "56 11 56",
collisionvolumetype = "box",
description = "Spawns Chicken",
explodeas = "ROOST_DEATH",
footprintx = 2,
footprintz = 2,
icontype = "energy",
-- idleautoheal = 10,
idletime = 90,
isairbase = true,
levelground = false,
mass = 165.75,
maxdamage = 1800,
maxvelocity = 0,
name = "Roost",
noautofire = false,
objectname = "ChickenDefenseModels/roost.s3o",
script = "chickens/croost.lua",
radardistance = 900,
seismicsignature = 4,
selfdestructas = "ROOST_DEATH",
side = "ARM",
sightdistance = 450,
smoothanim = true,
tedclass = "ENERGY",
turnrate = 0,
unitname = "roost",
upright = false,
waterline = 0,
workertime = 0.25,
yardmap = "ooooooooo",
metalMultiplier = 1

buildoptions = Shared.buildListChicken,

sfxtypes = {
explosiongenerators = {
[1] = "custom:dirt",
},
},
customparams = {
unittype = "building",
--metal_extractor = 1,
--area_mex_def = "croost",
armortype = "building",
},
useGroundDecal = true,
BuildingGroundDecalType = "factorygroundplate.dds",
BuildingGroundDecalSizeX = 9,
BuildingGroundDecalSizeY = 9,
BuildingGroundDecalDecaySpeed = 0.9,
}
buildCostMetal = 50
energyUse = 0

primaryCEG = "custom:fusionreactionnuclear-1color"

humanName = [[Chicken Roost]]

objectName = [[ChickenDefenseModels/roost.s3o]]
script = [[chickens/croost_lus.lua]]

tech = [[tech0]]
armortype = [[building]]

VFS.Include("units-configs-basedefs/basedefs/chickens/croost_basedef.lua")

unitDef.weaponDefs = weaponDefs
--------------------------------------------------------------------------------

return lowerkeys({ [unitName] = unitDef })

0 comments on commit 1ee2faa

Please sign in to comment.
You can’t perform that action at this time.