Is there any way to mod the game files to force first person mode when aiming?
Hey guys, as the title goes. I'm looking to see if there is any way to change the game files to force you into first person when aiming. There is a fantastic script https://www.gta5-mods.com/scripts/forced-first-person-aim#comments_tab that does this which I use and is great however, I would like to see if that functionality can be done by changing some game files without the need of using a script. I disabled the reticle in the weapons.meta and think that force first person would be in there as well? Or maybe in weaponanimations.meta?
Reason for this is that scripts age and do not work over time unless updated. Also I am trying to minimize the amount of scripts that I have. Worth a shot asking and hope anyone can share some light.
I narrowed it down in weapons.meta under:
However I cannot find the correct name for the camera. I tried FIRST_PERSON_IDLE_CAMERA and FIRST_PERSON_AIM_CAMERA however those do not work unless I am doing something wrong? When I use <DefaultCameraHash>SNIPER_LOW_ZOOM_AIM_CAMERA</DefaultCameraHash> it works however I do not see the gun.
Anyone out there knows the correct camera names?
& see what you get?
Untested. I just had a look at 'cameras.ymt' & very luckily, was able to guess that name & translate the 'hash_A70102CA' hex hash. Looks like it might work. Let me know your results. Thanks
If it doesn't work for some reason, maybe try out some of the other cameras from one of the two 'FirstPerson' sections below. Try using just the hex hash ('hash_64E68B46', 'hash_02DFF9A0' etc) for the ones that don't have names in English. That should still work & activate them (although I haven't tested that for 'weapons.meta').
cameras.ymt info etc:
This is what I was able to decipher out of 'cameras.ymt' for reference, or for anyone else interested in it in future etc:
hash_BB570E9E = DEFAULT_THIRD_PERSON_PED_AIM_CAMERA
hash_623275C3 = DEFAULT_FOLLOW_VEHICLE_CAMERA
hash_6B93C9A6 = DEFAULT_THIRD_PERSON_VEHICLE_AIM_CAMERA
hash_91817B9D = FLASHLIGHT_AIM_CAMERA
hash_0EC797BA = PARACHUTE_AIM_CAMERA
hash_5F937290 = RIFLE_PRONE_AIM_CAMERA
hash_616B3F42 = HANGING_UPSIDE_DOWN_AIM_CAMERA
hash_1B5BBA5A = ATTACHED_TO_ROPE_AIM_CAMERA
hash_8E3CA077 = EXILE_THREE_DINGHY_AIM_CAMERA
hash_70F748EC = HIP_AIM_CAMERA
hash_053D22F3 = SHOTGUN_AIM_CAMERA
hash_E135DF75 = RPG_AIM_CAMERA
hash_B3B84A58 = THROWN_AIM_CAMERA
hash_BBAEB699 = DIGISCANNER_AIM_CAMERA
hash_8CB470DF = MELEE_AIM_CAMERA
hash_55801250 = VALKYRIE_TURRET_CAMERA
hash_6B1D0E1A = V_HELI_REAR_LEFT_AIM_CAMERA
hash_EC9F09A4 = V_HELI_REAR_RIGHT_AIM_CAMERA
hash_46773897 = INSURGENT_TURRET_CAMERA
hash_0B8AE78C = INSURGENT_TURRET_FIRE_CAMERA
hash_D569E597 = INSURGENT_TURRET_AIM_CAMERA
hash_3D7FD025 = TECHNICAL_TURRET_CAMERA
hash_BC0E36AF = TECHNICAL_TURRET_FIRE_CAMERA
hash_C9B34C1D = TECHNICAL_TURRET_AIM_CAMERA
hash_4BEFA82E = FROGGER_REAR_LEFT_PASSENGER_AIM_CAMERA
hash_1D884BE3 = BOXVILLE_TURRET_CAMERA
hash_EB0ABD5B = BOXVILLE_TURRET_FIRE_CAMERA
hash_C8E13318 = BOXVILLE_TURRET_AIM_CAMERA
hash_D5F08A9E = SNIPER_FIXED_ZOOM_AIM_CAMERA
hash_8C40FB35 = SNIPER_LOW_ZOOM_AIM_CAMERA
hash_EC22D348 = SNIPER_AIM_CAMERA
hash_D4CFC0B3 = FIRST_PERSON_HELI_REAR_LEFT_PASSENGER_AIM_CAMERA
hash_A5E49969 = FIRST_PERSON_HELI_REAR_RIGHT_PASSENGER_AIM_CAMERA
hash_A70102CA = FIRST_PERSON_SHOOTER_CAMERA
You are amazing thank you! FIRST_PERSON_SHOOTER_CAMERA did work and put me right into first person when aiming however, when not aiming I am having the cameras over lap it looks like.
@a63nt-5m1th Here is what I tried:
When aiming, I am in 1st person. When releasing the aim button the camera bugs out as shown above. I also cannot move the character in that state. Only when I switch cameras or go into cover I can move again.
When aiming while in cover I am in 1st person and when releasing the aim button I am back too 3rd person and can move around. So that part works great. Its that first part that is a bit wonky.
I cannot open the cameras.ymt file in OpenIV to see if anything needs adjusting in their. May I ask how you accessed it?
I used CodeWalker & exported 'cameras.ymt' to 'cameras.ymt.pso.xml' & opened it with a text editor, but you can't edit it & have your changes apply in-game, it's a '.pso' format file that the game will only accept if it is vanilla.
You can open it up & take a look, & often it can be useful, but you can't mod it unfortunately. Afaik, it's not likely that it will ever be editable. The game is somewhat hardcoded to only accept that file as it is & rejects it if it has been edited.
You might, might be able to get something usable out of something like cheat engine. It allows you to edit & change values in memory on the fly. I cover the very basics of using it here in another 'cameras.ymt' related thread, but you should be able to find better & more thorough tutorials for it either on youtube or the web somewhere.
First & Third Person Camera Mashup:
As to your first person camera not disengaging, I'm not confident that will be fixable using game files. I took a look in 'cameras.ymt.pso.xml' at the 'camControlHelperMetadata' for 'FIRST_PERSON_SHOOTER_CAMERA' & found this value:
<ShouldToggleViewModeBetweenThirdAndFirstPerson value="false" />
I suspect you might need to use a camera that has that set to 'true' by default, but they are all either third person, ped follow or vehicle cameras. No first person ones. Maybe tho, a vehicle camera or third person might work to swap between third & first person. I'm not too up on vanilla vehicles, but if you can find a vehicle weapon that defaults to third person, but changes to first person when you hit the aim button, or some third person camera that does the same, that might be something to try out.
Here is the decrypted 'cameras.ymt.pso.xml' file, just in case you don't have CodeWalker installed etc (I advise getting CodeWalker tho (get it from it's Discord, the version on gta5-mods is really old & missing lots of useful functionality) & getting somewhat comfortable with using it, it's very, very useful for these kinds of deep delves into the game )
I also took the liberty of converting the hex hashes listed in previous post into English within that linked file, so it will be a little easier to read & find things than one that has been exported using CodeWalker & has all the names still in hex hash format etc.
camControlHelperMetadata's that have:
'<ShouldToggleViewModeBetweenThirdAndFirstPerson value="true" />'
As you'll notice when you open the file, a lot of stuff will be in hex hash format ('hash_C029A3C9' etc).
You can use OpenIV > 'Tools' > 'Hash Generator' (use 'Hash algorithm: Default' & 'Output format: Hex' for '.ymt' files) to convert English strings into hex hashes, but it's not possible to go the other way (ie hex hash to English).
It means that not all hex hashes can be converted to English very easily. You need to gather clues from other Rockstar naming methods or English strings you can find in other files, enter your guesses/found English strings in the OpenIV Hash generator & then see if the produced hex hash matches up to the one in the file. It's no better than pure guesswork & means more often than not you won't be able to figure out what the English string for something is.
The hex hash produced by OpenIV's Hash generator will output in this format:
you then remove the '0x' at the start & replace it with 'hash_' to convert it to the one the game uses ('hash_A70102CA' in this case). For searches, it's not that vital, just use the 'A70102CA' etc part of the hash to find it's game file equivalent.
What I've covered here should be about all you need to know to work with these kind of files. Often, you don't necessarily need the English name for things, the hex hashes usually do the job, even though they make it a bit harder to remember what is what etc
@a63nt-5m1th I actually do have codewalker but I am not all familiar with it unfortunately. But I will do so research with tutorial videos as much as possible.
Ill get cheat engine as well and try to make some sense of it. Ill be honest, this is a bit over my head but, if there is a will. Am I right?
Ill update when I can, and thank you so much for your help!
I dropped quite a lot of info into the last post. Tried to cover all I thought you would need. Probably, on the surface, looks more complicated than it actually is. Just use it for reference as you're investigating . Basically, you'll be doing the same thing as you have been doing already, testing out different camera strings ('FIRST_PERSON_SHOOTER_CAMERA' etc).
Given you can't edit 'cameras.ymt', unless you find a camera with the functionality you require that already exists, you'll hit a brick wall with game file edits alone. Still worth having a go at it tho. You don't know until you try
@a63nt-5m1th Understood and appreciate the info. Ill update when I can