Page 1 of 1
Unit doesent built
Posted: 27 May 2011, 12:43
by PicassoCT
Unit building another unit starts the building process, gets stuck 0% never to get anywhere.
I had nocost active. The sentry has buildvalues
Code: Select all
CanAttack = false,
CanGuard = true,
CanMove = true,
CanPatrol = true,
CanStop = true,
LeaveTracks = false,
--building
Builder = true,
ShowNanoSpray = true,
CanBeAssisted = true,
workerTime = 1,
buildDistance = 400,
terraformSpeed = 9001,
buildoptions =
{
"sentry",
},
Re: Unit doesent built
Posted: 27 May 2011, 16:20
by PicassoCT
16 views and no answer- i wonder how those units in badsd multiply? cellfcopying? sex? cheating and miracles? Come on.. help old pic, and he will stay out of your topics for one day - i promise.
Guess revenge is sweet? Silence tastes like sugar suddenly??
Re: Unit doesent built
Posted: 27 May 2011, 17:11
by momfreeek
whats the green thing? I don't think it has a nanolathe on it. maybe u need a gooseberry bush?
Re: Unit doesent built
Posted: 27 May 2011, 17:33
by knorke
I was going to say missing/lowterraformSpeed but you have that.
Post whole unitdef of both units and script of builder.
Maybe metalcost and energycost is needed for building too? Not sure if that matters.
Do you have resources? /nocost sets cost to 1m not to 0.
can you resize your balls please, its huge like xbox and you know many people are posting from their ipad...
Re: Unit doesent built
Posted: 27 May 2011, 17:42
by PicassoCT
dont have ressources yet.. that could be it.. if nocost doesent give them out for free...
Code: Select all
local unitName = "sentrynell"
local unitDef = {
name = "Sentrynell",
Description = "Heavy Anti Air Defense Unit, able do deploy Sentrys",
objectName = "sentrynell.s3o",
script = "sentrynell.lua",
buildPic = "placeholder.png",
--cost
buildCostMetal = 100,
buildCostEnergy = 12,
buildTime = 5,
--Health
maxDamage = 150,
idleAutoHeal = 0,
--Movement
Acceleration = 0.25,
BrakeRate = 0.3,
FootprintX = 5,
FootprintZ = 5,
MaxSlope = 20,
MaxVelocity = 3.0,
MaxWaterDepth = 20,
MovementClass = "Default2x2",
TurnRate = 500,
sightDistance = 500,
CanAttack = true,
CanGuard = true,
CanMove = true,
CanPatrol = true,
CanStop = true,
LeaveTracks = true,
Builder = true,
ShowNanoSpray = true,
CanBeAssisted = true,
CanReclaim=true,
workerTime = 100,
buildDistance = 400,
terraformSpeed = 9001,
buildoptions =
{
"sentry",
},
Category = [[LAND]],
weapons = {
[1]={name = "MachineGun",
onlyTargetCategory = [[LAND]],
},
},
}
return lowerkeys({ [unitName] = unitDef })
The Script itself is your buildervehicel stripped down to the skelleton (removing everything moving)
I will not pretend that i understand completely what im doing. So this (s/c/h/w)ould be valid code... dont hate me knorke, i know this was supossed to be nubproof
Code: Select all
function script.Create()
end
function script.Killed()
end
--------BUILDING---------
function script.StopBuilding()
SetUnitValue(COB.INBUILDSTANCE, 0)
end
function script.StartBuilding(heading, pitch)
SetUnitValue(COB.INBUILDSTANCE, 1)
end
function script.QueryNanoPiece()
return nano
end
Re: Unit doesent built
Posted: 27 May 2011, 17:51
by knorke
Code: Select all
function script.QueryNanoPiece()
return nano
end
That returns where nano particles are created from.
Since your script never defines the "nano" piece, you would also find a message in your infolog "blabla return value of QueryNanoPiece is nil" or similiar.
So on top of script do
local nano = piece "nano"
or
local nano = piece "constructionArm"
or whatever piece you want nano particles to appear from.
dont have ressources yet.. that could be it.. if nocost doesent give them out for free...
yea nocost is a lie.
But the game_spawn.lua from the tutorialgame should give players something like 100k metal / 100k energy.
Re: Unit doesent built
Posted: 27 May 2011, 18:58
by PicassoCT
It works, it works.. great moments of spring...
Also like to use the occassion to thank the devs and all those hard working people whos awesomness is taken for granted. Actually just sat there watching the grass waving in the wind. Would make excellent posters.
