Why doesn't my shield work

Why doesn't my shield work

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
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Why doesn't my shield work

Post by SpikedHelmet »

Why doesn't this work????

It used to work, then suddenly it stopped working one day.

The symptoms: According to healthbar widget the shield is "detected" but remains at 0% when a unit is built, and subsequently stops nothing.

Code: Select all

weaponDef = {
	name                    = "Anti-Missile System (AMS)",
	isShield				= true,
	shieldInterceptType		= 32,
	exteriorShield			= 1,
	shieldEnergyUse			= 0,
	shieldPower				= 500,
	shieldPowerRegen		= 100,
	shieldPowerRegenEnergy	= 0,
	shieldRadius			= 300,
	shieldStartingPower		= 500,
	smartShield				= true,
	visibleShield			= false,
	--	shieldAlpha				= 1.0,
	--	shieldGoodColor			= "0.0 1.0 0.0",
	--	shieldBadColor			= "1.0 0.0 0.0",
	damage = {
		default = 10,--1 DPS
	},
}

return lowerkeys({ AMS = weaponDef })
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: Why doesn't my shield work

Post by SpikedHelmet »

It was because I didn't have the weaponType = "Shield", tag, as apparently shields need to be told twice that they are infact shields.
Post Reply

Return to “Game Development”