Messing around with shields


(ajlsunrise) #41

I’ll take a look tonight.


(GOLIATH Mod) #42

yeah, but I’d only have to change ONE letter in there… =D


(Taiidan Republic Mod) #43

Looks like you have to edit the hod:

http://complex.mastertopforum.com/green-shields-work-better-vt1978.html

EDIT: It looks like it is just:

  • a joint called Root
  • a sphere
  • a material with shader fx


(GOLIATH Mod) #44

Ah, cool. Yeah, I think I can manage that. Thanks!

I think I’ll get the frigates set up with the available shields first though, to make sure it doesn’t mess up multiplayer with all of the functions going in the background.

Hey, I didn’t even know about that other forum. WOAH.


(GOLIATH Mod) #45

Could one of you guys do me a favor?

There are shield frigates in the new version of Goliath that are on all the time and with a larger radius. It seems like the FX for the shield is being displayed for the player’s units, but getting dropped for the shield frigates on all the other teams. I’m not sure if the FX isn’t prioritized correctly or something like that, or if it’s just my computer.

Could somebody check it out to see if they have the same problem?

You don’t have to wait for someone to build them, just pick one of the full starting fleets in the starting unit pull-down and set the other guys to Hiigarans and Taiidan. The shield frigates are in those presets.

Thanks!


(Taiidan Republic Mod) #46

Started a 1v1 on Kharam Wreck with Hiigaran full fleet vs Hiigaran full fleet beefy AI. Both field fx are showing (mine and CPU):


(GOLIATH Mod) #47

Cool, thanks. Can you try it with a big game? Like 8 players?

My computer tends to drop FXs when the game starts getting too big anyway, like explosions or the effects from the dreadnaught shooting. So, maybe the problem is really just specific to my computer.

Has there been a discussion about prioritizing effects? It seems like some of them get dropped and others don’t, but I haven’t seen a setting for it anywhere.


(GOLIATH Mod) #48

I kinda wrote this off because my computer wasn’t drawing the bubbles, and I figure if it doesn’t draw a couple of them at the same time, what is it going to do with 50 of them? But how about Emergency Escape Shielding for carriers and shipyards? It sounds pretty cool and there might be so few of them that it will work. It would be a shame not to use the result of all this testing and collaboration.

I’m adding in armor upgrades to the mod right now to offset the weapons upgrades, but the carriers and shipyard will be getting bupkis. Might play well, if your building stuff gets totally wimpy late in the game after everybody starts upgrading all their stuff.


(Taiidan Republic Mod) #49

ok, now I am having trouble with shields… Been banging my head on this for a few days. Can anyone see what I am doing wrong?

This is my madstate file - basically a copy of hgn_defensefieldfrigate.madstate...
TRP_PLATFORM_FXX_DefenseFieldActivate_OnSet = function(ship)
    -- unset the state, we'll set it when the animation is fully complete
    setState(ship, "DefenseFieldActivate", 0)
    -- if we're not already doing the animation
    if(isAnimRunning(ship, "Open") == 0) then
        startTime = 0
        -- if we're doing the close animation then we want to start the open at
        -- the right place, open and close are the same length
        if(isAnimRunning(ship, "Close") ~= 0) then
            startTime = getAnimLength(ship, "Close") - getTime(ship, "Close")
            stopAnim(ship, "Close")
            endEffect(ship, "Close")
        end
        startAnim(ship, "Open")
        startEffect(ship, "Open")
        setTime(ship,"Open",startTime)
        -- apparently we are supposed to use a 'big number' to mean pause at end, 1000 is apparently 'big' enough
        setPauseTime(ship, "Open", 1000)
    else
        setState(ship, "DefenseFieldActivate", 1)
    end
end

TRP_PLATFORM_FXX_DefenseFieldActivate_OnPause = function(ship)
    -- the open animation has finished, now we can set the state to active
    setState(ship, "DefenseFieldActivate", 1)
    endEffect(ship, "Open")
	print("Starting effect 'On'")
    startEffect(ship, "On")
	print("Effect started")

