Page 1 of 1

Why will my unit not attack??

Posted: 19 Sep 2009, 21:27
by PTSnoop
So far, my cubescout unit can be built, and will drive around, patrol and so on, but has no attack button and will do absolutely nothing to enemy units. What am I doing wrong?

/units/cubesmall.fbi :

Code: Select all

[UNITINFO]

{

//Internal settings

	BuildPic=cubesmall.bmp;

	Category=CUBE UNIT NOTAIR;

	Name=Cube Scout;

	ObjectName=cubesmall.s3o;

	Side=CUBE;

	TEDClass=TANK;

	UnitName=cubesmall;

	

//Unit limitations and properties

	ActivateWhenBuilt=1;

	BuildTime=1000;

	Description=Light Scout;

	MaxDamage=75;

	RadarDistance=0;

	SightDistance=1000;

	SoundCategory=CUBE_TANK;

	Upright=0;

	

//Energy and metal related

	BuildCostEnergy=20;

	BuildCostMetal=20;

	

//Pathfinding and related

	Acceleration=0.15;

	BrakeRate=0.1;

	FootprintX=2;

	FootprintZ=2;

	MaxSlope=10;

	MaxVelocity=4.0;

	MaxWaterDepth=12;

	TurnRate=900;

	

//Abilities

	Builder=0;
	Reclaimable=0;

	CanAttack=1;

	CanGuard=1;

	CanMove=1;

	CanPatrol=1;

	LeaveTracks=0;

	

//Abilities new to Spring

	

//Weapons and related
	Weapon1=scoutlightning;

	ExplodeAs=SMALLUNITEX;

	NoChaseCategory=VTOL;

	SelfDestructAs=SMALLUNITEX;

	SelfDestructCountdown=5;

}


/weapons/scoutlightning.tdf :

Code: Select all

[SCOUTLIGHTNING]

    {

	weaponType="LightingCannon"

	areaOfEffect=16;

	avoidFeature=0;

	avoidFriendly=0;

	canAttackGround=1;

	collideFriendly=0;

	commandFire=1;

	craterBoost=0;

	craterMult=0;

	explosionSpeed=5;

	impulseBoost=0;

	impulseFactor=0;

	noSelfDamage=1;

	range=350;

	reloadtime=1;

	rgbcolor="0.1 0.2 0.5";

	turret=1;

	weaponVelocity=400;

	texture1="lightning";

	damage={
		default=10;
	}

The whole mod's at http://compsoc.dur.ac.uk/~ab/StaticFrictionProblem2.sdz , if any other files could be the problem.

Re: Why will my unit not attack??

Posted: 19 Sep 2009, 22:53
by bobthedinosaur
if you use tdf every line with a value must have a ; at the end or it will mess the whole tdf up and spring will exclude it.

such as :
weaponType="LightingCannon"

should be:
weaponType="LightingCannon";

Re: Why will my unit not attack??

Posted: 20 Sep 2009, 09:00
by KDR_11k
EDIT: Misread that.

Re: Why will my unit not attack??

Posted: 20 Sep 2009, 10:14
by PTSnoop
The semicolon's fixed, but it's not solved the problem.

Re: Why will my unit not attack??

Posted: 20 Sep 2009, 17:04
by Master-Athmos
I'm not 100% sure but it might not recognize the weapon you want to apply because you use uppercase letters for the weapon's name in the definition but lower case in the unit definition...

You also should look at the infolog.txt in your Spring directory and search for error reports. You usually will get to know at which point something has to be wrong...

Re: Why will my unit not attack??

Posted: 20 Sep 2009, 17:18
by FLOZi
Get rid of the quote marks.

Re: Why will my unit not attack??

Posted: 20 Sep 2009, 18:13
by PTSnoop
Looks like the problem was a combination of not enough semicolons, typing damage= instead of [damage], and those quote marks around LightingCannon. Thanks for the help!

Re: Why will my unit not attack??

Posted: 20 Sep 2009, 18:28
by FLOZi
Yeah, you were mixing up tdf and lua syntax.

Re: Why will my unit not attack??

Posted: 22 Sep 2009, 20:57
by bobthedinosaur
you can always check to see if the weapon is the problem by hitting c and going fps on the mother. if you seed the weapon name the weapon works something else is preventing it, but if you don't see it listed then it did not load probably due to an error in the tdf or lua.