Jump to content

ORMtnMan's Real Guns Mod 1.242 [32.30]


ORMtnMan

Recommended Posts

3 hours ago, Fenris_Wolf said:

Yep, that was the whole point so a M16 (for example) could say load 5.56 FMJ, SP, HP, and JHP, as well as the .223 variants. The code isn't completely finished (only handles internal mags atm) but works, and allows for setting a preferred bullet type so it will only load those instead of mixing w/e the player has on hand.

That's great, so the problem of forced loading ammo you don't want is circumvented.

3 hours ago, Fenris_Wolf said:

On a note, it works though the list in order (instead of randomly picking) so for shotguns it loads the 00 first until the player runs out, then slugs.

This was my concern with lots of ammo types - that after depleting the standard ammo, it would have an issue picking which secondary ammo to select.

Link to comment
Share on other sites

3 minutes ago, TOShok said:

This was my concern with lots of ammo types - that after depleting the standard ammo, it would have an issue picking which secondary ammo to select.

Ya no real issue, atm the table code is basically:

--[[ The Alternate Ammo Table (Global)
    This table defines what ammo can be used as replacements for other ammo. When searching the player 
    inventory to find ammo to load into the gun/magazine, it will search these rounds in order.
]]
ORGMAlternateAmmoTable = {
    ["12gRounds"] = {"12gSlugRounds"},
    ["357Rounds"] = {"38Rounds"},
    ["223Rounds"] = {"556Rounds"},
    ["556Rounds"] = {"223Rounds"},
    ["308Rounds"] = {"7.62x51Rounds"},
    ["7.62x51Rounds"] = {"308Rounds"},
    ["454Rounds"] = {"45ColtRounds"},
}

Since for now there's only a single replaceable type (ie: 12gRounds and 12gSlugRounds) there's only one entry in each. I'll probably rename the ammo so the old 12gRounds is actually a generic term (actually I'll probably name it Ammo_12g or similar) thats just a dummy placeholder item and have the buck and slugs as Ammo_12g_00Buck and Ammo_12g_Slug. In the weapon's .txt files for the AmmoType would simply read Ammo_12g, and the table entry above would look more like:

["Ammo_12g"] = {"Ammo_12g_00Buck", "Ammo_12g_Slug"}

But selecting the ammo from the table works from left to right...ofc you can set the preferred ammo at any point to bypass alternate ammos, and it wont unload whats currently in there, so you could load a shotgun half full of buck, then set it to slugs. I played around last night loading a 870 mixed Buck, Slug, Buck, Slug, Buck, then racking it til it was empty and watching all the rounds drop onto the floor in order.

 

Link to comment
Share on other sites

40 minutes ago, Fenris_Wolf said:

Since for now there's only a single replaceable type (ie: 12gRounds and 12gSlugRounds) there's only one entry in each. I'll probably rename the ammo so the old 12gRounds is actually a generic term (actually I'll probably name it Ammo_12g or similar) thats just a dummy placeholder item and have the buck and slugs as Ammo_12g_00Buck and Ammo_12g_Slug. In the weapon's .txt files for the AmmoType would simply read Ammo_12g, and the table entry above would look more like:


["Ammo_12g"] = {"Ammo_12g_00Buck", "Ammo_12g_Slug"}

But selecting the ammo from the table works from left to right...ofc you can set the preferred ammo at any point to bypass alternate ammos, and it wont unload whats currently in there, so you could load a shotgun half full of buck, then set it to slugs. I played around last night loading a 870 mixed Buck, Slug, Buck, Slug, Buck, then racking it til it was empty and watching all the rounds drop onto the floor in order.

 

Nice. I wonder how much I'll screw it up before I get adding stuff to it right though. XD 

 

Link to comment
Share on other sites

Initial Upload of v2.0 alpha https://github.com/FWolfe/RealGunsMod

 

Main features:

Bullet Penetration is no longer true/false, but a percentage chance.

HP and FMJ bullets added, with different attributes: HP does more damage, but less penetration then FMJ.

Guns can mix loads of various supported ammo types.

'Shoot self' option to cure infection

Reduced spawn ratio of firearms and ammo on corpses.

 

Full changelog:

Spoiler

version 2.00alpha

Changes of Note:

* Complete code rewrite and cleanup.

* Many corrections and bug fixes.