end

TRP_PLATFORM_FXX_DefenseFieldDeActivate_OnSet = function(ship)
    -- stop the open and work animations, they may be running
    if(isAnimRunning(ship,"Close") == 0) then
        startTime = 0
        if(isAnimRunning(ship, "Open") ~= 0) then
            startTime = getAnimLength(ship, "Open") - getTime(ship, "Open")
            stopAnim(ship, "Open")
            endEffect(ship, "Open")
        end
        endEffect(ship, "On")
        startEffect(ship, "Close")
        startAnim(ship, "Close")
        setTime(ship,"Close",startTime)
        setPauseTime(ship, "Close", 1000)
    end
    setState(ship, "DefenseFieldDeActivate", 1)
end
here is the applicable section of my ship file
addAbility(NewShipType,"ShipHold",1,40,100,"rallypoint","Fighter, Corvette",35,{Fighter="36"},{Corvette="75"});
--
NewShipType.canJoinStrikeGroup=0
addAbility(NewShipType,"ParadeCommand",1);
addAbility(NewShipType,"CanAttack",1,1,0,0,0.35,1,"Fighter, Fighter_hw1, Corvette, Corvette_hw1, Frigate, Utility, Resource,,,,SmallCapitalShip, BigCapitalShip","JustShoot");
addAbility(NewShipType,"FormHyperspaceGateCommand",1,1000,500,0,0);
NewShipType.disableOnRaceChange=0
addAbility(NewShipType,"DefenseFieldAbility",1,0,1200,200,200,0.7,0.6,0,"defensefield_sphere_spray");
addAbility(NewShipType,"DefenseFieldShieldAbility",0,1200,0,0);
LoadModel(NewShipType,1);
StartShipHardPointConfig(NewShipType,"Weapon_LHS","HardpointTurret1","Weapon","Innate","Ship","trp_twinkineticturret","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_RHS","HardpointTurret2","Weapon","Innate","Ship","trp_twinkineticturret","","","","","","","","");
addShield(NewShipType,"EMP",40,20);
AddShipAbility(NewShipType,"DefenseField",1,"ThisShipOnly",0);
Events file bits:
        animation6 =
        {
            name = "Open",
            length = 1,
            loop = 0,
            parent = "",
            minimum = 0,
            maximum = 0,
            markers = {""}
        },
        animation7 =
        {
            name = "Close",
            length = 1,
            loop = 0,
            parent = "",
            minimum = 0,
            maximum = 0,
            markers = {""}
        },
        animation7 =
        {
            name = "On",
            length = 1,
            loop = 1,
            parent = "",
            minimum = 0,
            maximum = 0,
            markers = {""}
        },
        event8 =
        {
            { "anim", "Open" },
            { "animtime", "0" },
            { "marker", "root" },
            { "sound", "SP_ELEMENTS/HGN_DEFENSEFIELDFRIGATE_OPEN" },
        },
        event9 =
        {
            { "anim", "Close" },
            { "animtime", "0" },
            { "marker", "root" },
            { "sound", "SP_ELEMENTS/HGN_DEFENSEFIELDFRIGATE_CLOSE" },
        },
        event10 =
        {
            { "anim", "On" },
            { "animtime", "-1" },
            { "marker", "root" },
            { "sound", "SP_ELEMENTS/HGN_DEFENSEFIELDFRIGATE_ON" },
			{ "fx", "defensefield_sphere_spray" },
			{ "fx_scale", "2900" },
        },

The odd thing is that I have the icon for the defense field. I can click on it and the animation “Open” plays, but no shield Fx displays… Can anyone spot what I am doing wrong?


(GOLIATH Mod) #50

I have a version of the shields that worked on my old computer. I totally forget how this went, but I’ll see if I can find it. I was gonna either do the corvette upgrades or butch platforms next, but I’ll see if I can figure this out again and put emergency escape shields on the carriers next instead.


(GOLIATH Mod) #51

