Unit doesent built

Unit doesent built

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Unit doesent built

Post 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",
	},
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Unit doesent built

Post 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.

Image


Guess revenge is sweet? Silence tastes like sugar suddenly??
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Unit doesent built

Post by momfreeek »

whats the green thing? I don't think it has a nanolathe on it. maybe u need a gooseberry bush?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Unit doesent built

Post 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...
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Unit doesent built

Post 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


User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Unit doesent built

Post 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. :shock:
But the game_spawn.lua from the tutorialgame should give players something like 100k metal / 100k energy.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Unit doesent built

Post 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.Image
Attachments
awesomness.jpg
(906.2 KiB) Downloaded 2 times
Post Reply

Return to “Game Development”