[Tutorial]How to make a turret shield(and other cool tricks)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
CT108
Rebel Sergeant
Rebel Sergeant
Posts: 186
Joined: Mon Aug 22, 2016 6:20 am
Projects :: None
Games I'm Playing :: CS2
xbox live or psn: Captain CT108
Location: Xanadu

[Tutorial]How to make a turret shield(and other cool tricks)

Post by CT108 »

Hi the Gametoast community

Here is my tips and tricks for make a deployable turrets that will deploy a shield
(also I'm sorry for my bad english)

NOTE : I was highly inspired by this tutorial http://www.gametoast.com/viewtopic.php?f=27&t=13743 (the first one)
So check it now if you want to know how to make a simply deployable shield ;)

Anyway let's go !

NOTE : I'm making the deployable shield for the imperials (so I use the turret of the imp side file)

So first : how to create your deployable shield
Hidden/Spoiler:
1) Go to your imp side folder (but not the stock one), odf and open imp_bldg_inf_autoturret

2) In the auto turret's odf, copy paste this [code][GameObjectClass]
ClassParent = "com_bldg_inf_autoturret"
GeometryName = "com_weap_inf_dropturret.msh"

[Properties]
// NOBODY has override textures for this!
//OverrideTexture = "com_prop_dropturret_imp"

BUILDINGSECTION = "BODY"
GeometryName = "com_weap_inf_dropturret"
ExplosionName = "imp_bldg_inf_autoturret_exp"

BUILDINGSECTION = "TURRET1"

TurretNodeName = "aimer_y"

TURRETSECTION = "TURRET1"

WeaponName = "imp_weap_inf_shield_for_turret"
WeaponAmmo = "2"

Controllable = "0"
AutoFire = "1"

AimerNodeName = "aimer_x"
FirePointName = "hp_fire"[/code]

3) Now create a new odf file called "imp_weap_inf_shield_for_turret" (without the quotes)

4) In the new file, copy and paste this [code]
[WeaponClass]

ClassLabel = "shield"

[Properties]
Label = "Shield"

RoundsPerClip = "1"
ReloadTime = "0.0"

MaxShield = 3000
AddShield = -100
AddShieldOff = 300

ShieldOffset = "0.0 1.0 0.125"
ShieldRadius = 1.25

FireSound = "cis_droideka_shield_on"
FireEmptySound = ""
FireLoopSound = ""
ReloadSound = ""
ChargeSound = ""
ChangeModeSound = ""
WeaponChangeSound = ""
//ShieldSound = "cis_droideka_shield"
//ShieldSound = "droid_fx7_hum"
ShieldOffSound = ""

ShieldEffect = "droidekashield"[/code]

5) Now go the cis file in the assets, effects and copy every folders with "shield" in their names

6) Now paste these folders in the effects folder of the imp side of your map

7) You did the turret's properties but you didn't created the weapon ! Create a new odf called imp_weap_inf_turretshield and paste the code below in your new odf
[code][WeaponClass]
ClassParent = "com_weap_inf_autoturret_dispenser"

[Properties]
HUDTag = "com_weap_inf_dropturret"
OrdnanceName = "imp_bldg_inf_autoturret"

WeaponName = "imp_weap_inf_shield_for_turret"
WeaponAmmo = "2"

//**********************************************
//****************** SOUND *********************
//**********************************************

FireLoopSound = ""
ReloadSound = "com_weap_inf_equip_med"
ChargeSound = ""
ChargeSoundPitch = ""
ChangeModeSound = "com_weap_inf_equip_med"
WeaponChangeSound = "com_weap_inf_equip_med"
JumpSound = "com_weap_inf_rifle_mvt_jump"
LandSound = "com_weap_inf_rifle_mvt_land"
RollSound = "com_weap_inf_rifle_mvt_roll"
//ProneSound = "com_weap_inf_rifle_mvt_lie"
SquatSound = "com_weap_inf_rifle_mvt_squat"
//StandSound = "com_weap_inf_rifle_mvt_getup"[/code]


8 ) Now in one of your trooper's odf, add these 4 lines [code]
WEAPONSECTION = *
WeaponName = "imp_weap_inf_turretshield"
WeaponAmmo = 2
WeaponChannel = 1[/code]

Now you did the shield, let's customize it !

How to make the Krennic's droid from the EA's Battlefront
Hidden/Spoiler:
1) We need to change the size of the shield to have it like the Krennic's one. Go to your effects folder and open droidekashield.fx . In this file replace the radius and height values by 4.25. Now you normally have the droidekashield.fx file like this [code]
Shield("DroidekaShield")
{
Type("droideka");
Texture("cis_inf_droideka_shield");
Color(96, 160, 192, 255);
SpecularColor(216, 240, 255);
ViewAngleFactor(1.5);
Radius(4.25);
Height(4.25);
TurnOnTime(0.15);
TurnOffTime(0.15);
ScrollRate(1.0);
}
[/code]