I updated the Goliath Tester mod to the one where the shields work if you want to check them out. Just start as the Hiigarans and the research and ships will be available. I would check your files through, but the weather is nice here, and my time-thief-family is making me go outside. Aww man. haha

For everybody’s reference, here are the files for a hgn_ioncannonfrigate that works:

hgn_ioncannonfrigate.events :

effects =
{
    animations =
    {
        animation1 =
        {
            name = "Fire",
            length = 5,
            loop = 0,
            parent = "",
            minimum = 0,
            maximum = 0,
            markers = {""}
        },
        animation2 =
        {
            name = "Death",
            length = 3,
            loop = 0,
            parent = "",
            minimum = 0,
            maximum = 0,
            markers = {""}
        },
        animation3 =
        {
            name = "Damage",
            length = 1,
            loop = 1,
            parent = "",
            minimum = 0,
            maximum = 0,
            markers = {""}
        },
        animation4 =
        {
            name = "dmg01",
            length = 1,
            loop = 1,
            parent = "Damage",
            minimum = 0.25,
            maximum = 1,
            markers = {""}
        },
        animation5 =
        {
            name = "dmg02",
            length = 1,
            loop = 1,
            parent = "Damage",
            minimum = 0.5,
            maximum = 1,
            markers = {""}
        },
        animation6 =
        {
            name = "dmg03",
            length = 1,
            loop = 1,
            parent = "Damage",
            minimum = 0.75,
            maximum = 1,
            markers = {""}
        },

    animation7 =
    {
        name = "On",
        length = 1,
        loop = 1,
        parent = "",
        minimum = 0,
        maximum = 0,
        markers = {""}
    },


    },
    events =
    {
        event1 =
        {
            { "anim", "Fire" },
            { "animtime", "0" },
            { "marker", "Weapon_Top_Position" },
            { "fx", "ion_beam_charge_combo" },
            { "sound", "WEAPON/FRIGATE/FIRE/WEAPON_FRIGATE_ION_CANNON_BEAM" },
        },
        event2 =
        {
            { "anim", "Fire" },
            { "animtime", "0.1" },
            { "marker", "vent2" },
            { "fx", "ion_cannon_steam_spray" },
            { "sound", "DAMAGE/SMOKE/ION_BEAM_DISCHARGE" },
        },
        event3 =
        {
            { "anim", "Death" },
            { "animtime", "0" },
            { "marker", "marker2" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "sound", "EXPLOSION/SMALL/ETG_EXPLODE_SMALL_PLASMA" },
            { "fx_scale", "1.5" },
        },
        event4 =
        {
            { "anim", "Death" },
            { "animtime", "0.2" },
            { "marker", "marker6" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "fx_scale", "1" },
        },
        event5 =
        {
            { "anim", "Death" },
            { "animtime", "0.1" },
            { "marker", "marker4" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "sound", "EXPLOSION/MEDIUM/ETG_EXPLODE_MEDIUM_PLASMA" },
            { "fx_scale", "1.5" },
        },
        event6 =
        {
            { "anim", "Death" },
            { "animtime", "0.3" },
            { "marker", "marker8" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "fx_scale", "2.5" },
        },
        event7 =
        {
            { "anim", "Death" },
            { "animtime", "0.45" },
            { "marker", "Root" },
            { "fx", "dmg_cloud_main_explosion_combo" },
            { "sound", "EXPLOSION/MEDIUM/ETG_EXPLODE_MEDIUM_PLASMA" },
            { "fx_scale", "7" },
        },
				--smoke
				smoke1 = 
				{ 
						{ "anim", "death", }, 
						{ "animtime", "0", }, 
						{ "marker", "Root", }, 
						{ "fx", "death_generic_cf_instant", },						
						{ "fx_scale", "entity", }, 
				},  
				--chunck				
				chunck1 = 
				{ 
						{ "anim", "death", }, 
						{ "animtime", "0.42", }, 						
						{ "marker", "Root", }, 
						{ "fx", "dmg_capital_explosion_large_hull_flare_cf_noscar_35_final2", },                 
						{ "fx_scale", "0.85", }, 
				},        
				chunck2 = 
				{ 
						{ "anim", "death", }, 
						{ "animtime", "0.43", }, 						
						{ "marker", "Root", },
						{ "fx", "dmg_capital_explosion_large_hull_flare_cf_noscar_35_final1", },                 
						{ "fx_scale", "0.95", }, 
				},
				--chunck fast				
				chunckfast1 = 
				{ 
						{ "anim", "death", }, 
						{ "animtime", "0.44", }, 						
						{ "marker", "Root", },
						{ "fx", "dmg_capital_explosion_large_hull_flare_cf_noscar_35_final_fast2", },                 
						{ "fx_scale", "0.5", }, 
				},    				
				chunckfast2 = 
				{ 
						{ "anim", "death", }, 
						{ "animtime", "0.45", }, 						
						{ "marker", "Root", },
						{ "fx", "dmg_capital_explosion_large_hull_flare_cf_noscar_35_final_fast1", },                 
						{ "fx_scale", "0.6", }, 
				}, 
        event8 =
        {
            { "anim", "Death" },
            { "animtime", "0.05" },
            { "marker", "marker1" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "fx_scale", "1" },
        },
        event9 =
        {
            { "anim", "Death" },
            { "animtime", "0.1" },
            { "marker", "marker5" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "sound", "EXPLOSION/SMALL/ETG_EXPLODE_SMALL_PLASMA" },
            { "fx_scale", "2.5" },
        },
        event10 =
        {
            { "anim", "Death" },
            { "animtime", "0.25" },
            { "marker", "marker7" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "fx_scale", "2" },
        },
        event11 =
        {
            { "anim", "Death" },
            { "animtime", "0.2" },
            { "marker", "marker3" },
            { "fx", "dmg_cloud_explosion_large_nodebris" },
            { "sound", "EXPLOSION/LARGE/ETG_EXPLODE_LARGE_FIREY" },
            { "fx_scale", "0.75" },
        },
        event12 =
        {
            { "anim", "dmg01" },
            { "animtime", "-1" },
            { "marker", "marker1,marker2" },
            { "fx", "dmg_damage_puff_combo_frigate,dmg_damage_cloud_puff_spray" },
            { "sound", "DAMAGE/SMOKE/DAMAGE_SMOKE_EXHAUST_HEAVY" },
            { "fx_scale", "5" },
            { "fx_nlips", "on" },
        },
        event13 =
        {
            { "anim", "dmg02" },
            { "animtime", "-1" },
            { "marker", "marker3,marker4" },
            { "fx", "dmg_damage_puff_combo_frigate,dmg_damage_cloud_puff_spray" },
            { "sound", "DAMAGE/SMOKE/DAMAGE_SMOKE_EXHAUST_HEAVY" },
            { "fx_scale", "7.5" },
            { "fx_nlips", "on" },
        },
        event14 =
        {
            { "anim", "dmg03" },
            { "animtime", "-1" },
            { "marker", "marker5" },
            { "fx", "dmg_damage_puff_combo_frigate,dmg_damage_cloud_puff_spray" },
            { "sound", "DAMAGE/SMOKE/DAMAGE_SMOKE_EXHAUST_HEAVY" },
            { "fx_scale", "10" },
            { "fx_nlips", "on" },
        },

    event15 =
    {
        { "anim", "On" },
        { "animtime", "-1" },
        { "marker", "root" },
        { "sound", "SP_ELEMENTS/HGN_DEFENSEFIELDFRIGATE_ON" },
		{ "fx", "defensefield_sphere_spray" },
--{ "fx", "defensefield_sphere_spray_v" },
		{ "fx_scale", "200" },
    },



 
    }
}

