Page 1 of 1

AI offhand usage [Solved]

Posted: Wed Jul 26, 2017 10:28 am
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"

Re: AI offhand usage

Posted: Wed Jul 26, 2017 4:30 pm
by commanderawesome
I'm pretty sure that kind of stuff is hardcoded into the AI behavior. Could be wrong, though.

Re: AI offhand usage

Posted: Wed Jul 26, 2017 4:41 pm
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:

Re: AI offhand usage

Posted: Wed Jul 26, 2017 8:16 pm
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

Re: AI offhand usage

Posted: Wed Jul 26, 2017 8:23 pm
by LitFam
Thanks, Marth! I got the AI on both sides to throw grenades.