I have a tesla fence up and running that could be changed into a laser fence with a little work, well almost, it's kinda random, in the way that a conscript may be able to get through or may not, it also switches between every other fence post in range, no matter what direction from the post it is. It replaces the Tesla Coil at the moment because it was fastest, as the tesla coil is already set up to use the overpowerable code.
Code is as follows, there is a comment mark after each change, some will have coments on the coding, I'm assuming you know enough about modding and the overpowerable code to understand this:
Code:
[TESLA]
UIName=Name:TESLA
Name=Soviet Tesla Coil
Image=NATSLA
BuildCat=Combat
Prerequisite=POWER,NACNST ; so I could test it out earlier
Strength=600
Armor=steel
TechLevel=5
Adjacent=2
Sight=8
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
AIBasePlanningSide=1
Cost=100 ; faster to build
Points=30
Power=0
Crewed=no
Capturable=false
TypeImmune=yes ; so they won't blow each other up
Overpowerable=true
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
Primary=CoilBolt
Secondary=OPCoilBolt
Turret=no
TurretAnimZAdjust=-50
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
MaxDebris=15
MinDebris=5
ThreatPosed=40 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,SmallGreySSys,BigGreySmokeSys
DamageSmokeOffset=96, 64, 112
IsBaseDefense=yes
BaseNormal=no
Powered=yes
ImmuneToPsionics=no
AttackFriendlies=yes ; copied from the modified coilbolt
AntiInfantryValue=25
AntiArmorValue=10 ; because they aren't as powerful against tanks
AntiAirValue=0
[CoilBolt]
Damage=0 ; left this to 0 because of ambient damage
AmbientDamage=20000 ; due to verses must be this high
ROF=5 ; to get the continuous fire effect
Range=7
Speed=100
Warhead=ElectricAssault ; quick change to avoid new warhead creation
Projectile=Invisible
IsElectricBolt=true
IsRailgun=true ;
AttachedParticleSystem=LargeRailgunSys ; needs a railgun particle system to be able to utilise the AmbientDamage system as intended
[OPCoilBolt] ; copied from the modified coilbolt
Damage=0
AmbientDamage=20000
ROF=5
Range=7
Speed=100
Warhead=ElectricAssault
Projectile=Invisible
IsElectricBolt=true
IsRailgun=true
AttachedParticleSystem=LargeRailgunSys
[ElectricAssault]
ElectricAssault=yes
Verses=1%,1%,1%,1%,1%,1%,3%,3%,3%,1%,1% ; all non-building values are at 1% to avoid be passive acquired while still being damaged
InfDeath=5
[LargeRailgunSys]
HoldsWhat=SmallRailgunPart ; LargeRailgunPart won't work at all
BehavesLike=Railgun
SpiralRadius=10 ; to imitate the effect that it is the actual tesla effect doing damage
ParticlesPerCoord=.01 ;
SpiralDeltaPerCoord=.005 ;
MovementPerturbationCoefficient=.05 ;
PositionPerturbationCoefficient=5 ;
VelocityPerturbationCoefficient=.1 ; reduce particles on screen as they are hidden anyway
Laser=yes
LaserColor=200,0,0 ; no reason for this change, personal preference
[SmallRailgunPart]
BehavesLike=Railgun
MaxEC=1 ; so that it doesn't stop the coilbolt from firing again when it's ready to
ColorList=(200,200,200),(150,150,150)
ColorSpeed=.03
Velocity=.4
changes probably would make it better, but this is a working version, hope you like it.
Additional art code
Code:
[NATSLA] ; remove the reference to the special anim charging stuff
Cameo=TSLAICON
Image=NATSLA
Remapable=no
Foundation=1x1
Height=5
Buildup=NATSLAMK
DemandLoadBuildup=true
FreeBuildup=true
PrimaryFireFLH=50,0,50 ;
SecondaryFireFLH=50,0,50 ; makes the origin of the bolt closer to ground, creating a better looking effect
NewTheater=yes
ActiveAnim=NATSLA_A
ActiveAnimDamaged=NATSLA_AD
ActiveAnimZAdjust=-30
ActiveAnimPowered=no ; SJM: This means anim goes away when underpowered
ActiveAnimPoweredLight=yes ; SJM: This means anim goes away when underpowered
CanBeHidden=False
OccupyHeight=4
DamageFireOffset0=0,14