hgn_ioncannonfrigate.lua :

function Update_IonFrigate(CustomGroup, playerIndex, shipID)

	if (Player_HasResearch(playerIndex, "ShieldOn")==1) then

		SobGroup_AbilityActivate(CustomGroup, AB_DefenseField, 1)
		SobGroup_AbilityActivate(CustomGroup, AB_DefenseFieldShield, 1)

	else

		SobGroup_AbilityActivate(CustomGroup, AB_DefenseField, 0)
		SobGroup_AbilityActivate(CustomGroup, AB_DefenseFieldShield, 0)

	end
	
	
end

hgn_ioncannonfrigate.madstate :


HGN_IONCANNONFRIGATE_DefenseFieldActivate_OnSet = function(ship)
   
    setState(ship, "DefenseFieldActivate", 1)

    	startEffect(ship, "On")

end

HGN_IONCANNONFRIGATE_DefenseFieldDeActivate_OnSet = function(ship)
   
    setState(ship, "DefenseFieldDeActivate", 1)
       	endEffect(ship, "On")
 
end

hgn_ioncannonfrigate.ship :

NewShipType = StartShipConfig()
NewShipType.displayedName="$1520"
NewShipType.sobDescription="$1521"
NewShipType.maxhealth=getShipNum(NewShipType, "maxhealth", 18500)
NewShipType.regentime=1200
NewShipType.minRegenTime=1200
NewShipType.sideArmourDamage = getShipNum(NewShipType, "sideArmourDamage", 1.2)
NewShipType.rearArmourDamage = getShipNum(NewShipType, "rearArmourDamage", 1.2)
setTacticsMults(NewShipType, "ENGINEACCEL", 1.10, 0.90, 1.0)
setTacticsMults(NewShipType, "THRUSTERACCEL", 1.10, 0.90, 1.0)
setTacticsMults(NewShipType, "ROTATION", 0.95, 1.05, 1.0)
setTacticsMults(NewShipType, "ROTATIONACCEL", 1.10, 0.90, 1.0)
setTacticsMults(NewShipType, "FIRERATE", 0.98, 1.02, 1.0)
NewShipType.isTransferable=1
NewShipType.formationSpacing=250
NewShipType.defaultROE="Defensive"
NewShipType.defaultStance="Neutral"
NewShipType.mass=100
NewShipType.collisionMultiplier=1
NewShipType.thrusterMaxSpeed=165
NewShipType.mainEngineMaxSpeed=165
NewShipType.rotationMaxSpeed=35
NewShipType.thrusterAccelTime=7
NewShipType.thrusterBrakeTime=2
NewShipType.mainEngineAccelTime=8
NewShipType.mainEngineBrakeTime=2
NewShipType.rotationAccelTime=0.4
NewShipType.rotationBrakeTime=0.2
NewShipType.thrusterUsage=0.5
NewShipType.accelerationAngle=40
NewShipType.mirrorAngle=0
NewShipType.secondaryTurnAngle=70
NewShipType.maxBankingAmount=25
NewShipType.descendPitch=35
NewShipType.goalReachEpsilon=30
NewShipType.slideMoveRange=100
NewShipType.controllerType="Ship"
NewShipType.tumbleStaticX=10
NewShipType.tumbleStaticY=20
NewShipType.tumbleStaticZ=5
NewShipType.tumbleDynamicX=2
NewShipType.tumbleDynamicY=10
NewShipType.tumbleDynamicZ=5
NewShipType.tumbleSpecialDynamicX=2
NewShipType.tumbleSpecialDynamicY=10
NewShipType.tumbleSpecialDynamicZ=5
NewShipType.relativeMoveFactor=3
setTargetBox(NewShipType, 0, -0.3,-0.35,-0.75, 0.4,0.6,0.85)
NewShipType.useLayoutBounds=1
NewShipType.layoutBoundX=60
NewShipType.layoutBoundY=50
NewShipType.layoutBoundZ=100
NewShipType.layoutCenterX=0
NewShipType.layoutCenterY=0
NewShipType.layoutCenterZ=10
NewShipType.dustCloudDamageTime=160
NewShipType.nebulaDamageTime=200
NewShipType.MinimalFamilyToFindPathAround="MotherShip"
NewShipType.BuildFamily="Frigate_Hgn"
NewShipType.AttackFamily="Frigate"
NewShipType.DockFamily="Frigate"
NewShipType.AvoidanceFamily="Frigate"
NewShipType.DisplayFamily="Frigate"
NewShipType.AutoFormationFamily="Frigate"
NewShipType.CollisionFamily="Big"
NewShipType.ArmourFamily=getShipStr(NewShipType, "ArmourFamily", "MediumArmour")
setSupplyValue(NewShipType, "Frigate", 1.0)
setSupplyValue(NewShipType, "LayoutFrigate", 1.0)
NewShipType.fighterValue=0
NewShipType.corvetteValue=0
NewShipType.frigateValue=12
NewShipType.neutralValue=0
NewShipType.antiFighterValue=0
NewShipType.antiCorvetteValue=0
NewShipType.antiFrigateValue=12
NewShipType.totalValue=12
NewShipType.buildCost=700
NewShipType.buildTime=45
NewShipType.buildPriorityOrder=30
NewShipType.retaliationRange=5500
NewShipType.retaliationDistanceFromGoal=160
NewShipType.visualRange=1000
NewShipType.prmSensorRange=5000
NewShipType.secSensorRange=6000
NewShipType.detectionStrength=1
NewShipType.TOIcon="Diamond"
NewShipType.TOScale=1
NewShipType.TODistanceFade0=9000
NewShipType.TODistanceDisappear0=7000
NewShipType.TODistanceFade1=4500
NewShipType.TODistanceDisappear1=3500
NewShipType.TODistanceFade2=12000
NewShipType.TODistanceDisappear2=35000
NewShipType.TOGroupScale=1
NewShipType.TOGroupMergeSize=0
NewShipType.mouseOverMinFadeSize=0.045
NewShipType.mouseOverMaxFadeSize=0.1
NewShipType.healthBarStyle=1
NewShipType.nlips=0.000125
NewShipType.nlipsRange=6000
NewShipType.nlipsFar=0.0001
NewShipType.nlipsFarRange=10000
NewShipType.SMRepresentation="HardDot"
NewShipType.meshRenderLimit=14000
NewShipType.dotRenderLimit=10
NewShipType.visibleInSecondary=1
NewShipType.minLOD=0.25
NewShipType.goblinsStartFade=1540
NewShipType.goblinsOff=1540
NewShipType.upLOD=2250
NewShipType.downLOD=2000
NewShipType.minimumZoomFactor=0.6
NewShipType.selectionLimit=150000
NewShipType.preciseATILimit=0
NewShipType.selectionPriority=75
NewShipType.militaryUnit=1
addAbility(NewShipType,"MoveCommand",1,0);
addAbility(NewShipType,"CanDock",1,0);
NewShipType.dockTimeBetweenTwoFormations=1
NewShipType.dockTimeBeforeStart=2
NewShipType.dockNrOfShipsInDockFormation=1
NewShipType.dockFormation="delta"
NewShipType.queueFormation="dockline"
NewShipType.strikeGroupRadius=100
NewShipType.dontDockWithOtherRaceShips=1
NewShipType.ignoreRaceWhenDocking=0
addAbility(NewShipType,"CanLaunch");
NewShipType.launchTimeBetweenTwoFormations=1
NewShipType.launchTimeBeforeStart=2
NewShipType.launchNrOfShipsInDockFormation=1
NewShipType.launchFormation="delta"
addAbility(NewShipType,"ParadeCommand",1);
addAbility(NewShipType,"WaypointMove");
addAbility(NewShipType,"HyperSpaceCommand",0,1,200,500,0,3);
addAbility(NewShipType,"CanAttack",1,1,0,1,0.35,1.5,"Capturer, Frigate, SmallCapitalShip, BigCapitalShip, Mothership, Utility,,,,, Corvette, Corvette_hw1, Fighter, Fighter_hw1","frontal_frigate",

{Fighter="frontal_vs_fighter"},
{Fighter_hw1="frontal_vs_fighter"},
{Corvette="frontal_vs_fighter"},
{Corvette_hw1="frontal_vs_fighter"},
{SmallCapitalShip="frontal_frigate"},
{BigCapitalShip="frontal_frigate"});
addAbility(NewShipType,"GuardCommand",1,3000,600);
addAbility(NewShipType,"HyperspaceViaGateCommand",1,3,1,0.3);
addAbility(NewShipType,"CanBeCaptured",30,0.1,"CapCap");
addAbility(NewShipType,"CanBeSalvageCaptured",0,1,0,0,1,"SalCap");
addAbility(NewShipType,"CanBeRepaired","RepCap");
addAbility(NewShipType,"RetireAbility",1,1);


