Jump to content

[SA] Dynamic Weapon Styles - a concept, and plea for help


Recommended Posts



The Concept:


The other day I had an awesome idea: Would be cool and useful if we could switch weapon wielding styles ingame!


Let's say I'm using a Desert Eagle, but I'm in a position where I just want run to the next cover and hurl big ass bullets at whatevers popping up on the way.


Or let's say I have a MicroUZI, modified to it's real-life RoF, but instead of a ganxta spray 'n pray, I want to hold it more secure (two handed, like MP5 at shoulder) and use it like a "MiniGun light". :D


Or I have a Silenced Pistol, but want to dual-wield it for real close quarters fighting, then later on just switch back to a more tactical stance. You get the idea...




Possible Solutions:


Now, my first approach was this: Disable weapon stat increase (easy: ar_stats.dat file), edit all gun related lines for these specific styles, and assign a specific weapon skill level to each. Then have an ingame UI where you can select your style based on your weapon. These options could come from a cfg file, where option labels and values (integers) would be paired:





RapidFire: 101 // Holds gun at the hip: less accurate, but faster rate of fire

Tactical: 201 // Shoulders gun for an increase in accuracy, but with reduced rate of fire




Selecting the option would set the weapon's skill level to exactly the related value (like 101 or 102), triggering anim and weapon behaviour switch. The problem with this is that this would affect NPCs aswell, since they use the pre-defined weapons just like the player, except for PISTOL ("9mm" or "Colt45") where there is a cop version available for cops.



Now, here is my other idea: have extra three levels defined for all weapons, with weapon levels and skills outside the normal values, so we could never affect NPCs with it. The question is: is it possible to freely have and use such weapons? See my cfg example for PISTOL SILENCED:




$ PISTOL_SILENCED    INSTANT_HIT    25.0 30.0    347    -1        2    silenced    17     40        0.40  0.05  0.15    0  0    1.0  1.0      6 20  6     6 20  6  40    7001
$ PISTOL_SILENCED    INSTANT_HIT    30.0 35.0    347    -1        2    silenced    17     40        0.40  0.05  0.15    1  500    1.25 1.2      6 18  6     6 18  6  40    7011
$ PISTOL_SILENCED    INSTANT_HIT    35.0 35.0    347    -1        2    silenced    17     40        0.40  0.05  0.15    2  999    1.5  1.5      6 17  6     6 17  6  40    7031
# PISTOL SILENCED: One-Handed wield: +RoF, -accuracy, can fire while running
$ PISTOL_SILENCED    INSTANT_HIT    25.0 30.0    347    -1        2    colt45    17        40        0.40  0.05  0.15      3    1001    0.85  1.0      6 16  6     6 16  6  40    3033

# PISTOL SILENCED: Dual-Wield: +RoF, -accuracy, double the fun
$ PISTOL_SILENCED    INSTANT_HIT    25.0 30.0    347    -1        2    colt45pro    34    40        0.40  0.05  0.15      4    1002    1.25  1.0      6 13  6     6 13  6  40    3833

# PISTOL SILENCED: Steady grip: +accuracy, -RoF, a more tactical approach
$ PISTOL_SILENCED    INSTANT_HIT    25.0 30.0    347    -1        2    silenced    17    40        0.40  0.05  0.15      5    1003    1.85  1.0      6 18  6     6 18  6  40    7031




As you can see, I added the extra "styles" with weapon levels 3, 4 and 5 (normal "Hitman" level is 2) and with 1001, 1002 and 1003 assigned to them as weapon stat points, from where they would be activated. Keep in mind that weapon leveling would be disabled, so you couldn't get from let's say 1001 to 1002 by firing some bullets!


My game starts and runs alright, and using this weapon shows normal behaviour. - But ofcourse normally I can't reach weapon stats over 999!


So now I just want to know if there is an opcode or some other clever thing that would allow us to set our weapon's stat to these desired levels.


So TL;DR: the functioning would look like this:

Press a button, let's say ("K"): check current weapon -> look for weapon in dynamic_weapon_styles.cfg:




One-Handed: 1001

Dual-Wield: 1002

Sharpshooter: 1003



Display these labels in a mini UI / popup: player selects one style and it's value (int) is set as that weapon's skill stat.


This way CJ could freely switch between different stances / styles based on the situation, without affecting the normal skill levels distributed over NPCs.


If it would cause a problem with cars or jetpack (SMG / driveby), there could be a "safe-switch": We could revert to a normal (default) style when occupying such vehicle.


I'm new to CLEO scripting, but been fiddling with configs for a long time now. If someone would like to realize this mod, I would be willing to take the config part.


Tell me what do you think.


Thanks and Cee Ja!





Edited by Papayamamba
typo, code
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.