Eddlm Posted December 17, 2015 Share Posted December 17, 2015 (edited) So, I'm doing some researching to be able to control the ped behavior like the game does: with flags. AI behavior flags work similar to the driving behavior, explained here. So far, this is what's known: - Combat Behaviour flags are defined in real time in combatbehaviour.meta. - Combat Behaviour flags for any ped can be enabled/disabled using the PED::SET_PED_COMBAT_ATTRIBUTES native. - While Combat Behaviour flags are defined with descriptive texts in combatbehaviour.meta, they are defined as integers when using the native mentioned, so we have a little problem here. We need to know which integer corresponds with what flag. - The highest integer used by "PED::SET_PED_COMBAT_ATTRIBUTES" is 82, by looking at the scripts. - Looks like there can be an "order" that can help us translate the behaviour flags from the file to an integer. Example: DEFAULT CCombatInfo uses: <BehaviourFlags>BF_CanUseCover BF_CanUseVehicles BF_CanDoDrivebys BF_CanLeaveVehicle BF_UseProximityFiringRate BF_CanTauntInVehicle BF_CanUsePeekingVariations BF_CanCommandeerVehicles BF_MaintainMinDistanceToTarget BF_CanUseDynamicStrafeDecisions BF_DisableBlockFromPursueDuringVehicleChase BF_DisableSpinOutDuringVehicleChase BF_DisableCruiseInFrontDuringBlockDuringVehicleChase</BehaviourFlags> I've tried disabling the integers from 0 to 3, and they correspond with these flags: 0 =BF_CanUseCover 1=BF_CanUseVehicles 2=BF_CanDoDrivebys 3=BF_CanLeaveVehicle So, with some luck, we can continue correlating the flags and discover more of them. Problem is: some CCombatInfo's skip a few flags, so we have to be careful and compare multiple CCombatInfo's to make sure the flags are in the correct order. Here is the list of known flags: 0 = BF_CanUseCover1 = BF_CanUseVehicles2 = BF_CanDoDrivebys3 = BF_CanLeaveVehicle..17/46 = stops peds from fleeing? One of them could be BF_AlwaysFight or BF_CanFightArmedPedsWhenNotArmed Note: These flags control that the ped can and cannot do (and how) while left alone (using its own AI), but you can still force the ped to do anything with a TASK_. For example, peds that have 3 (BF_CanLeaveVehicle) disabled can still get out of their vehicle if they're tasked to (AI::TASK_LEAVE_VEHICLE). This is all I know about this topic, I'll try to discover more flags in my free time. If you're in need of knowing them, feel free to do your own research and post your findings here. I hope this information was useful to you. Edited December 17, 2015 by Eddlm reditec, R3QQ and jedijosh920 3 Link to comment Share on other sites More sharing options...
reditec Posted December 18, 2015 Share Posted December 18, 2015 Good work! Link to comment Share on other sites More sharing options...
gtaVmod Posted December 18, 2015 Share Posted December 18, 2015 - Combat Behaviour flags for any ped can be enabled/disabled using the PED::SET_PED_COMBAT_ATTRIBUTES native. There is also PED::SET_COMBAT_FLOAT frequently used in game scripts Link to comment Share on other sites More sharing options...
Eddlm Posted December 18, 2015 Author Share Posted December 18, 2015 (edited) Yep, I believe they refer to the floats defined in combatbeaviour.meta. I already left some information on the native documentation, but I'll post it here again: <BlindFireChance value="0.1"/><WeaponShootRateModifier value="1.0"/><TimeBetweenBurstsInCover value="1.25"/><BurstDurationInCover value="2.0"/><TimeBetweenPeeks value="10.0"/><WeaponAccuracy value="0.18"/><FightProficiency value="0.8"/><StrafeWhenMovingChance value="1.0"/><WalkWhenStrafingChance value="0.0"/><AttackWindowDistanceForCover value="55.0"/><TimeToInvalidateInjuredTarget value="9.0"/><TriggerChargeTime_Near value="4.0"/><TriggerChargeTime_Far value="10.0"/> These are the floats defined in combatbehaviour.meta. Its likely that each CombatType(int) refers to one of these variables. Edited December 18, 2015 by Eddlm R3QQ and jedijosh920 2 Link to comment Share on other sites More sharing options...
GeorgeZhang Posted January 29, 2016 Share Posted January 29, 2016 I've tested with 17 and 46: 17- When I set it to true, peds just flees when they face enemies with weapons(those shooting bullets).46- When set to true, peds with melee weapons will fight peds with weapons. I don't understand. Link to comment Share on other sites More sharing options...
R3QQ Posted January 29, 2016 Share Posted January 29, 2016 (edited) Great thread. I have tested 20 now for hours without any ped giving me the middle finger from inside vehicles. The player can't do it either. So that makes me believe BF_CanTauntInVehicle to be 20. BF_CanDoDrivebys also makes the player unable to show the middle finger but peds still can. BF_CanTauntInVehicle does not need to be looped. BF_CanDoDrivebys does when set to false. These are all the behavior flags found in the XML: http://pastebin.com/XSgajbtN All attributeIndexes found in the b617d decompiled scripts: http://pastebin.com/ZLkLSgLp Highest value found to be 88. PED::SET_PED_COMBAT_ATTRIBUTES(a_0, 88, 1); Edited January 31, 2016 by R3QQ GeorgeZhang 1 Link to comment Share on other sites More sharing options...
GeorgeZhang Posted January 30, 2016 Share Posted January 30, 2016 Yep, I believe they refer to the floats defined in combatbeaviour.meta. I already left some information on the native documentation, but I'll post it here again: <BlindFireChance value="0.1"/><WeaponShootRateModifier value="1.0"/><TimeBetweenBurstsInCover value="1.25"/><BurstDurationInCover value="2.0"/><TimeBetweenPeeks value="10.0"/><WeaponAccuracy value="0.18"/><FightProficiency value="0.8"/><StrafeWhenMovingChance value="1.0"/><WalkWhenStrafingChance value="0.0"/><AttackWindowDistanceForCover value="55.0"/><TimeToInvalidateInjuredTarget value="9.0"/><TriggerChargeTime_Near value="4.0"/><TriggerChargeTime_Far value="10.0"/> These are the floats defined in combatbehaviour.meta. Its likely that each CombatType(int) refers to one of these variables. Hi, I've discovered several "CombatType"(int) by editing combatbehaviour.meta and then checking with GET_COMBAT_FLOAT p1:0=BlindFireChance1=BurstDurationInCover3=TimeBetweenBurstsInCover4=TimeBetweenPeeks5=StrafeWhenMovingChance8=WalkWhenStrafingChance11=AttackWindowDistanceForCover12=TimeToInvalidateInjuredTarget16=OptimalCoverDistance Fireboyd78 and R3QQ 2 Link to comment Share on other sites More sharing options...
InfamousSabre Posted February 21, 2016 Share Posted February 21, 2016 (edited) 5 is BF_CanFightArmedPedsWhenNotArmed ...searched for that for a while. lol.. Edited February 21, 2016 by InfamousSabre R3QQ and GeorgeZhang 2 Link to comment Share on other sites More sharing options...
GeorgeZhang Posted March 5, 2016 Share Posted March 5, 2016 (edited) 5 is BF_CanFightArmedPedsWhenNotArmed ...searched for that for a while. lol.. Great work, thank you a lot. But how does it differ from AlwaysFight? I ask because when setting 46 to true it has the effect to make ped fight armed peds(all kinds of situation) . Edited March 5, 2016 by GeorgeZhang Link to comment Share on other sites More sharing options...
InfamousSabre Posted March 5, 2016 Share Posted March 5, 2016 5 is BF_CanFightArmedPedsWhenNotArmed ...searched for that for a while. lol.. Great work, thank you a lot. But how does it differ from AlwaysFight? I ask because when setting 46 to true it has the effect to make ped fight armed peds(all kinds of situation) . If the ped does not have a firearm and they are told to combat a ped who is currently wielding a firearm, and 5 (BF_CanFightArmedPedsWhenNotArmed) is not true, they will run away even if 46 is true. If your ped is still fighting, their BF_CanFightArmedPedsWhenNotArmed flag is already set. Link to comment Share on other sites More sharing options...
R3QQ Posted March 13, 2016 Share Posted March 13, 2016 (edited) Seems like all values between 1311 and 1376 crashes the game instantly when set to true. Edited March 13, 2016 by R3QQ Link to comment Share on other sites More sharing options...
En3rgized247 Posted March 20, 2020 Share Posted March 20, 2020 Anyone know what the integer index is for WeaponShootRateModifier in GET_COMBAT_FLOAT? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now