--this set worked to make the HGN shield and the ship.lua works to activate it as well
addAbility(NewShipType,"DefenseFieldAbility",1,0,200,200,200,0.7,0.6,0,"defensefield_sphere_spray");
addAbility(NewShipType,"DefenseFieldShieldAbility",0,200,0,0);
addCustomCode(NewShipType,"data:Ship/hgn_ioncannonfrigate/hgn_ioncannonfrigate.lua","","","Update_IonFrigate","","hgn_ioncannonfrigate",2)

--this set to make the TAI sheild which is actually the one we want
--addMagneticField(NewShipType,"MagneticField",500,99,"defenseField_generic",15,"defenseField_generic",99,"plasma_hit_spray_MagneticField","defensefield_sphere_spray_TFF");
--addAbility(NewShipType,"DefenseFieldShieldAbility",0,500,0,0);
--with or without the next line the mag shield is always on, but is visible and works
--addCustomCode(NewShipType,"data:Ship/hgn_ioncannonfrigate/hgn_ioncannonfrigate.lua","","","Update_IonFrigate","","hgn_ioncannonfrigate",2)

--addAbility(NewShipType,"DefenseFieldAbility",1,0,1200,200,200,0.7,0.6,0,"defensefield_sphere_spray");
--addAbility(NewShipType,"DefenseFieldShieldAbility",0,1200,0,0);


