Dispatched AI always spawn with shotgun
-
So, I realised few days ago, that in a group of dispatched peds (2 cops in 1 car, 3 swat in fbi2 etc.), minimum one ped seem to ALWAYS spawn with a shotgun, No matter what.
I tried messing with loadout.meta, it has an effect on the non-shotgun peds, but not on the shotgun ones. It seems like a file or a line overwrite the loadout when AI is dispatched.
I'm trying to make a custom loadout for my different units (vanilla and addon ones), to feel like they are actually different units.I'd be glad to have more information from experienced modders.
Thanks.
-
@epoqx
Before I have a look at 'loadouts.meta', just wondering the kinds of things you have tried with the 'LOADOUT_COP_SHOTGUN' entry:<Item> <Name>LOADOUT_COP_SHOTGUN</Name> <Items> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_UNARMED</WeaponName> <Ammo value="0" /> <Flags /> <ComponentNames /> </Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_PISTOL</WeaponName> <Ammo value="100" /> <Flags>InfiniteAmmo</Flags> <ComponentNames /> </Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_PUMPSHOTGUN</WeaponName> <Ammo value="100" /> <Flags>EquipThisWeapon InfiniteAmmo</Flags> <ComponentNames /> </Item> </Items> </Item>
- Have you changed 'WEAPON_PUMPSHOTGUN' to another weapon? (I presume so, just need to rule it out
)
- Have you tried removing the 'EquipThisWeapon' flag from 'WEAPON_PUMPSHOTGUN'?
- Or adding in another weapon to 'LOADOUT_COP_SHOTGUN', leaving the 'WEAPON_PUMPSHOTGUN' there, but setting the new weapon with the 'EquipThisWeapon' flag instead.
- How about removing the entire 'LOADOUT_COP_SHOTGUN' section from 'loadouts.meta' to see if that has any effect?
- Have you changed 'WEAPON_PUMPSHOTGUN' to another weapon? (I presume so, just need to rule it out
-
@a63nt-5m1th Thanks for answering, here too.
I did not touched the 'LOADOUT_COP_SHOTGUN' entry simply because i'm using mostly SWAT peds who refers to 'swat' personnality (pedpersonality.ymt) who refers to '<DefaultWeaponLoadout>LOADOUT_SWAT<DefaultWeaponLoadout>' entry.
- At the begining I was using an addon ped using the COP personality, and created a whole new loadout for it. But I started to complicated, and thought it would be better to start my investigation on already working loadouts.
- I've forced the weapon to not be 'CLoadOutRandom' anymore but 'CLoadOutWeapon' only, with 'EquipThisWeapon' flag.
- Tried the above, while only having the pistol and the main weapon both as 'CLoadOutWeapon'.
- Wasn't working, so i simply kept 'WEAPON_HEAVYPISTOL' weapon as the only one left.
Edit : I Listened to you, and deleted the 'LOADOUT_SWAT' and it didn't seem to had any effect.
What keeps intriguing me, is the fact that there is ALWAYS one ped in a car that spawns with another weapon (seems to be one weapon of the loadout), and that the other ones are mostly with shotguns, except sometimes for whatever reason spawns with another weapon. But, there is always, ALWAYS one of the peds with the pumpshotgun.
The one always spawning with the good weapon seems to be the driver.That's the reason why I'm thinking about a file/line overriding the 'loadout.meta', probably from either entering/getting out of car, or from being dispatched.
-
@epoqx said in Dispatched AI always spawn with shotgun:
LOADOUT_SWAT
Post your 'loadout.meta' here using a codeblock:
How to post a codeblock:
```xml
Copy these three lines to txt file etc, overwrite only this line with meta data, copy all & post into forum post.
```or by posting it to Pastebin & sharing the link here.
Also, what vehicle/s are they spawning in? Copy the 'vehicles.meta' data for it & post it/them here/Pastebin too. Thanks
-
- My 'loadout.meta' : https://pastebin.com/5372B1mm.
For some reason, and after searching on internet, I couldn't find a way to post the codeblock for the entire 'loadout.meta' file, too heavy I guess.
- The vehicle used is fbi2, here is the 'vehicle.meta' of it :
<Item> <modelName>fbi2</modelName> <txdName>fbi2</txdName> <handlingId>FBI2</handlingId> <gameName>FBI2</gameName> <vehicleMakeName /> <expressionDictName>null</expressionDictName> <expressionName>null</expressionName> <animConvRoofDictName>null</animConvRoofDictName> <animConvRoofName>null</animConvRoofName> <animConvRoofWindowsAffected /> <ptfxAssetName>null</ptfxAssetName> <audioNameHash /> <layout>LAYOUT_RANGER_SWAT</layout> <coverBoundOffsets>FBI2_COVER_OFFSET_INFO</coverBoundOffsets> <explosionInfo>EXPLOSION_INFO_DEFAULT</explosionInfo> <scenarioLayout /> <cameraName>DEFAULT_FOLLOW_VEHICLE_CAMERA</cameraName> <aimCameraName>BOX_VEHICLE_AIM_CAMERA</aimCameraName> <bonnetCameraName>VEHICLE_BONNET_CAMERA_HIGH</bonnetCameraName> <povCameraName>DEFAULT_POV_CAMERA_LOOKAROUND</povCameraName> <FirstPersonDriveByIKOffset x="0.000000" y="-0.050000" z="-0.030000" /> <FirstPersonDriveByUnarmedIKOffset x="0.000000" y="0.000000" z="0.000000" /> <FirstPersonProjectileDriveByIKOffset x="0.000000" y="-0.088000" z="0.093000" /> <FirstPersonProjectileDriveByPassengerIKOffset x="0.020000" y="0.060000" z="-0.090000" /> <FirstPersonProjectileDriveByRearLeftIKOffset x="0.000000" y="0.000000" z="-0.055000" /> <FirstPersonProjectileDriveByRearRightIKOffset x="0.000000" y="0.000000" z="-0.055000" /> <FirstPersonDriveByLeftPassengerIKOffset x="0.000000" y="0.000000" z="-0.040000" /> <FirstPersonDriveByRightPassengerIKOffset x="-0.045000" y="-0.048000" z="-0.040000" /> <FirstPersonDriveByRightRearPassengerIKOffset x="0.000000" y="0.000000" z="-0.040000" /> <FirstPersonDriveByLeftPassengerUnarmedIKOffset x="0.000000" y="0.000000" z="0.000000" /> <FirstPersonDriveByRightPassengerUnarmedIKOffset x="0.000000" y="0.000000" z="0.000000" /> <FirstPersonMobilePhoneOffset x="0.150000" y="0.288000" z="0.503000" /> <FirstPersonPassengerMobilePhoneOffset x="0.136000" y="0.223000" z="0.425000" /> <FirstPersonMobilePhoneSeatIKOffset> <Item> <Offset x="0.136000" y="0.223000" z="0.475000" /> <SeatIndex value="2" /> </Item> <Item> <Offset x="0.136000" y="0.223000" z="0.475000" /> <SeatIndex value="3" /> </Item> </FirstPersonMobilePhoneSeatIKOffset> <PovCameraOffset x="0.000000" y="-0.138000" z="0.645000" /> <PovCameraVerticalAdjustmentForRollCage value="0.000000" /> <PovPassengerCameraOffset x="0.000000" y="0.000000" z="0.030000" /> <PovRearPassengerCameraOffset x="0.000000" y="0.000000" z="0.070000" /> <vfxInfoName>VFXVEHICLEINFO_CAR_GENERIC</vfxInfoName> <shouldUseCinematicViewMode value="true" /> <shouldCameraTransitionOnClimbUpDown value="false" /> <shouldCameraIgnoreExiting value="false" /> <AllowPretendOccupants value="true" /> <AllowJoyriding value="false" /> <AllowSundayDriving value="false" /> <AllowBodyColorMapping value="true" /> <wheelScale value="0.268600" /> <wheelScaleRear value="0.268600" /> <dirtLevelMin value="0.000000" /> <dirtLevelMax value="0.650000" /> <envEffScaleMin value="0.000000" /> <envEffScaleMax value="1.000000" /> <envEffScaleMin2 value="0.000000" /> <envEffScaleMax2 value="1.000000" /> <damageMapScale value="0.600000" /> <damageOffsetScale value="1.000000" /> <diffuseTint value="0xC4000000" /> <steerWheelMult value="1.000000" /> <HDTextureDist value="5.000000" /> <lodDistances content="float_array"> 100.000000 120.000000 150.000000 180.000000 500.000000 700.000000 </lodDistances> <minSeatHeight value="0.966" /> <identicalModelSpawnDistance value="20" /> <maxNumOfSameColor value="10" /> <defaultBodyHealth value="1000.000000" /> <pretendOccupantsScale value="1.000000" /> <visibleSpawnDistScale value="1.000000" /> <trackerPathWidth value="2.000000" /> <weaponForceMult value="1.000000" /> <frequency value="100" /> <swankness>SWANKNESS_1</swankness> <maxNum value="999" /> <flags>FLAG_HAS_LIVERY FLAG_EXTRAS_ALL FLAG_LAW_ENFORCEMENT FLAG_HAS_INTERIOR_EXTRAS</flags> <type>VEHICLE_TYPE_CAR</type> <plateType>VPT_FRONT_AND_BACK_PLATES</plateType> <dashboardType>VDT_CAVALCADE</dashboardType> <vehicleClass>VC_EMERGENCY</vehicleClass> <wheelType>VWT_SUV</wheelType> <trailers /> <additionalTrailers /> <drivers> <Item> <driverName>S_M_M_FIBOffice_01</driverName> <npcName /> </Item> <Item> <driverName>S_M_M_FIBOffice_02</driverName> <npcName /> </Item> </drivers> <extraIncludes /> <doorsWithCollisionWhenClosed /> <driveableDoors /> <bumpersNeedToCollideWithMap value="false" /> <needsRopeTexture value="false" /> <requiredExtras /> <rewards> <Item>REWARD_WEAPON_CARBINERIFLE</Item> <Item>REWARD_AMMO_CARBINERIFLE</Item> <Item>REWARD_STAT_WEAPON</Item> </rewards> <cinematicPartCamera> <Item>WHEEL_FRONT_RIGHT_CAMERA</Item> <Item>WHEEL_FRONT_LEFT_CAMERA</Item> <Item>WHEEL_REAR_RIGHT_CAMERA</Item> <Item>WHEEL_REAR_LEFT_CAMERA</Item> </cinematicPartCamera> <NmBraceOverrideSet /> <buoyancySphereOffset x="0.000000" y="0.000000" z="0.000000" /> <buoyancySphereSizeScale value="1.000000" /> <pOverrideRagdollThreshold type="NULL" /> <firstPersonDrivebyData> <Item>RANGER_CAVALCADE_FRONT_LEFT</Item> <Item>RANGER_FRONT_RIGHT</Item> <Item>RANGER_PRANGER_REAR_LEFT</Item> <Item>RANGER_PRANGER_REAR_RIGHT</Item> </firstPersonDrivebyData> </Item>
Notes :
- I tried changing the driverName from 'vehicle.meta' to the one using the fbi2 on dispatch already : S_M_Y_Swat_01.
- I reverse back to a safe 'mods' folder after too much uneffective editing, reason why it is still S_M_M_FIBOffice_02.
- An information that could be helpfull, we never know. After my Install of Redux + Visual V, I remember the SWAT wasn't hanging on the sides of the fbi2, simply because it was lacking the '_SWAT' after 'LAYOUT_RANGER'. Meaning Redux files editing seems quite old compared to the actual GTA V version, and that could be something to take into account.
Thanks for answering, and for the codeblocks/Pastbin
-
@epoqx
Here you goTry this loadout.meta
Hint: It was 'LOADOUT_COP_SHOTGUN' causing your problem.
Yeah, I know, welcome to modding Rockstar games
-
@a63nt-5m1th
Basically you replaced this<Item type="CLoadOutRandom"> <Items> <Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_PUMPSHOTGUN</WeaponName> <Ammo value="64" /> <Flags>EquipThisWeapon</Flags> <ComponentNames> <Item>COMPONENT_AT_AR_FLSH</Item> </ComponentNames> </Item> <Chance value="0.900000" /> </Item> <Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_CARBINERIFLE</WeaponName> <Ammo value="180" /> <Flags>EquipThisWeapon</Flags> <ComponentNames> <Item>COMPONENT_AT_AR_FLSH</Item> </ComponentNames> </Item> <Chance value="0.100000" /> </Item> </Items> </Item>
With this ?
<Item type="CLoadOutRandom"> <Items> <Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_CARBINERIFLE</WeaponName> <Ammo value="180" /> <Flags>EquipThisWeapon</Flags> <ComponentNames> <Item>COMPONENT_AT_AR_FLSH</Item> <Item>COMPONENT_AT_SCOPE_MEDIUM</Item> </ComponentNames> </Item> <Chance value="0.500000" /> </Item> <Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_CARBINERIFLE</WeaponName> <Ammo value="180" /> <Flags>EquipThisWeapon</Flags> <ComponentNames> <Item>COMPONENT_AT_AR_FLSH</Item> </ComponentNames> </Item> <Chance value="0.500000" /> </Item> </Items> </Item>
How can LOADOUT_COP_SHOTGUN overrule LOADOUT_SWAT when LOADOUT_SWAT is the main swat loadout ?
It means that any dispatched unit that is not driving a vehicle, is considered as a LOADOUT_COP_SHOTGUN in all cases ?
Dude, you made my day.
-
@epoqx
Yeah, that's right, that's what I replaced
Not sure about the specifics, but all swat in my game spawn with the guns I set in 'LOADOUT_COP_SHOTGUN'.
I have the driver set as swat too & he appeared to have the same loadout (I never thoroughly checked that tho so don't quote me on it).
-
@a63nt-5m1th said in Dispatched AI always spawn with shotgun:
I have the driver set as swat too & he appeared to have the same loadout
You intrigue me. How can you even set a seat to a specific category/personality/loadout ?
-
@epoqx said in Dispatched AI always spawn with shotgun:
How can you even set a seat to a specific category/personality/loadout ?
Sorry, perhaps I was a bit misleading there, I just mean all peds in the 'fbi2' etc are swat, including the driver.
You can set a specific pilot in dispatch helicopters & it works (not sure exactly how, just know I have that in my game) so may be possible to stop 'dispatch.meta' peds overruling 'vehicles.meta' driver setting etc in road vehicles as well somehow.
I'll have to have a look at my files to investigate the specifics.
-
@a63nt-5m1th
So i've changed the LOADOUT_SWAT with MICROSMG, and realised that there is still 1 out of 3 swat having the CARBINERIFLE.So I've deleted the LOADOUT_COP_SHOTGUN to see if this would have any effect. And I realised that there was still 1 out of 3 swat with non-attachments CARBINERIFLE.
BUT, the DT_PoliceAutomobile units got the weapons from their proper loadout.So i've deleted all the loadouts with CARBINERIFLE without attachments. Now there is 1 swat out of 3 who has a carbinerifle with attachments.
I'm gettin confused on which loadout rule on which other one for the DT_SwatAutomobile.
EDIT :
I've literally deleted all the loadouts with CARBINERIFLE in it, except Army. This seem to fix the 1-ped-different-loadout bug. I'll make more tests to be sure, but it seem fixed !!
-
@epoqx
I'm not sure, perhaps some kind of built in redundancy, so when loadouts are missing it falls back to the next set etc. That, or 'loadouts.meta' is just much more convoluted than it appears.
Would be handy to know exactly how loadouts function right enoughOne thing I presume you've noticed, but I've not overtly mentioned is the 'CLoadOutRandom':
<Chance value="0.800000" /> etc
Those values control the chance of a certain weapon appearing in any one 'CLoadOutRandom' & need to add up to '1.00000' total (in any one 'CLoadOutRandom').
Example:
<Item type="CLoadOutRandom"> <Items> <Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_SMG</WeaponName> <Ammo value="180" /> <Flags>EquipThisWeapon</Flags> <ComponentNames> <Item>COMPONENT_AT_AR_FLSH</Item> </ComponentNames> </Item> <Chance value="0.150000" /> </Item> <Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_CARBINERIFLE</WeaponName> <Ammo value="180" /> <Flags>EquipThisWeapon</Flags> <ComponentNames> <Item>COMPONENT_AT_AR_FLSH</Item> </ComponentNames> </Item> <Chance value="0.425000" /> </Item> <Item> <Item type="CLoadOutWeapon"> <WeaponName>WEAPON_CARBINERIFLE</WeaponName> <Ammo value="180" /> <Flags>EquipThisWeapon</Flags> <ComponentNames> <Item>COMPONENT_AT_AR_FLSH</Item> <Item>COMPONENT_AT_SCOPE_MEDIUM</Item> </ComponentNames> </Item> <Chance value="0.425000" /> </Item> </Items> </Item>
'0.425000' + '0.425000' + '0.150000' = '1.00000' etc
So with the example above you will hardly ever see the 'WEAPON_SMG' equiped (1 in ~7 (6.6666) chance), but likely to appear way less than once every 7 spawns.
As mentioned, presume you've noticed this & figured it out, but thought I'd throw it out here anyway for others that might read it etc
-
@a63nt-5m1th said in Dispatched AI always spawn with shotgun:
@epoqx
I'm not sure, perhaps some kind of built in redundancy, so when loadouts are missing it falls back to the next set etc.Looks like it's the case. I don't have any problem with loadout anymore. Every loadout I create now for any ped type (cop/swat/army) fonction properly. I don't know if it is the case in the vanilla loadout.meta, but for anyone who installed redux, the file needs a little cleaning to work properly !
Now I noticed LOADOUT_COP_L1 and LOADOUT_COP_L2 being part of it, and thought it could be the LOADOUT_COP scaling for each wanted level.
For example, Wlevel1 would be LOADOUT_COP, then Wlevel2 would be LOADOUT_COP_L1 or L2 etc.
But I didn't saw any difference in their loadouts. Still something to dig in I presume.One thing I presume you've noticed, but I've not overtly mentioned is the 'CLoadOutRandom':
Yeah already noticed Chance value, but still a great line to edit to have variation over the weapons !
-
@epoqx
The L1/L2 would have been my presumption too. Different loadouts for different levels etc
Wouldn't mind having a look at your new fully functional 'loadouts.meta' if you fancy posting it/sending it to me, no worries if not, glad you got it working anyway
-
With pleasure, here it is !
EDIT :
- I've actually added WEAPON_SMOKEGRENADE to the LOADOUT_SWAT, and the flag BF_CanThrowSmokeGrenade in combatbehaviour.meta/CCombatInfo/SWAT.
I've modified a lot the vanilla smoke so that it's a big cloud of smoke, we cannot see through that easily, and it deals just a little bit of tick damage.
Now it gives a much better tactical approach from the SWAT units
- I've tried creating a new CCombatInfo in combatbehaviour.meta for one of my added peds, but for some reason the game crash at some specific locations in the game.
- I've actually added WEAPON_SMOKEGRENADE to the LOADOUT_SWAT, and the flag BF_CanThrowSmokeGrenade in combatbehaviour.meta/CCombatInfo/SWAT.