transport issue

transport issue

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
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

transport issue

Post by thedude »

I want make a transporter which can transport enemy/gaia units.
Here are the fbi/lua files of the two units (intruder=transporter, cube=unit to be transported)
fbi file of intruder:

Code: Select all

[UNITINFO] {

  unitname=intruder;
  name=Intruder;
  description=Amphibious Heavy Assault Transport;
  acceleration=0.33;
  bmcode=1;
  brakeRate=0.165;
  buildAngle=16384;
  buildCostEnergy=1;
  buildCostMetal=1;
  builder=0;
  buildPic=INTRUDER.DDS;
  buildTime=1;
  canGuard=0;
  canload=1;
  canMove=1;
  canPatrol=1;
  canstop=1;
  cantBeTransported=1;
  category=ALL HOVER MOBILE WEAPON NOTSUB NOTSHIP NOTAIR;
  corpse=INTRUDER_DEAD;
  defaultmissiontype=Standby;
  energyMake=2.6;
  energyStorage=0;
  energyUse=2.9;
  explodeAs=BIG_UNITEX;
  firestandorders=1;
  footprintX=4;
  footprintZ=4;
  idleAutoHeal=5;
  idleTime=1800;
  leaveTracks=1;
  maneuverleashlength=640;
  mass=2e+08;
  maxDamage=12500;
  maxVelocity=1.892;
  maxWaterDepth=255;
  metalMake=0;
  metalStorage=0;
  mobilestandorders=1;
  movementClass=TANK;
  noAutoFire=0;
  objectName=INTRUDER;
  releaseHeld=1;
  scale=0.5;
  seismicSignature=0;
  selfDestructAs=BIG_UNIT;
  side=SIDENAME1;
  sightDistance=292;
  smoothAnim=1;
  soundcategory=CORE_TANK;
  standingfireorder=1;
  standingmoveorder=1;
  steeringmode=1;
  TEDClass=TANK;
  trackOffset=-14;
  trackStrength=10;
  trackStretch=1;
  trackType=StdTank;
  trackWidth=42;
  transportCapacity=40;
  transportSize=4;
  turnRate=215.6;
  unloadSpread=4;
  workerTime=0;

  	[customParams]

	{
		canharvest=1;

	}

}



lua file of cube:

Code: Select all

	unitDef = {

	  unitname            = [[cube]],
	  name                = [[resourcecube]],
	  description         = [[resourcecube]],
	  acceleration        = 0,
	  brakeRate           = 0,
	  buildCostEnergy     = 1,
	  buildCostMetal      = 1,
	  builder             = false,
	  buildPic            = [[bassaulttank.png]],
	  buildTime           = 3,
	  canAttack           = false,
	  canGuard            = false,
	  canMove             = true,
	  canPatrol           = false,
	  canstop             = [[1]],
	  category            = [[LAND]],
	  defaultmissiontype  = [[Standby]],
	  explodeAs           = [[SMALL_UNITEX]],
	  footprintX          = 2,
	  footprintZ          = 2,
	  iconType            = [[vehiclescout]],
	  idleAutoHeal        = 5,
	  idleTime            = 1800,
	  leaveTracks         = true,
	  maneuverleashlength = [[640]],
	  mass                = 15,
	  maxDamage           = 800,
	  maxSlope            = 18,
	  maxVelocity         = 0,
	  maxWaterDepth       = 22,
	  minCloakDistance    = 75,
	  movementClass       = [[TANK]],
	  moveState           = 0,
	  noAutoFire          = false,
	  noChaseCategory     = [[TERRAFORM FIXEDWING SATELLITE SUB]],
	  objectName          = [[cube.s3o]],
	  reclaimTime         = 5,
	  reclaimable         = 1,
	  seismicSignature    = 4,
	  selfDestructAs      = [[SMALL_UNITEX]],
	  side                = [[SIDENAME1]],
	  sightDistance       = 550,
	  smoothAnim          = true,
	  steeringmode        = [[1]],
	  TEDClass            = [[Tank]],
	  trackOffset         = -3,
	  trackStrength       = 3,
	  trackStretch        = 1,
	  trackType           = [[StdTank]],
	  trackWidth          = 25,
	  transportByEnemy	  = 1,
	  turninplace         = 0,
	  turnInPlace         = 0,
	  turnRate            = 0,
	  workerTime          = 0,
          script              = [[cube.lua]],

	}

	return lowerkeys({ cube = unitDef })


When I do "/give cube" (create cube with my teamID) and then try to load it, it works. When I do "/give cube 2" (create cube for enemy) and then try to load the unit the transporter does nothing.
(In the first case (my cube) when I try to load the unit the cursor becomes a load-cursor but in the second case (enemy cube) when I move the mouse over the cube the cursor becomes an arrow (like when nothing is selected))
I thought when I want a unit to be transported by enemy I just have to add the "transportByEnemy = 1," tag :?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: transport issue

Post by FLOZi »

Code: Select all

transportByEnemy  = udTable.GetBool("transportByEnemy",  true);
From UnitDef.cpp. So it defaults to true, and to set it you need to use true/false.
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

Re: transport issue

Post by thedude »

Ooops I thought one can use "1" instaed of "true" and "0" instead of "false".
But when I change the "1" to true or remove the whole line from the script the transporter behaves the same way as before :(
Post Reply

Return to “Game Development”