But I tried to make a vehicle factory using the examplegame as a base for it, and it works because it produces the units the examplegame has. The problem is that it does not work with my custom vehicles, no icon appears to produce my tank, and I don't know what is wrong with it. Looks like the factory is not detecting the tank file or something similar. Here the scripts:
Factory unitDef:
Code: Select all
local unitName = "simplefactory"
local unitDef =
{
-- Internal settings
Category = "LAND",
ObjectName = "factory.s3o",
TEDClass = "PLANT",
script = "simplefactory.lua",
buildPic = "placeholder.png",
-- Unit limitations and properties
Description = "a simple factory that builds mobile units",
MaxDamage = 1500,
Name = "Simple Factory",
RadarDistance = 0,
SightDistance = 400,
Upright = 1,
levelground = 1,
--cost
buildCostMetal = 200,
buildCostEnergy = 0,
buildTime = 25,
--economy
EnergyStorage = 0,
EnergyUse = 0,
MetalStorage = 0,
EnergyMake = 0,
MakesMetal = 0,
MetalMake = 0,
-- Pathfinding and related
FootprintX = 5,
FootprintZ = 5,
MaxSlope = 10,
YardMap ="ooooo occco occco occco occco",
-- Building
Builder = true,
Reclaimable = false,
ShowNanoSpray = true,
CanBeAssisted = false,
workerTime = 1,
buildoptions =
{
"simplehover",
"Tank",
"simpleattackvehicle",
"attackvehicledoublebarrel",
"hovereffects",
"simplewalker",
"buildervehicle",
"helicopter",
"attackvehiclerocket",
"attackvehiclemultimissile",
},
}
return lowerkeys({ [unitName] = unitDef })
I can build every vehicle except the Tank. And I don't know why...
Tank unitDef:
Code: Select all
local unitName = "Tank"
local unitDef = {
name = "Tank",
Description = "MBT",
objectName = "Tank.s3o",
script = "Tank.lua",
BuildPic = "placeholder.png",
--cost
buildCostMetal = 100,
buildCostEnergy = 0,
buildTime = 5,
--Health
maxDamage = 500,
idleAutoHeal = 0,
--Movement
Acceleration = 0.2,
BrakeRate = 0.3,
FootprintX = 2,
FootprintZ = 2,
MaxSlope = 15,
MaxVelocity = 5.0,
MaxWaterDepth = 20,
MovementClass = "Default2x2",
TurnRate = 900,
sightDistance = 500,
Builder = false,
CanAttack = true,
CanGuard = true,
CanMove = true,
CanPatrol = true,
CanStop = true,
LeaveTracks = false,
Category = [[LAND]],
weapons = {
[1]={name = "cannon",
onlyTargetCategory = [[LAND]],
},
},
}
return lowerkeys({ [unitName] = unitDef })
Code: Select all
local unitName = "simpleattackvehicle"
local unitDef = {
name = "Boomer",
Description = "a simple, mobile attack unit. shoots stuff.",
objectName = "simpleattackvehicle.s3o",
script = "simpleattackvehicle.lua",
buildPic = "placeholder.png",
--cost
buildCostMetal = 100,
buildCostEnergy = 0,
buildTime = 5,
--Health
maxDamage = 300,
idleAutoHeal = 0,
--Movement
Acceleration = 0.2,
BrakeRate = 0.3,
FootprintX = 2,
FootprintZ = 2,
MaxSlope = 15,
MaxVelocity = 5.0,
MaxWaterDepth = 20,
MovementClass = "Default2x2",
TurnRate = 900,
sightDistance = 500,
Builder = false,
CanAttack = true,
CanGuard = true,
CanMove = true,
CanPatrol = true,
CanStop = true,
LeaveTracks = false,
Category = [[LAND]],
weapons = {
[1]={name = "MachineGun",
onlyTargetCategory = [[LAND]],
},
},
}
return lowerkeys({ [unitName] = unitDef })
Another thing I have tried is changing the objectName = "simpleattackvehicle.s3o", of the vehicle unitDef that can be produced, for objectName = "Tank.s3o", and the model it loads is my tank, but obviously the attributes are of the other vehicle. and when I try to change other things, the same problem appears again.
So what could be wrong with it? The name? I don't see why 1 works, and the other not.
By the way if you want to know about the game:
http://www.moddb.com/games/project-supremacy