* Added FMJ and HP versions of each round, with different stats

* Conversion of guns to full-auto/semi-auto, pump/semi, and ammo conversions are no longer required.
    Previously every gun had its own variation, on conversion the old gun was removed and replaced with
    the new variant.

* Guns can now be loaded with multiple ammo types at the same time. A 5.56 rifle can now have 5.56 FMJ,
    5.56 HP, .223 FMJ and .223 HP all in the same magazine. This applies to other guns as well
    (ie: mixing buck and slugs in shotguns)

* Bullet penetration is no longer a simple true/false dependant on the gun item. Its now based on a %
    chance, dependant on the bullet type (HP rounds have low chance of penetration while FMJ is higher),
    rechecked every round fired. Ideally this should check on every hit (ie: passing through multiple
    zombies) but its better then nothing.

* Gun damage is now dependant on the bullet type loaded. FMJ have a lower min damage, while HP is higher.

* The tooltip on inventory items now specifies what ammo type is currently loaded in a gun or magazine,
    and what fire mode (Full/Semi) a gun is currently using.

* Shotguns with buckshot loads now have a chance of missing.

* When reloading a revolver, if there are empty shells in the cylinder the entire cylinder contents are
    dumped out and all cylinder spots must be reloaded. You can not just replace the empty shells.

* Unloading bullets from magazines places rounds in inventory. Unloading from a gun drops rounds on the
    ground (from racking the slide, or dumping out the cylinder)
   
* Context menu has been added to set a preferred ammo type on guns and magazines.
    (ie: load only 5.56 FMJ). This can be set to "Any" (loads any available ammo),
    any bullet type the gun is capable of using, or "Mixed Load" to specifically
    mix ammo in the magazine.

* Context menu has been added for manually cocking/releasing the hammer, or opening/closing the slide/bolt.

* Context menu has been added for spinning the cylinder on rotary guns (ie: revolvers)

* Context menu has been added for shooting yourself in the head, curing infection so your corpse doesn't
    come back as a zombie.  Note if done with a partially loaded revolver (russian roulette) it cures
    boredom as well.
   
* Code is now called when pulling the trigger on a gun that won't fire (unloaded etc). This will properly
    drop the hammer, or in the case of doubleaction revolvers: cock, rotate and release.

* Speed Loaders and Stripper Clips have been separated from magazines and act independently.

* Clients on 'Easy Reloading' settings are effectively set to 'Normal'. This is a REAL GUNS MOD. Real guns
    have magazines.



Changes for modders and editors:

* All lua files have been rewritten and documented for maintainability. Much redundant repetitive code and
    tables have been removed.

* Ammo has been renamed, using a new naming scheme: Ammo_<caliber>_<bullet_type>

* Ammo now has dummy generic rounds for each type. These dummy rounds are named simply Ammo_<caliber> without a
    bullet type (ie: Ammo_223Remington is the dummy round, Ammo_223Remington_FMJ and Ammo_223Remington_HP are real
    rounds). These dummy rounds should never be spawned or accessible to players. They do not have boxes or cans.
    However, when adding magazines or firearms, these dummy rounds should be used as the AmmoType instead of the
    real rounds.

* Weapon damage and other attributes are now determined by the current round in the chamber, instead of the definitions
    in the .txt files. (see ORGMWeaponData.lua, ORGMAmmoStatsTable)

* ORGMDistributions.lua is now actually manageable. There is no longer a need to build guns or ammo tables. Or the
    WeaponsUpgrades table. These are now built automatically on loading the script using data from ORGMWeaponData.lua

* All weapon classes have been merged into a single class: ISORGMWeapon
    Guns are now defined by several properties that dictate how they handle:
    actionType - Auto, Lever, Rotary, Pump, Bolt, Break (barrel)
    triggerType - SingleAction, DoubleAction, DoubleActionOnly


* Overridden functions:
    ISUI/ISToolTipInv:render()
    Reloading/ISReloadManager:checkLoaded()
    Reloading/ISReloadManager:startReloadFromUi()
   
    *Reloading/ISReloadManager has several new functions injected into it.


********************************************************************************************************
TODO:
* server side configuration .ini file to set various loot frequency per container type, and forced reloading difficulty
* tie item spawning into server frequency settings
* fix speedloaders and stripperclips
* add empty shells
* add more guns and ammo types!

 

