FBI Unitinfo Tags - Page 2

FBI Unitinfo Tags

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

imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: FBI Unitinfo Tags

Post by imbaczek »

lua tables have similar notation to JSON; you could try using a parser for that (which there are over 9000) and nobody will complain if your program won't be able to read fancy unitdef scripts. if you added special delimiting comments like

Code: Select all

-- LUADEF EDITOR START
-- LUADEF EDITOR END
it might work quite well, actually.
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Thank you, I also feel it would be all in good coding practice to also include things such as script comments. I also think that would be a good option to be able to turn on and off so that users can compress the unit folder size when needed to "trim the fat" on the overhead of processing and mod size.
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Ok, I think I am on to something now. In pondering how to make a truly universal Unit editor for spring I knew I would have to have the ability to import custom tags for moders. So reason led me to decide I could just make all tags importable via a config file with entries like├óÔé¼┬ª

Code: Select all

Spring Unit Editor TagList
nitDef.builder; CheckBox; True
nitDef.cruseAlt; Number; 100
This would give the user the ability to create a tag list with default values that they can use. Adding the AutoCalc feature will be a bit trickier but I think I have that figured out as well.
For the interface I am looking at something like the attatched screenshot. This will allow for entire Unit directories to be edited at once via macros or simply viewed for reference. Plus I like this layout more anyway. :-)

Of course more will be added to the UI but the concept of the unit file diplay is what I am focusing on for now.

I will keep this forum up to date with progress. :-)
Attachments
Untitled.jpg
(22.71 KiB) Downloaded 21 times
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: FBI Unitinfo Tags

Post by imbaczek »

use the FBI format for storing tag info, why bother with _another_ parser, no matter how simple it is?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: FBI Unitinfo Tags

Post by Pxtl »

imbaczek wrote:use the FBI format for storing tag info, why bother with _another_ parser, no matter how simple it is?
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.
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Do to the fact AutoCalc formulas simular to excel will be impliminted into the config as well. Along with Upper and lower limits of values.
I will designe a basic config to get the user started but once he/she changes it to fit their mod project it should be VERY easy to add units to a mod and then save the config file in the sdz for later use in revisions. :)
I had the same thought but there will be more info needed in the config file I just need to concive a way to better format it in an easy to access and use way.

thank you for the input though. :)
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

The plan is to make error checking and automation as possible and as simple as I can. and this is why the extra info must be able to be added.
Last edited by Ash on 06 Jan 2009, 22:23, edited 2 times in total.
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Just to check my formatting, how does this look? I pasted in the weapons and build sectionsand aded the last part. I know the unit does not match up on weapons and build options. I just need to check my formatting. I think it is correct.
Thank you.

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 })

--------------------------------------------------------------------------------
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: FBI Unitinfo Tags

Post by trepan »

unitname = "gmsnipercustom",

should probably be:

unitName = unitName,


alternatively, after the table definition:

unitDef.unitName = unitName

or

unitDef['unitName'] = unitName
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Perhaps like this trepan?

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 })

--------------------------------------------------------------------------------
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

I know there is a GOOD chance I am wrong but looking at the script and the changes you sugested, I think that would be the same. As a matter of fact, with unitname listed in the unitDef section I think it was only at the top for reference. But as I said I am new and may not know enough to understand lua yet seeing that I have never encountered it before. It seems to store the data much like a windows reg system.

I left out the "return lowerkeys" part because there are none.

So am I understanding this stuff or am I still off a little?
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Ok well I have been fighting with a way to make a compiled application accept custom properties that will allow for rules such as upper and lower limits, default values, type setting like bool, int, and string along with descriptions and other needed functionality. It has been a true learning experience but I have found a way and have a UI designed. The next phase is to intergrade a config file reader and then a function to import fbi and lua files. Simple stuff just a lot of typing.
I will try to post a screen shot sometime this week of the application interface and with luck and enough spare time I will have the test version this weekend around 1-17-2009.
:-)
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Progress update: 1-13-2009

Progress is comming along well and still looking at having it complete by the projected date.

Here is a preview of the application IU for your viewing plesures :mrgreen:
Preview.JPG
(36.45 KiB) Downloaded 36 times
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Sorry to report a delay to any concerned, my PC craped on me so I have to work out some Issues before I continue with the project. Worse case I have Monday off and I will report progress then if the project is not complete by then.
PS: If you buy a Tara drive, don├óÔé¼Ôäót use it as the sole backup for your info. :oops: Scans and recovery WILL take forever.
User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

OK i seem to be back on track. Recovered my data and back to working on the project. I will not likely get to work on it much during the week but i feel it will be done by the end of the weekend 1-25-2009.

I have made some changes to the IU and the config file system. XML is too heavy as far as needs to use for this. I like it but the config files are huge using it. So it├óÔé¼Ôäós back to "csv" like config sheet.

The app will include a FBI import option and custom scripting options similar to how excel uses scripts. The scripting is vbscript. I am considering adding javascript support as well but basic is as it sounds "Basic" so users can learn it easily.

Here are some screen shots of the app and the property entry window.
Attachments
Add Property Window.
Add Property Window.
ScreenShot2.jpg (32.99 KiB) Viewed 1577 times
ScreenShot1.jpg
The New UI
(52.7 KiB) Downloaded 5 times
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: FBI Unitinfo Tags

Post by SpliFF »

Firstly, thanks for your work on this. I think poorly documented *Def stuff is one of the engines major weaknesses.

Secondly, my rant appears to apply to this tool.

Thirdly, here are some heavily commented unitDefs from my mod you may find useful. The medium tank is a transport chassis and the medium cannon is a turret that rides on it:

Medium Tank:

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 })
Medium Cannon:

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 })

User avatar
Ash
Posts: 22
Joined: 09 Sep 2008, 00:05

Re: FBI Unitinfo Tags

Post by Ash »

Thank you SpliFF, Sorry I droped off radar for a short bit. I had some collage work to catch up on and some other projects. I have not quit this one, just had to put it on hold. Your post looks as if it will help greatly though, Thank you VERY much. :-)
User avatar
Alchemist
Posts: 81
Joined: 21 Oct 2005, 23:46

Re: FBI Unitinfo Tags

Post by Alchemist »

smoth wrote:bear in mind that some of us are using lua as an fbi format.
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_O
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: FBI Unitinfo Tags

Post by smoth »

it still goes in /units/ alchemist. it reads just like the old fbi file
Post Reply

Return to “Game Development”