cardboardbox1230 9 Posted June 19, 2018 (edited) Recoil for Grand Theft Auto: San Andreas This is a script written in LUA, causing weapons to recoil when shot. Works with all weapons that can be aimed. Features: Spoiler Recoil: The crosshair will not stay in the same place when shooting a weapon now. It will move, making it difficult to shoot. There is an option to choose whether the weapon uses the global recoil value, value based on its accuracy, a specific value, even disable recoil for said weapon, or for every weapon except specific weapons! Also an option to choose whether the recoil is upwards, or in any direction. The recoil is independent of in-game mouse sensitivity. Camera shake: The camera will now shake when shooting a weapon. It will shake, making it difficult to shoot. There is an option to choose whether the weapon uses the global camshake value, a specific value, even disable camshake for said weapon, or for every weapon except specific weapon! Fall: There is now a chance to fall when shooting a weapon. It also works with ragdoll. There is an option to choose whether the weapon uses the global fallchance value, a specific value, even disable fallchance for said weapon, or for every weapon except specific weapon! Option to set in percent how much the recoil and camshake decreases when standing still or crouching! Option to set in percent how much the fallchance decreases when crouching! Global Multiplier: The global multiplier multiplies the recoil and camshake values, so you don't have to edit every value manua No crosshair spread: A .lua file provided disabled the game crosshair from spreading. Use it if you think spreading and recoil combined are too difficult. NOTE: Also works with added weapons, but they use the global values if not adapted. Install Instructions: Spoiler Requires MoonLoader: https://gtaforums.com/topic/890987-moonloader/ 1. Download MoonLoader 2. Install MoodLoader (Instruction should be given in MoonLoader Topic) 3. Drag and Drop 'Recoil.lua file into 'moonloader' in GTA SA directory. 4. Drag and Drop 'NoCrosshairSpread.lua' file into 'moonloader' in GTA SA directory, BUT ONLY if you want to disable crosshair from spreading when shooting. Adapting / Editing Weapons Settings: Spoiler Many weapons have been already added in the default .ini file. Follow their examples to add/edit weapons settings. If any help is needed, feel free to send me a PM. Download link: V8 - V7 - V6 - V5 - V4 - V3 - V2 - V1 Credits: Spoiler FYP - MoonLoader gtav_clover - Recoil Script Opcode.exe - Camera Move function memory addresses (Previous mouseMove function was also by him) Deji - Camera IDs table DK22Pac - Plugin-SDK SA structs FYP - RapidFire Example and FFI struct of CWeapon MKKJ - Crosshair spread memory address Oksu - Camera ID memory address Changelog: (Also given in archive) Spoiler To-do: Add better checks for aiming and firing. (Only if bugs appear.) Add a documentation. (Can't do now; still adding more features. Check out ini files instead.) Find a way to make it work with First Person Mod. (Any help would be appreciated.) Make recoil work when auto-aiming. (Honestly, I'm not sure because I don't think anyone who uses auto-aiming would want recoil anyway.) v8: 1. Script completely rewritted. Now it is better, more optimized and cleaner. 2. Settings transferred to an .ini file. 3. Settings are applied as soon as they are edited and the file is saved. 4. Added option to disable camshake when in first-person cameras. 5. Added option to disable fallchance when crouching. 6. Added recoil multiplier for dual-wielded weapons. 7. Recoil does not work when auto-aiming. 8. Added option to set force when falling. It can be either a global value or a weapon-specific value. 9. Added recoil multiplier for weapons using shotgun animations. Only works with auto-recoil. 10. Now auto-recoil is calculated based on a weapon's accuracy, length (fireoffset x) and damage. 11. Added option to disable downwards recoil, removed option to enable only upwards recoil. 12. Added missing camera modes, causing recoil to not work with some camera modes. 13. Changed percentage based values to multipliers. 14. Added globall fallback force multiplier. 15. Added a table to define shotgun animgroup ids for auto-recoil. (Just in case) 16. Added a table to define heavy weapon (like minigun) animgroup ids for auto-recoil. (Just in case) 17. Added a recoil multiplier for heavy weapons. Only works with auto-recoil. 18. The standing still and crouching multipliers work seperately. (Meaning you can either have the standing still or the crouching multiplier in effect at once) 19. Changed auto-recoil trigger from -1 to A. 20. bDisableCrosshairSpread switch now takes effect instantly. 21. Added install instructions. v7: 1. Replaced the mouseMove function with in-game camera movement function. Now it is supported by all operating systems and control types (previously onyl on Windows was supported) 2. Recoil is now completely equal accross all operating systems and control types. 3. Added customizable fallchance decrease when crouching. 4. Replaced bEnableFourWayRecoil with bEnableRecoilInAnyDirection. Enabling it will now cause recoil in infinite random directions.(Previously it was 8 random directions) 5. No longer works with First Person Mod. v6: 1. Added option to choose weapon recoil based on its accuracy. (Looks weird, check out 'Weapon Settings.txt' for more info.) 2. Removed 'NoCrosshairSpread.lua', added option to disable crosshair spread in 'Recoil.lua' v5: 1. Mouse senstivity finally fixed. Previously it was a little inaccurate. 2. Now also works with joystick controls, though recoil is a little bit inaccurate. (At least I think so.) 3. Added option to switch recoil on/off when auto-aiming. v4: 1. Add fallchance and fallchance switch. Fallchance is also compatible with ragdoll. 2. Tried to fix mouse senstivity. 3. Add customizable accuracy increase when standing still. v3: 1. Camshake now also works even if player is not aiming. 2. Fixed mouse senstivity calculation. 3. Fixed a bug causing recoil to work with non-bullet and non-missile weapons (e.g, spraycan, fire extinguisher etc.). 4. Previously, recoil sometimes did not work. Now it will always work. 5. Added customizable accuracy increase when crouching. 3. Added option to choose whether the weapon recoil occurs only upwards or in all directions (four-way recoil). v2: 1. Added camshake and camshake switch. 2. Added option for weapon-specific settings. 3. Added global multiplier. 4. Added mouse senstivity independency for recoil. v1: 1. Added recoil. 2. Added recoil switch. Edited December 9, 2018 by gtav_clover Update Quote Share this post Link to post Share on other sites
thalilmythos 873 Posted June 19, 2018 I did "something like this" in cleo, but this is a whole new level you should make a video about it, but the description for me is convincing enough, downloading Quote Share this post Link to post Share on other sites
B Dawg 9,631 Posted June 19, 2018 (edited) This recoil mod is absolutely perfect. It doesn't automatically reset itself when you stop shooting like in your usual shooter games, and it's highly customizable. Edited June 19, 2018 by B Dawg Quote Share this post Link to post Share on other sites
cardboardbox1230 9 Posted June 19, 2018 (edited) Latest version up. All known bugs fixed. Post if any more bugs are found. Sorry, but I can't make a video. My PC is just too much of a toaster. If someone could make a video, I would appreciate it. EDIT: Tried making a video, I'm surprised my PC didn't explode. Edited June 19, 2018 by gtav_clover Quote Share this post Link to post Share on other sites
Vills SkyTerror 32 Posted June 19, 2018 Good job. I am enjoying these LUA scripts more and more. Quote Share this post Link to post Share on other sites
cardboardbox1230 9 Posted June 23, 2018 Latest version (V5) up. Read the end of post or change log given in download for update. Quote Share this post Link to post Share on other sites
Davve95 272 Posted June 24, 2018 All features sounds pretty cool! I don't know what recoil is though.. Quote Share this post Link to post Share on other sites
LaDiDa 710 Posted June 24, 2018 The bumping around of your crosshair when firing a gun, like kickback due to the force of a shot. Quote Share this post Link to post Share on other sites
cardboardbox1230 9 Posted June 25, 2018 (edited) V6 up. Changelog also given in topic this time. Edited June 30, 2018 by gtav_clover Quote Share this post Link to post Share on other sites
cardboardbox1230 9 Posted June 30, 2018 (edited) V7 up. The biggest update so far! Read the changelog for more info. Edit: I messed up. V7 Reuploaded because I forgot to turn off debug. Please redownload. Edited June 30, 2018 by gtav_clover Sorry for double post. Quote Share this post Link to post Share on other sites
cardboardbox1230 9 Posted December 9, 2018 V8 up. Sorry I was inactive for so long. Quote Share this post Link to post Share on other sites
gardfiel 0 Posted April 20 Cool mod but can you do something to smooth the recoil and add an option for random horizontal recoil. Quote Share this post Link to post Share on other sites