IMPORTANT : Notice that we can change the size of the shield but it will not block every shots !!


2) Now the shield is done, we need to set up the weapons. Go to the cis file side in the assets, odf and copy "cis_weap_inf_debuff_poison.odf" and "cis_weap_inf_debuff_poison_ord.odf" and paste these files in the odf folder in your imp folder side. Now rename "cis_weap_inf_debuff_poison.odf" by "imp_weap_inf_debuff_poison.odf". Then open "imp_weap_inf_debuff_poison.odf" and replace everything in the folder by this [code][WeaponClass]

ClassParent = "com_weap_inf_buff"

[Properties]

HUDTag = "hud_poison"
OrdnanceName = "cis_weap_inf_debuff_poison_ord"

RoundsPerClip = "9999"
ReloadTime = "0.0"

TargetEnemy = "1"
TargetNeutral = "0"
TargetFriendly = "0"[/code]

3) We need to have 2 weapons in the turret's properties : the shield and the poison. I'm not adding the scan pulse because as far as I know it's imposible to do a scan pulse in Battlefront 2. Notice that the poison will "fire" everytime, not only when an enemy is in the area. The shield has been added but we need to add the poison launcher.

Go back to the file "imp_bldg_inf_autoturret.odf" and add just above the line Controllable = "0" [code]PilotType = "self"[/code]
Then copy everything from : BUILDINGSECTION = "TURRET1" to : AutoFire = "1" and paste it just below.

In the part that you've pasted, rename BUILDINGSECTION = "TURRET1" and TURRETSECTION = "TURRET1" by BUILDINGSECTION = "TURRET2" and TURRETSECTION = "TURRET2".

Then in the same part rename WeaponName = "imp_weap_inf_shield_for_turret" by "imp_weap_inf_debuff_poison" and change the vallue of the WeaponAmmo from 2 to 0.

So now, the turret's odf should looks like this [code][GameObjectClass]
ClassParent = "com_bldg_inf_autoturret"
GeometryName = "com_weap_inf_dropturret.msh"

[Properties]
// NOBODY has override textures for this!
//OverrideTexture = "com_prop_dropturret_imp"

BUILDINGSECTION = "BODY"
GeometryName = "com_weap_inf_dropturret"
ExplosionName = "imp_bldg_inf_autoturret_exp"

BUILDINGSECTION = "TURRET1"

TurretNodeName = "aimer_y"

TURRETSECTION = "TURRET1"

WeaponName = "imp_weap_inf_shield_for_turret"
WeaponAmmo = "2"

PilotType = "self"

Controllable = "0"
AutoFire = "1"

BUILDINGSECTION = "TURRET2"

TurretNodeName = "aimer_y"

TURRETSECTION = "TURRET2"

WeaponName = "imp_weap_inf_debuff_poison"
WeaponAmmo = "0"

PilotType = "self"

Controllable = "0"
AutoFire = "1"

AimerNodeName = "aimer_x"
FirePointName = "hp_fire"[/code]

Yes we have finished the Krennic's droid !

If you want to have a black droid like the EA's one, just DL a R2D2 model from the assets section, paint it in black and change the model's name in "imp_bldg_inf_autoturret.odf" .

Other cool tricks
Hidden/Spoiler:
If you want to have some differents buffs for your turret, just use the method that I've used above for the Krennic's droid

If you want to have more than 2 weapons for your auto turret, use again the same method that I've used above but when you're renaming BUILDINGSECTION = "TURRET1" and TURRETSECTION = "TURRET1" by by BUILDINGSECTION = "TURRET2" and TURRETSECTION = "TURRET2" just replace the "2" by "3" if this is your third weapon, by "4" if this is your 4th weapon etc...

I'm also making a turret that can fire orbital strikes, I will upload news about this ;)
I hope this tutorial has helped you :D !
LPMaster1996
Recruit Womprat Killer
Posts: 6
Joined: Wed Apr 27, 2022 1:11 am
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: [Tutorial]How to make a turret shield(and other cool tricks)

Post by LPMaster1996 »

Hello,
I followed your tutorial.

However, I see no shield effect and my turret shoots in continuous fire
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: [Tutorial]How to make a turret shield(and other cool tricks)

Post by Sporadia »

This isn't something I've tried before but I have a suspicion. Someone's posted on the engine limitations thread before that every autoturret in a mission will have the same ordnance. So the deployable shield may not work if you're also loading units with regular autoturrets. Take the snipers out of ReadDataFile and see if that fixes it.
MasterSaitek009 wrote:
Thu Feb 14, 2008 6:35 pm
Every dispensable turret on the map uses the same weapon as the last loaded dispensable turret in the Lua.
LPMaster1996
Recruit Womprat Killer
Posts: 6
Joined: Wed Apr 27, 2022 1:11 am
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: [Tutorial]How to make a turret shield(and other cool tricks)

Post by LPMaster1996 »

Thanks for the tip. I will try.
Post Reply