AI offhand usage [Solved]

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
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

AI offhand usage [Solved]

Post by LitFam »

Does any one know how to make the ai use the grenades more often this is what I have so far. This grenade is meant to target droids and vehicles only.
Hidden/Spoiler:
[WeaponClass]
ClassLabel = "grenade"

[Properties]
GeometryName = "com_weap_inf_grenadethermal"
HighResGeometry = "com_1st_weap_inf_grenadethermal"

OffhandWeapon = 1

//***********************************************
//************* TARGET & RANGE VALUES **********
//***********************************************

TargetEnemy = "1"
TargetNeutral = "1"
TargetFriendly = "0"

TargetPerson = "0"
TargetAnimal = "0"
TargetDroid = "1"
TargetVehicle = "1"
TargetBuilding = "0"

MinRange = "0"
OptimalRange = "16"
MaxRange = "24"

LockOnRange = "40.0"
LockTime = "0.4"
LockOnAngle = "1.0"

//***********************************************
//*********** WEAPON PERFORMANCE VALUES *********
//***********************************************

RoundsPerClip = "1"
ReloadTime = "0.0"
ShotDelay = "1.3"
ShotElevate = "0.21"
MaxPressedTime = "0.0"

InitialSalvoDelay = "0.51"

//***********************************************
//*********** HUD & CONTROLLER VALUES *********
//***********************************************

ChargeRateLight = "1.0"
MaxChargeStrengthLight = "1.0"
ChargeDelayLight = "0.0"
ChargeRateHeavy = "1.0"
MaxChargeStrengthHeavy = "0.25"
ChargeDelayHeavy = "1.45"

RecoilLengthLight = "0.1"
RecoilLengthHeavy = "0.1"
RecoilStrengthLight = "0"
RecoilStrengthHeavy = "0"

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

FireSound = "com_weap_throw"
FireEmptySound = "com_weap_inf_ammo_empty"
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: AI offhand usage

Post by commanderawesome »

I'm pretty sure that kind of stuff is hardcoded into the AI behavior. Could be wrong, though.
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

Re: AI offhand usage

Post by LitFam »

commanderawesome wrote:I'm pretty sure that kind of stuff is hard coded into the AI behavior. Could be wrong, though.
I thought it had to do with the range values and all that stuff. Well if it's hard coded then :cpu:
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: AI offhand usage

Post by Marth8880 »

Add these parameters to the weapon ODF to adjust which health types AI units can target with it:

Code: Select all

AITargetPerson
AITargetAnimal
AITargetDroid
AITargetVehicle
AITargetBuilding
It goes without saying that you'll need to assign a value to each parameter, like for example:

Code: Select all

AITargetPerson = "1"
AITargetAnimal = "1"
AITargetDroid = "1"
AITargetVehicle = "0"
AITargetBuilding = "0"
These values affect which health types that human players can lock onto with the weapon:

Code: Select all

TargetPerson = "0"
TargetAnimal = "0"
TargetDroid = "1"
TargetVehicle = "1"
TargetBuilding = "0"
See here for how to adjust the frequency at which an AI fires a weapon: http://www.gametoast.com/viewtopic.php?p=240983#p240983
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

Re: AI offhand usage

Post by LitFam »

Thanks, Marth! I got the AI on both sides to throw grenades.
Post Reply