I should mention this is NOT server ready yet (or any SP game you care about).  Theres a few things that I still need to fix (speedloaders, break barrels) and it still needs more extensive testing to weed out any hidden bugs. Its also going to be going through multiple daily changes for the next little while, but figured I'd post it for people who want to check it out.

 

Screenshots showing the new context menus and tooltips:

Spoiler

Setting a ammo preference

5.thumb.jpg.c06913bf584c72f770d58b033cdac6b9.jpg

 

Gun tooltip showing current fire mode and loaded ammo (HP and FMJ mixed load in magazine)

4.thumb.jpg.1d044943401975aabad590ae359a1965.jpg

 

Magazine tooltip showing that FMJ rounds are loaded:

6.thumb.jpg.fcf499570dde62e84434bda2b5513b70.jpg

 

 

Link to comment
Share on other sites

8 hours ago, Fenris_Wolf said:

'Shoot self' option to cure infection

 

Please add an option for this where if you have the unlucky trait you just end up wounding yourself.

 

Besides that, thanks for the update, am very eager to try it out!

 

*Edit* I might be being dumb, is this to be merged with the original mod files? I've tried launching the mod and don't appear to have anything spawn.

Edited by Khaos
Link to comment
Share on other sites

2 hours ago, Khaos said:

*Edit* I might be being dumb, is this to be merged with the original mod files? I've tried launching the mod and don't appear to have anything spawn.

Its a complete rewrite, shouldn't be used in saves where the original version was loaded, and the original mod should be removed as the rewrite changed some file names and removed redundant ones.

Spawn rate on zombie corpses is drastically reduced, atm its about a 2% chance, I'm going to make it more configurable and respawn to server loot settings eventually.

 

Link to comment
Share on other sites

11 minutes ago, Fenris_Wolf said:

Its a complete rewrite, shouldn't be used in saves where the original version was loaded, and the original mod should be removed as the rewrite changed some file names and removed redundant ones.

Spawn rate on zombie corpses is drastically reduced, atm its about a 2% chance, I'm going to make it more configurable and respawn to server loot settings eventually.

 

 

Scratch last, it is functioning. I do still have the base game weapons spawning so I'll need to see if I have some other phantom mod installed causing that.

Edited by Khaos
Link to comment
Share on other sites

15 minutes ago, Khaos said:

Scratch last, it is functioning. I do still have the base game weapons spawning so I'll need to see if I have some other phantom mod installed causing that.

 

Ya the base stuff shouldn't be spawning,  I should mention this hasn't been tested on vehicle build (I got my copy from GOG) and still have to update to built 38.28 (which I'll do later today).  But base stuff still shouldn't spawn unless something else is readding them.

Also if you want to change the spawn rates its fairly easy now, edit the media/lua/server/ORGMDistribution.lua starting at line #357

 

    if roomName == "all" and containerType == "inventorymale" then
        if Rnd(100) <= 2 then AddToCorpse(container) end -- 2% chance of a gun + ammo
    elseif roomName == "all" and containerType == "inventoryfemale" then
        if Rnd(100) <= 2 then AddToCorpse(container)  end -- 2% chance of a gun + ammo
    elseif roomName == "bedroom" and containerType == "wardrobe" then
        if Rnd(100) <= 30 then AddToCivRoom(container) end -- 30% chance to call the function. Note the function also has its own % chances to spawn each item

 

Link to comment
Share on other sites

3 minutes ago, Fenris_Wolf said:

 

Ya the base stuff shouldn't be spawning,  I should mention this hasn't been tested on vehicle build (I got my copy from GOG) and still have to update to built 38.28 (which I'll do later today).  But base stuff still shouldn't spawn unless something else is readding them.

Also if you want to change the spawn rates its fairly easy now, edit the media/lua/server/ORGMDistribution.lua starting at line #357

 

I think it's on my end somewhere with another lootspawning mod so I'll give a clean run in a second.

 

I have noticed two things so far, the unload magazine is named 'Reload' (or the reload action when a magazine is in ejects the mag). And I do no longer need to have the ammunition and the magazine in my hands to load a mag is this intended?

Link to comment
Share on other sites

2 minutes ago, Khaos said:

I have noticed two things so far, the unload magazine is named 'Reload' (or the reload action when a magazine is in ejects the mag). And I do no longer need to have the ammunition and the magazine in my hands to load a mag is this intended?

Mags don't need to be in hand (they didn't in the previous version either) it wouldn't work well with the new system anyways (ie: setting the mag to use a 'mixed load' of random bullet types), and ya the eject magazine is still showing as Reload, I'll add that to my list of things to fix.

Link to comment
Share on other sites

7 minutes ago, Fenris_Wolf said:

Mags don't need to be in hand (they didn't in the previous version either) it wouldn't work well with the new system anyways (ie: setting the mag to use a 'mixed load' of random bullet types)

 

