The anti stacking weapon works fine, but i have found you cannot OCL multiple wall segments because then the enemy will drive through your wall as if it does not exist. You can only OCL one wall segment at a time so that the bounding box is recognised.
The anti-stacking weapon is:
Code:
Weapon WallCoreWeapon
PrimaryDamage = 2000.0
PrimaryDamageRadius = 1.0
AttackRange = 1.0
DamageType = LAND_MINE ;does not affect other structures
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 5
ClipSize = 1
ClipReloadTime = 100000
AutoReloadsClip = No
End
And the way to use it is to have each wall object fire it (make sure all wall objects use WallArmor and not StructureArmor so that LAND_MINE damage can kill them):
Code:
Behavior = FireWeaponUpdate ModuleTag_NoStack
Weapon = WallCoreWeapon ;Prevents stacking of wall objects
End
That way when it is OCLed it will fire the weapon and destroy any previous walls which occupy the same place.
Because of the problem of bounding boxes not working if you OCL more than one object at a time, i suggest you just have 2 OCL upgrades, one that makes 1 wall segment forwards, and one which makes a wall segment backwards, so you can build in a straight line forwards or backwards, one piece at a time.