Code: Select all
-- LUADEF EDITOR START
-- LUADEF EDITOR END
Moderator: Moderators
Code: Select all
-- LUADEF EDITOR START
-- LUADEF EDITOR END
Code: Select all
Spring Unit Editor TagList
nitDef.builder; CheckBox; True
nitDef.cruseAlt; Number; 100
At the very least use one you've got library support for already. I use XML for all my tools, simply because I know how to quickly serialize my objects from C# into XML and vice versa using the XmlSerializer library.imbaczek wrote:use the FBI format for storing tag info, why bother with _another_ parser, no matter how simple it is?
Code: Select all
-- UNITDEF -- GMSNIPERCUSTOM --
--------------------------------------------------------------------------------
local unitName = "gmsnipercustom"
--------------------------------------------------------------------------------
local unitDef = {
acceleration = 1,
bmcode = "1",
brakeRate = 10,
buildCostEnergy = 0,
buildCostMetal = 0,
builder = false,
buildTime = 20,
canAttack = true,
canGuard = true,
canMove = true,
canPatrol = true,
canstop = "1",
category = "ARM NOTAIR",
corpse = "sniperII_dead",
defaultmissiontype = "standby",
description = "long or short range mech",
energyMake = 5,
explodeAs = "MEDMECHPOP",
firestandorders = "1",
footprintX = 2,
footprintZ = 2,
iconType = "fed",
idleAutoHeal = 0,
maneuverleashlength = "50",
mass = 2000,
maxDamage = 3500,
maxSlope = 37.50,
maxVelocity = 2,
maxWaterDepth = 5,
minCloakDistance = 70.627418518066,
minCollisionSpeed = 15,
mobilestandorders = "1",
movementClass = "POWERED",
name = "GM Sniper custom",
objectName = "gmsnipercustom.s3o",
power = 45,
pushResistant = true,
radarDistance = 1883.716916400000,
reclaimable = false,
scale = "1.5",
selfDestructAs = "MEDMECHPOP",
shootme = "1",
side = "renpou",
sightDistance = 900.00,
smoothAnim = true,
standingfireorder = "2",
standingmoveorder = "1",
steeringmode = "2",
TEDClass = "KBOT",
threed = "1",
transportByEnemy = false,
turnRate = 1000,
turnInPlace = 0,
unitname = "gmsnipercustom",
unitnumber = "413",
upright = true,
version = "1",
zbuffer = "1",
customparams = {
costrefined = "200",
costexotic = "70",
},
sfxtypes = {
explosiongenerators = {
"custom:kampfertail",
},
},
sounds = {
canceldestruct = "cancel2",
underattack = "fedwarning1",
arrived = {
"feddyok1",
},
cant = {
"cantdo4",
},
count = {
"count5",
"count4",
"count3",
"count2",
"count1",
"count0",
},
ok = {
"mechstep1",
},
select = {
"gundamstart1",
},
},
weapons = {
[1] = {
badTargetCategory = "AIR",
mainDir = "0 0 1",
maxAngleDif = 180,
name = "sniperbeam",
},
},
buildoptions = {
"litegm",
"rgm79",
"rgm79rl",
"rgmsniper",
"rx79rl",
"rx79zook",
"rx79plus",
"rx79beam",
"ez8",
"powered",
"poweredzook",
"gmsnipercustom",
"sniperii",
"aquagm",
"gmcannon",
"guncannonii",
},
}
--------------------------------------------------------------------------------
local weaponDef = {
areaOfEffect = 64,
ballistic = true,
explosionGenerator = "custom:RED_EXPLOSION",
filename = "weapons/explosions.tdf",
id = 209,
impulseFactor = 0,
name = "Large building",
range = 480,
reloadtime = 3.6,
renderType = 4,
shakeduration = ".3",
shakemagnitude = "8",
soundHit = "xplolrg4",
soundStart = "largegun",
turret = true,
weaponVelocity = 250,
damage = {
default = 0,
vtol = "20",
},
}
unitDef.weaponDef = weaponDef
return lowerkeys({ ["big_boom"] = weaponDef })
--------------------------------------------------------------------------------
local featureDefs = {
rubble = {
blocking = false,
category = "arm_corpses",
damage = 300,
description = "Wreckage",
footprintX = 2,
footprintZ = 2,
height = "5",
hitdensity = "50",
metal = 10,
object = "rubble",
reclaimable = true,
seqnamereclamate = "tree1reclamate",
world = "All Worlds",
},
sniperII_dead = {
blocking = true,
category = "arm_corpses",
damage = 2800,
description = "Wreckage",
featureDead = "sniperII_heap",
footprintX = 2,
footprintZ = 3,
height = "20",
hitdensity = "30",
metal = 1200,
object = "sniperII_dead",
reclaimable = true,
seqnamereclamate = "tree1reclamate",
world = "All Worlds",
},
sniperII_heap = {
blocking = false,
category = "arm_corpses",
damage = 1800,
description = "Wreckage",
featureDead = "rubble",
footprintX = 3,
footprintZ = 3,
height = "10",
hitdensity = "30",
metal = 500,
object = "sniperII_heap",
reclaimable = true,
seqnamereclamate = "tree1reclamate",
world = "All Worlds",
},
}
unitDef.featureDefs = featureDefs
return lowerkeys({ [unitName] = unitDef })
--------------------------------------------------------------------------------
Code: Select all
-- UNITDEF -- GMSNIPERCUSTOM --
--------------------------------------------------------------------------------
local unitDef = {
acceleration = 1,
bmcode = "1",
brakeRate = 10,
buildCostEnergy = 0,
buildCostMetal = 0,
builder = false,
buildTime = 20,
canAttack = true,
canGuard = true,
canMove = true,
canPatrol = true,
canstop = "1",
category = "ARM NOTAIR",
corpse = "sniperII_dead",
defaultmissiontype = "standby",
description = "long or short range mech",
energyMake = 5,
explodeAs = "MEDMECHPOP",
firestandorders = "1",
footprintX = 2,
footprintZ = 2,
iconType = "fed",
idleAutoHeal = 0,
maneuverleashlength = "50",
mass = 2000,
maxDamage = 3500,
maxSlope = 37.50,
maxVelocity = 2,
maxWaterDepth = 5,
minCloakDistance = 70.627418518066,
minCollisionSpeed = 15,
mobilestandorders = "1",
movementClass = "POWERED",
name = "GM Sniper custom",
objectName = "gmsnipercustom.s3o",
power = 45,
pushResistant = true,
radarDistance = 1883.716916400000,
reclaimable = false,
scale = "1.5",
selfDestructAs = "MEDMECHPOP",
shootme = "1",
side = "renpou",
sightDistance = 900.00,
smoothAnim = true,
standingfireorder = "2",
standingmoveorder = "1",
steeringmode = "2",
TEDClass = "KBOT",
threed = "1",
transportByEnemy = false,
turnRate = 1000,
turnInPlace = 0,
unitname = "gmsnipercustom",
unitnumber = "413",
upright = true,
version = "1",
zbuffer = "1",
customparams = {
costrefined = "200",
costexotic = "70",
},
sfxtypes = {
explosiongenerators = {
"custom:kampfertail",
},
},
sounds = {
canceldestruct = "cancel2",
underattack = "fedwarning1",
arrived = {
"feddyok1",
},
cant = {
"cantdo4",
},
count = {
"count5",
"count4",
"count3",
"count2",
"count1",
"count0",
},
ok = {
"mechstep1",
},
select = {
"gundamstart1",
},
},
weapons = {
[1] = {
badTargetCategory = "AIR",
mainDir = "0 0 1",
maxAngleDif = 180,
name = "sniperbeam",
},
},
buildoptions = {
"litegm",
"rgm79",
"rgm79rl",
"rgmsniper",
"rx79rl",
"rx79zook",
"rx79plus",
"rx79beam",
"ez8",
"powered",
"poweredzook",
"gmsnipercustom",
"sniperii",
"aquagm",
"gmcannon",
"guncannonii",
},
}
--------------------------------------------------------------------------------
local unitName = "gmsnipercustom"
unitDef.unitName = unitName
--------------------------------------------------------------------------------
local weaponDef = {
areaOfEffect = 64,
ballistic = true,
explosionGenerator = "custom:RED_EXPLOSION",
filename = "weapons/explosions.tdf",
id = 209,
impulseFactor = 0,
name = "Large building",
range = 480,
reloadtime = 3.6,
renderType = 4,
shakeduration = ".3",
shakemagnitude = "8",
soundHit = "xplolrg4",
soundStart = "largegun",
turret = true,
weaponVelocity = 250,
damage = {
default = 0,
vtol = "20",
},
}
unitDef.weaponDef = weaponDef
return lowerkeys({ ["big_boom"] = weaponDef })
--------------------------------------------------------------------------------
local featureDefs = {
rubble = {
blocking = false,
category = "arm_corpses",
damage = 300,
description = "Wreckage",
footprintX = 2,
footprintZ = 2,
height = "5",
hitdensity = "50",
metal = 10,
object = "rubble",
reclaimable = true,
seqnamereclamate = "tree1reclamate",
world = "All Worlds",
},
sniperII_dead = {
blocking = true,
category = "arm_corpses",
damage = 2800,
description = "Wreckage",
featureDead = "sniperII_heap",
footprintX = 2,
footprintZ = 3,
height = "20",
hitdensity = "30",
metal = 1200,
object = "sniperII_dead",
reclaimable = true,
seqnamereclamate = "tree1reclamate",
world = "All Worlds",
},
sniperII_heap = {
blocking = false,
category = "arm_corpses",
damage = 1800,
description = "Wreckage",
featureDead = "rubble",
footprintX = 3,
footprintZ = 3,
height = "10",
hitdensity = "30",
metal = 500,
object = "sniperII_heap",
reclaimable = true,
seqnamereclamate = "tree1reclamate",
world = "All Worlds",
},
}
unitDef.featureDefs = featureDefs
return lowerkeys({ [unitName] = unitDef })
--------------------------------------------------------------------------------
Code: Select all
-- Unit description file.
unitDef = {
------------------------------------------------------------------------------------
-- DESCRIPTION
------------------------------------------------------------------------------------
-- internal name used in script references (unitDef.name). range: alpha-numeric text with no spaces
unitname = "medium_tank",
-- human readable name displayed in messages (unitDef.humanName). range: any text
name = "Medium Tank",
-- can be used in tooltips. range: any text
description = "Medium Tank Chassis",
-- faction that unit belongs to. range: as defined in gamadata/sidedata or 'ANY'
side = "ANY",
------------------------------------------------------------------------------------
-- ABILITIES and ORDERS
------------------------------------------------------------------------------------
-- accepts attack order. range: bool.
canAttack = true,
-- accepts guard order. range: bool.
canGuard = true,
-- accepts transport load order. range: bool.
canLoad = false,
-- accepts move order. range: bool.
canMove = true,
-- accepts patrol order. range: bool.
canPatrol = true,
-- accepts stop order. range: bool.
canStop = true,
------------------------------------------------------------------------------------
-- MOVEMENT
------------------------------------------------------------------------------------
-- how fast we can pick up speed. range: float.
acceleration = 0.1,
-- unit top speed. range: float
maxVelocity = 3.54,
-- movement type. range: class defined in gamedata/moveinfo.
movementClass = "medium_tank",
-- how fast this unit can slow down. range float.
brakeRate = 0.1,
-- moves on top of water. range: bool.
floater = false,
-- takes up this many grid squares for pathfinding (width)
footprintX = 3,
-- takes up this many grid squares for pathfinding (length)
footprintZ = 3,
-- how far unit can stray from patrol paths and guarded units
maneuverleashlength = "640",
-- units weight. affects how far unit is thrown in explosions
mass = 108,
-- how fast the unit can turn around
turnRate = 461,
-- steepest angle it can drive up
maxslope = 25,
------------------------------------------------------------------------------------
-- TRANSPORT
------------------------------------------------------------------------------------
-- number of transport slots. range: int.
transportCapacity = 1,
-- can transport enemy units. range: bool.
transportEnemy = false,
-- number of transport slots required to transport me. range: int.
transportSize = 3,
-- enemies can pick me up. range: bool.
transportByEnemy = false,
-- units can fire while being transported by this unit. range: bool.
isFirePlatform = true,
-- causes transports to hold units such that their updirs are always aligned.
holdSteady = false,
------------------------------------------------------------------------------------
-- BUILD
------------------------------------------------------------------------------------
-- cost in energy to build the unit
buildCostEnergy = 220,
-- cost in metal to build the unit
buildCostMetal = 220,
-- can unit build
builder = false,
-- filename from unitpics/ to display in build queue
buildPic = "medium_tank.png",
-- time to build (relative to total number and speed of the units building it)
buildTime = 220,
-- ?
workerTime = 0,
------------------------------------------------------------------------------------
-- CATEGORIES
------------------------------------------------------------------------------------
-- class of unit
category = "LAND",
------------------------------------------------------------------------------------
-- INTEL and LOS
------------------------------------------------------------------------------------
-- how easy to spot on radar. size of radar icon?
seismicSignature = 4,
-- how far it can see
sightDistance = 500,
-- how close to another unit it can get while remaining cloaked ?
minCloakDistance = 75,
------------------------------------------------------------------------------------
-- DEFENSE
------------------------------------------------------------------------------------
-- unit health
maxDamage = 1101,
-- speed at which unit recovers health when idle ?
idleAutoHeal = 5,
------------------------------------------------------------------------------------
-- ATTACK
------------------------------------------------------------------------------------
-- if true then unit won't fire without orders. range: bool.
noAutoFire = false,
-- prevents unit trying to attack these unit categories
noChaseCategory = "PLANE SHIP SUB",
------------------------------------------------------------------------------------
-- MISC and UNKNOWN
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
-- SPECIAL EFFECTS
------------------------------------------------------------------------------------
-- draw tread marks/ footprints on ground
leaveTracks = true,
-- for aligning track with model
trackOffset = 6,
-- alpha level of track
trackStrength = 5,
-- distance between tread marks ?
trackStretch = 1,
-- type of track
trackType = "StdTank",
-- width of track
trackWidth = 30,
------------------------------------------------------------------------------------
-- APPEARANCE
------------------------------------------------------------------------------------
-- model in objects3d/
objectName = "medium_ship",
-- featureDef to use when I die. range: defined in featureDefs below (and/or global featuredefs?)
corpse = "dead",
-- Defines explosion type when killed. range: file name in weapons/ (no ext)
explodeAs = "medium_explosion",
-- Defines explosion type when self-destructed. range: file name in weapons/ (no ext)
selfDestructAs = "medium_explosion",
-- icon to display over unit when map is zoomed out. range: image file in icons/ (no ext)
iconType = "medium_tank",
-- scales the model. range: float.
scale = "1.5",
-- smooths out animation frames when moving. May have bugs so use carefully.
smoothAnim = true,
-- describes the wreckage this unit leaves when destroyed (and the debris left by destroyed wreckage)
featureDefs = {
-- Corpse
dead = {
-- display in tooltips
description = "Wreckage - Medium Tank",
-- wreckage stops movement (large units may crush the wreckage though)
blocking = true,
-- corpse or heap. corpses can be repaired by special units
category = "corpses",
-- amount of damage wreckage can take before becoming a lesser corpse (ie, corpse->heap->nothing)
damage = 2202,
-- energy gained by reclaiming
energy = 0,
-- metal gained by reclaiming
metal = 129.6,
-- lesser feature if this is destroyed (ie, corpse->heap->nothing)
featureDead = "DEAD2",
-- size for path blocking (width)
footprintX = 3,
-- size for path blocking (length)
footprintZ = 3,
-- clearance required for units that can drive over things
height = "2",
-- ?
hitdensity = "100",
-- model in objects3d/
object = "medium_ship_dead",
-- reclaim units can reclaim this
reclaimable = true,
-- reclaim time required to fully reclaim this
reclaimTime = 518.4,
-- ?
seqnamereclamate = "TREE1RECLAMATE",
-- ?
world = "All Worlds",
},
-- Debris
dead2 = {
description = "Debris - Medium Tank",
blocking = false,
category = "heaps",
damage = 2202,
energy = 0,
featureDead = "HEAP",
featurereclamate = "SMUDGE01",
footprintX = 3,
footprintZ = 3,
hitdensity = "100",
metal = 129.6,
object = "3X3A",
reclaimable = true,
reclaimTime = 518.4,
seqnamereclamate = "TREE1RECLAMATE",
world = "All Worlds",
},
-- More Debris
heap = {
description = "Debris - Medium Tank",
blocking = false,
category = "heaps",
damage = 2202,
energy = 0,
featurereclamate = "SMUDGE01",
footprintX = 3,
footprintZ = 3,
hitdensity = "100",
metal = 64.8,
object = "3X3A",
reclaimable = true,
reclaimTime = 259.2,
seqnamereclamate = "TREE1RECLAMATE",
world = "All Worlds",
},
},
------------------------------------------------------------------------------------
-- MOD SPECIFIC
------------------------------------------------------------------------------------
-- lua parameters available to scripts (unitDef.customParams)
customParams = {
},
}
return lowerkeys({ medium_tank = unitDef })
Code: Select all
-- Unit description file.
unitDef = {
------------------------------------------------------------------------------------
-- DESCRIPTION
------------------------------------------------------------------------------------
-- internal name used in script references (unitDef.name). range: alpha-numeric text with no spaces
unitname = "medium_cannon",
-- human readable name displayed in messages (unitDef.humanName). range: any text
name = "Medium Cannon",
-- can be used in tooltips. range: any text
description = "Medium Cannon Turret",
-- faction that unit belongs to. range: as defined in gamadata/sidedata or 'ANY'
side = "ANY",
------------------------------------------------------------------------------------
-- ABILITIES and ORDERS
------------------------------------------------------------------------------------
-- accepts attack order. range: bool.
canAttack = true,
-- accepts guard order. range: bool.
canGuard = false,
-- accepts transport load order. range: bool.
canLoad = false,
-- accepts move order. range: bool.
canMove = false,
-- accepts patrol order. range: bool.
canPatrol = false,
-- accepts stop order. range: bool.
canStop = true,
------------------------------------------------------------------------------------
-- MOVEMENT
------------------------------------------------------------------------------------
-- takes up this many grid squares for pathfinding (width)
footprintX = 1,
-- takes up this many grid squares for pathfinding (length)
footprintZ = 1,
-- can be hit
collide = false,
------------------------------------------------------------------------------------
-- TRANSPORT
------------------------------------------------------------------------------------
-- number of transport slots required to transport me. range: int.
transportSize = 2,
-- enemies can pick me up. range: bool.
transportByEnemy = false,
------------------------------------------------------------------------------------
-- BUILD
------------------------------------------------------------------------------------
-- cost in energy to build the unit
buildCostEnergy = 220,
-- cost in metal to build the unit
buildCostMetal = 220,
-- can unit build
builder = false,
-- filename from unitpics/ to display in build queue
buildPic = "medium_cannon.png",
-- time to build (relative to total number and speed of the units building it)
buildTime = 220,
------------------------------------------------------------------------------------
-- CATEGORIES
------------------------------------------------------------------------------------
-- class of unit
category = "MOUNTED TURRET",
------------------------------------------------------------------------------------
-- INTEL and LOS
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
-- DEFENSE
------------------------------------------------------------------------------------
-- unit health
maxDamage = 1000,
-- speed at which unit recovers health when idle ?
idleAutoHeal = 0,
------------------------------------------------------------------------------------
-- ATTACK
------------------------------------------------------------------------------------
-- if true then unit won't fire without orders. range: bool.
noAutoFire = false,
-- prevents unit trying to attack these unit categories
noChaseCategory = "PLANE SHIP",
------------------------------------------------------------------------------------
-- MISC and UNKNOWN
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
-- SPECIAL EFFECTS
------------------------------------------------------------------------------------
-- custom sfx
sfxtypes = {
explosiongenerators = {
"custom:medium_cannon_muzzle",
"custom:medium_cannon_dust",
},
},
------------------------------------------------------------------------------------
-- APPEARANCE
------------------------------------------------------------------------------------
-- model in objects3d/
objectName = "medium_cannon.s3o",
-- featureDef to use when I die. range: defined in featureDefs below (and/or global featuredefs?)
corpse = "dead",
-- Defines explosion type when killed. range: file name in weapons/ (no ext)
explodeAs = "medium_explosion",
-- Defines explosion type when self-destructed. range: file name in weapons/ (no ext)
selfDestructAs = "medium_explosion",
-- icon to display over unit when map is zoomed out. range: image file in icons/ (no ext)
iconType = "medium_tank",
-- smooths out animation frames when moving. May have bugs so use carefully.
smoothAnim = false,
-- describes the wreckage this unit leaves when destroyed (and the debris left by destroyed wreckage)
featureDefs = {
-- Corpse
dead = {
-- display in tooltips
description = "Wreckage - Medium Cannon",
-- wreckage stops movement (large units may crush the wreckage though)
blocking = true,
-- corpse or heap. corpses can be repaired by special units
category = "corpses",
-- amount of damage wreckage can take before becoming a lesser corpse (ie, corpse->heap->nothing)
damage = 2202,
-- energy gained by reclaiming
energy = 0,
-- metal gained by reclaiming
metal = 129.6,
-- lesser feature if this is destroyed (ie, corpse->heap->nothing)
featureDead = "DEAD2",
-- size for path blocking (width)
footprintX = 0,
-- size for path blocking (length)
footprintZ = 0,
-- clearance required for units that can drive over things
height = "1",
-- ?
hitdensity = "100",
-- model in objects3d/
object = "medium_cannon_dead",
-- reclaim units can reclaim this
reclaimable = true,
-- reclaim time required to fully reclaim this
reclaimTime = 518.4,
-- ?
seqnamereclamate = "TREE1RECLAMATE",
-- ?
world = "All Worlds",
},
-- Debris
dead2 = {
description = "Debris - Medium Cannon",
blocking = false,
category = "heaps",
damage = 2202,
energy = 0,
featureDead = "HEAP",
featurereclamate = "SMUDGE01",
footprintX = 3,
footprintZ = 3,
hitdensity = "100",
metal = 129.6,
object = "3X3A",
reclaimable = true,
reclaimTime = 518.4,
seqnamereclamate = "TREE1RECLAMATE",
world = "All Worlds",
},
-- More Debris
heap = {
description = "Debris - Medium Cannon",
blocking = false,
category = "heaps",
damage = 2202,
energy = 0,
featurereclamate = "SMUDGE01",
footprintX = 3,
footprintZ = 3,
hitdensity = "100",
metal = 64.8,
object = "3X3A",
reclaimable = true,
reclaimTime = 259.2,
seqnamereclamate = "TREE1RECLAMATE",
world = "All Worlds",
},
},
------------------------------------------------------------------------------------
-- WEAPONS
------------------------------------------------------------------------------------
weapons = {
{
def = "medium_cannon",
badTargetCategory = "FIXEDWING",
onlyTargetCategory = "FIXEDWING LAND SINK SHIP SWIM FLOAT GUNSHIP HOVER",
},
},
weaponDefs = {
medium_cannon = {
name = "Medium Cannon",
areaOfEffect = 32,
craterBoost = 1,
craterMult = 1,
damage = {
default = 230,
planes = 230,
subs = 11.5,
},
explosionGenerator = "custom:INGEBORG",
impulseBoost = 0,
impulseFactor = 0.4,
interceptedByShieldType = 1,
noSelfDamage = true,
range = 500,
reloadtime = 2,
renderType = 4,
soundStart = "medium_cannon_fire",
soundHit = "medium_cannon_hit",
startsmoke = "1",
turret = true,
weaponType = "Cannon",
weaponVelocity = 230,
},
},
------------------------------------------------------------------------------------
-- MOD SPECIFIC
------------------------------------------------------------------------------------
-- lua parameters available to scripts (unitDef.customParams)
customParams = {
},
}
return lowerkeys({ medium_cannon = unitDef })
So if you define Unitdef with Lua where does the .lua file go and how is it read? is there a thread that explains this in detail? o_Osmoth wrote:bear in mind that some of us are using lua as an fbi format.