Well, this is my current code for the unit anyway.
Code: Select all
local unitName = "scout"
local unitDef = {
--Internal settings
name = "Bolter Scout",
objectName = "scout.s3o",
BuildPic = "filename.bmp",
Category = "TANK SMALL NOTAIR NOTSUB",
Side = "TANKS",
TEDClass = "TANK",
UnitName = "tank",
script = "tankscript.lua",
--Unit limitations and properties
BuildTime = 100,
Description = "A small and fast unit.",
MaxDamage = 800,
RadarDistance = 0,
SightDistance = 400,
SoundCategory = "TANK",
Upright = 0,
--Energy and metal related
BuildCostEnergy = 100,
BuildCostMetal = 0,
--Pathfinding and related
Acceleration = 0.50,
BrakeRate = 0.51,
FootprintX = 2,
FootprintZ = 2,
MaxSlope = 15,
MaxVelocity = 7.0,
MaxWaterDepth = 20,
MovementClass = "Default2x2",
TurnRate = 900,
--Abilities
Builder = 0,
CanAttack = 1,
CanGuard = 1,
CanMove = 1,
CanPatrol = 1,
CanStop = 1,
LeaveTracks = 0,
Reclaimable = 0,
--Hitbox
-- collisionVolumeOffsets = "0 0 0",
-- collisionVolumeScales = "10 10 10",
-- collisionVolumeTest = 1,
-- collisionVolumeType = "10 10 10",
--Weapons and related
BadTargetCategory = "NOTAIR",
ExplodeAs = "TANKDEATH",
NoChaseCategory = "AIR",
weapons = {
[1]={name = "scoutbolter",
onlyTargetCategory = [[LAND]],
},
},
}
return lowerkeys({ [unitName] = unitDef })
The weapon loads up another script inside of a weapons folder within the directory, which is:
Code: Select all
local weaponName="scoutbolter"
local weaponDef={
name="Bullet",
weaponType=[[MissileLauncher]],
Accuracy=2000,
--Physic/flight path
range=1000,
reloadtime=3,
weaponVelocity=500,
startVelocity=500,
weaponAcceleration=50,
flightTime=2.5,
BurnBlow=0,
FixedLauncher=true,
dance=100,--200
wobble=1000,
tolerance=8000,
tracks=false,
Turnrate=0,
collideFriendly=true,
TrajectoryHeight = 2,
----APPEARANCE
model="projectiles/cubebullet.s3o",
smokeTrail=false,
explosionGenerator="custom:redsmoke",
CegTag="smoketrail",
----TARGETING
turret=false,
CylinderTargetting=false,
avoidFeature=false,
avoidFriendly=false,
----BURST
burst = 1,--8
burstrate = 0.1,
--commandfire=true,
----DAMAGE
damage={
default=150,
heavyarmor=150,
},
areaOfEffect=100,
craterMult=0,
--?FIXME***
lineOfSight=true,
--sound
--soundHit=[[kanoba/SabotHitRemake.ogg]],
--soundStart=[[kanoba/RockLit1Remake.ogg]],
}
return lowerkeys ({[weaponName]=weaponDef})
So I don't really know where to add in the code you gave me.