That is something I did not think about, makes sense.

 

I have now run with it with no other mods and I am still seeing vanilla weapons and this is on Steam 38.28 and playing in Rosewood. 

 

On a positive note, I'm already loving the new features. They work very well.

Edited by Khaos
Link to comment
Share on other sites

13 minutes ago, Khaos said:

I have now run with it with no other mods and I am still seeing vanilla weapons and this is on Steam 38.28 and playing in Rosewood. 

Thats strange, the removal code is actually probably the only code I didn't rewrite from the original.  I'll investigate that when I update to 38.28 later today and take a closer look to see whats breaking it.

Also, the Insert/Eject magazine context menu is now fixed, and the changes have been pushed to github.

Link to comment
Share on other sites

Is it now ready for me to start pulling the weapon files you've got out to start making my set of them, or is it still subject to change?

It reminds me I was going to look up some other ammo types too, things like flechettes for shotguns, AP and the like.

(Think I'd get away with adding DU rounds as military only? ;p)

Link to comment
Share on other sites

1 minute ago, TOShok said:

Is it now ready for me to start pulling the weapon files you've got out to start making my set of them, or is it still subject to change?

Yes, and yes, very much still subject to change, this was just the initial code alpha upload of the new codebase. Theres lots to add still I have a pile of weapon and ammo icons that OrMtnMan had for his devel version, as well as extended magazines and such. The Icons used for weapons and mags will be renamed (to provide order to the texture folder).

Some stats that were defined in the weapons .txt files like MinDamage, MaxDamage and PiercingBullets are now defined in the ORGMAmmoStatsTable (ORGMWeaponData.lua), and the defaults defined in the weapon .txt files are overridden when a new round is loaded.

 

Other then that though, I'm not sure much of the current weapons that are in the txt files will change much but I cant really say for sure since the whole thing is in testing phase.

Link to comment
Share on other sites

1 minute ago, Fenris_Wolf said:

Yes, and yes, very much still subject to change, this was just the initial code alpha upload of the new codebase. Theres lots to add still I have a pile of weapon and ammo icons that OrMtnMan had for his devel version, as well as extended magazines and such. The Icons used for weapons and mags will be renamed (to provide order to the texture folder).

Some stats that were defined in the weapons .txt files like MinDamage, MaxDamage and PiercingBullets are now defined in the ORGMAmmoStatsTable (ORGMWeaponData.lua), and the defaults defined in the weapon .txt files are overridden when a new round is loaded.

 

Other then that though, I'm not sure much of the current weapons that are in the txt files will change much but I cant really say for sure since the whole thing is in testing phase.

What I will likely do when given time then is grab your github copy and tear it apart looking at where everything is, then start plugging in piles of weapons and see if it works.

I haven't grabbed any icons for weapons ammo etc not already in the mod though, that will be a project to come.

Link to comment
Share on other sites

6 minutes ago, TOShok said:

What I will likely do when given time then is grab your github copy and tear it apart looking at where everything is, then start plugging in piles of weapons and see if it works.

Pretty much everything of note is in the shared/ORGMWeaponsData.lua which is basically a majorly reworked version of the old ORGMReloadUtil files.

It contains all the weapon, magazine and ammo tables.  I need to update the documentation comments in that file to match the latest changes though.  Also theres no need to define weapons, mags or ammo in the ORGMDistrubution.lua file anymore, its all read from tables in the ORGMWeaponsData file (I hate having to define stuff in multiple places)

Link to comment
Share on other sites

9 minutes ago, Fenris_Wolf said:

Pretty much everything of note is in the shared/ORGMWeaponsData.lua which is basically a majorly reworked version of the old ORGMReloadUtil files.

It contains all the weapon, magazine and ammo tables.  I need to update the documentation comments in that file to match the latest changes though.  Also theres no need to define weapons, mags or ammo in the ORGMDistrubution.lua file anymore, its all read from tables in the ORGMWeaponsData file (I hate having to define stuff in multiple places)

Nice, my self made instruction/template sheet was pretty long haha.

Link to comment
Share on other sites

I might, that being the key word here might attempt to make some weapon models considering in PZ they don't need a lot of detail. I wanted to way back when and now hopefully I'll have the time. I shall start investigating.

 

If anyone has some PZ specific guides to point me to fire away.

Link to comment
Share on other sites

So as I have it with the not duplicating items, the only things being listed twice are shotguns available in both full barrelled and sawed off states - as this shouldn't be changed at any point currently and is just the way the gun is, I'm listing them as separate weapons. Do you suggest I do it differently, or is this a good (enough) way to handle this? The option could always be looked into later as to if you could saw off those weapons with a hacksaw or something.

Link to comment
Share on other sites

9 minutes ago, Fenris_Wolf said:

They should remain separate. Theres alot of stats that change when that happen, including weight, display name and possible weapon mods. Its also a permanent conversion.

Yeah, that was my reasoning - good that I'm not being dumb. :P

Also starting to dig into WeaponData - am I right in thinking that Auto action type is for weapons that eject and load from firing? If so, I can't think of any weapons that would be Auto and Single Action - cocking the weapon happens automatically during the cycling... but then I'm sure there's one somewhere. (Though quite a few would be Double Action, with the ability to lower and cock manually, I suppose.) Just asking because it's listed in the start of the file as a setting.

Edited by TOShok
Link to comment
Share on other sites

2 minutes ago, TOShok said:

am I right in thinking that Auto action type is for weapons that eject and load from firing? If so, I can't think of any weapons that would be Auto and Single Action - cocking the weapon happens automatically during the cycling...

 

yes...and theres TONS...the Colt M1911 the most obvious example.  Cocking does automatically fire during cycling, but the key point that makes it a single action is: the gun wont fire unless its cocked. The trigger will not move the hammer back into the cocked position. As listed in the comments above the GunTypes table:

 

    Note: the 3 trigger types do NOT realistically account for all trigger/hammer/firing pin types,
    but are sufficient enough code wise. For effective purposes, they are handled as such:
   
    SingleAction - Requires a cocking motion (manual or automatic) before striking a chambered round.
        Can be cocked and safely released manually.
       
    DoubleAction - Can be fired from a uncocked position, but can be cocked and safely released manually.
   
    DoubleActionOnly - No manual cocking or releasing allowed.
 

Link to comment
Share on other sites

3 minutes ago, Fenris_Wolf said:

    SingleAction - Requires a cocking motion (manual or automatic) before striking a chambered round.
        Can be cocked and safely released manually.
       
    DoubleAction - Can be fired from a uncocked position, but can be cocked and safely released manually.
 

Ah I see. I just got a little confused about the difference between the two - I saw both are possible to be manually operated, and Double automatically cocks. Got that now.

Going through doing the ammo variants now, I haven't seemed to find anything troublesome yet.

If it is of interest, I've put in the list of weapons I had collated to the ORGM list, that was an easy bit. If you want to look it over, I'll attach it, but I don't think there'll be problems with that bit. (I am aware that its one entry per line, I will remove the line breaks later but it was easier for me to be writing in entries line by line - less confusing to look at if I lost where I was.)

ORGM.lua

Link to comment
Share on other sites

6 minutes ago, Fenris_Wolf said:

Wow thats quite a list, you have the models and textures for all of those?

I have icons and such for them, not the models and textures - I intended to get them in and working, rip out any that just don't work with the mod if there are any, then look at how many will effectively be the same model. Once I know what models to get/make, then I'll start on that - most likely, I'll get the mod working with them all while just using existing models as fill ins for everything first - no point collating all the models if some will be unnecessary and others will be excessively similar to ones that will already be in. (Aside from this, the mod as of ORMtnMan's last update still was missing models for most current weapons, so it's something that would have to be a concerted effort to fill regardless.)

TL;DR - no, I just don't want to do waves of additions because that can get messy and inconsistent, appearance after function is my current direction.

Edited by TOShok
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
×
×
  • Create New...