Why will my unit not attack??

Why will my unit not attack??

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
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

Why will my unit not attack??

Post 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.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Why will my unit not attack??

Post 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";
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Why will my unit not attack??

Post by KDR_11k »

EDIT: Misread that.
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

Re: Why will my unit not attack??

Post by PTSnoop »

The semicolon's fixed, but it's not solved the problem.
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: Why will my unit not attack??

Post 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...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Why will my unit not attack??

Post by FLOZi »

Get rid of the quote marks.
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

Re: Why will my unit not attack??

Post 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!
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Why will my unit not attack??

Post by FLOZi »

Yeah, you were mixing up tdf and lua syntax.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Why will my unit not attack??

Post 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.
Post Reply

Return to “Game Development”