LoadModel(NewShipType,1);
StartShipWeaponConfig(NewShipType,"Hgn_IonCannon","Weapon_Top","Fire");
addShield(NewShipType,"EMP",310,20);

--AddShipAbility(NewShipType,"DefenseField",1,"ThisShipOnly",0);

NewShipType.battleScarCoverage=2
NewShipType.battleScarBudgetLow = 400
NewShipType.battleScarBudgetNext = 600
NewShipType.sobDieTime=1.9
NewShipType.sobSpecialDieTime=1
NewShipType.specialDeathSpeed=40
NewShipType.chanceOfSpecialDeath=0
NewShipType.deadSobFadeTime=0
NewShipType.trailLinger=4
setEngineGlow(NewShipType,1,1,1.02,20,300,50,1.5,{0.27, 0.47, .69, 0.25});
loadShipPatchList(NewShipType,"data:sound/sfx/ship/Hiigaran/Frigate/",0,"Engines/HFrigateEng","",1,"Ambience/HFrigateAmb","");
loadLatchPointList(NewShipType,"SalCap","SalvagePoint1","SalvagePoint2");
loadLatchPointList(NewShipType,"CapCap","CapturePoint0");
loadLatchPointList(NewShipType,"RepCap","RepairPoint0","RepairPoint1");		
NewShipType.minFalloffDamageDist=100
NewShipType.maxFalloffDamageDist=100*2
NewShipType.maxFalloffScuttleDamageDist=100*4
NewShipType.explosiveScuttleDamageOnDeath=971
NewShipType.maxFalloffForce=500*10
NewShipType.explosiveDamageOnDeath=194
NewShipType.radiusDamageEvadeMod=1.1														 
NewShipType.canSurround=1

That stuff in the ship file that’s commented out were notes to myself as I was messing around with this stuff. I’m not 100% if that stuff works, but I’m pretty sure it did.