ORGM Rechambered
6 6

112 posts in this topic

Recommended Posts

As some of you know, ORMtnMan stopped development of the Real Guns Mod some time ago, but didn't want his work to goto waste.

After much hammering away on the keyboard, and testing on poor defenseless zombies I feel its now safe to officially present the results.  This brings a number of new features and fixes to ORGM.

Full list of changes in spoilers:

Spoiler

* Complete code rewrite and cleanup.

* Many corrections and bug fixes.

* Weapon and ammo spawn rates reduced, and now obey sandbox weapon loot rarity 
  settings.

* Distant gunshot sounds now properly play in MP again.

* 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 dependent on the gun item. 
  Its now based on a % chance, dependent 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 dependent 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.

* Increased durability of all firearms, especially revolvers.

* Guns now have a chance of jamming based on weapon condition. Racking the gun 
  clears the jam. Revolvers and break barrels are not susceptible to jamming. Easy 
  and Normal difficulty will auto rack to clear. At any rate, the jammed round will 
  fall to the floor. This is affected by the lucky/unlucky traits.

* 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)
    
* Guns now litter the ground with empty shells when firing. These can be collected, 
  boxed or put in canisters like normal rounds.
    
* 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, 
  jammed, 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, a gun can use both. (Lee Enfield No4)

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


 

Current Version: 2.02 Stable

Tested PZ Versions: 37.14,  38.28, 38.30

 

Current Compatibility:

PZ IWBUMS Versions: Unknown, I got my PZ from GOG not Steam. If something breaks, It will probably remain broken til the next stable release

 

Necroforge & Survivors Mod: Fully compatible (built-in patch)

 

Any other mods/addons for the legacy ORGM version are not considered compatible. Expect errors if you use them.

 

Notes for editors, modders, compatibility patch writers:

Spoiler

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, ORGMMasterAmmoTable)

* 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.


---------------------------------------------------------------------------------------
Integrating into your mod, creating addons and compatibility patches:

    I've attempted to make compatibility as easy as possible.  All weapon, magazine, ammo and weapon upgrade information is in the ORGMWeaponData.lua file, in global tables that can be accessed from your mod. Tables of note:

    ORGMAlternateAmmoTable
this table contains a list of 'dummy rounds' keys and actual ammo that should be used in its place. For example:
["Ammo_556x45mm"]   = {"Ammo_556x45mm_FMJ", "Ammo_556x45mm_HP", "Ammo_223Remington_FMJ", "Ammo_223Remington_HP"}
Shows that any gun/magazine that has its AmmoType as Ammo_556x45mm can fire any of the above rounds.
   

    ORGMMasterAmmoTable
this table contains all real ammo, and its stats. It can be used to get a list of all the ammo in ORGM:
for ammoType, ammoData in pairs(ORGMMasterAmmoTable) do
    ...
end


    ORGMMasterMagTable
this table contains all the magazines, and its stats. It can be used to get a list of all the magazines in ORGM:
for magType, magData in pairs(ORGMMasterMagTable) do
    ...
end


    ORGMMasterWeaponTable
this table contains all the guns, and its stats. It can be used to get a list of all the guns in ORGM:
for gunType, gunData in pairs(ORGMMasterWeaponTable) do
    ...
end


    ORGMRepairKitsTable
this table contains a list of all repair kits available:
for index, repairType in ipairs(ORGMRepairKitsTable) do
    ...
end


    ORGMWeaponModsTable
this table contains a list of all repair kits available:
for index, modType in ipairs(ORGMWeaponModsTable) do
    ...
end


    media/lua/shared/ORGMUtil.lua
this file contains helper functions that can be called from your mod. These functions are subject to change over time, but the 2 more useful ones are:

ORGMUtil.findBestMagazineInContainer(magazineType, preferredType, containerItem)
and
ORGMUtil.findAmmoInContainer(dummyName, preferredType, containerItem)

These 2 function help when finding ammo using ORGM's alternate ammo system.
See the documentation comments in ORGMUtil for more information.
 

 

Downloads:

(Note: if upgrading from Beta-rc5 or lower, unload all guns to clear empty shells in chamber/cylinder) before applying this update or you will run into errors.)

Current Release 2.02 Stable:  https://downloads.tekagis.ca/ProjectZomboidMods/ORGM.zip

Github Development Version: https://github.com/FWolfe/RealGunsMod

Steam Workshop (thanks to Khaos & ORMntMan): https://steamcommunity.com/sharedfiles/filedetails/?id=514618604

 

Survivors Mod Compatibility Patch:  Obsolete, Compatibility is now built in.

 

You MUST delete the old ORGM from your mods directory before installing or you'll probably run into some serious issues.

 

Edited by Fenris_Wolf

Share this post


Link to post
Share on other sites

Once you have finalised and released a "finished" version is a Steam release in some way something we might see? Like having OrmatnMan update his original upload (provided it's acceptable between the both of you) or have some third party upload it? I only ask purely for the ease it gives to Steam users in joining modded servers. If not that's completely understandable as you don't use it, just eager to know.

Share this post


Link to post
Share on other sites

I would be willing to add anyone as contributors or whatever it is called on the mod on steam so they can update themselves.

 

Your choice though but say the word and I will... after you add me on steam that is.

Share this post


Link to post
Share on other sites

I have no issues with it being uploaded to steam, but personally I have a mixed love/hate relationship with them. I'll spare you guys the long winded praise/rant/manifesto on why, but the short version is:

If someone wants to handle the steam side of things that's fine, but unfortunately it wont be me doing it.

Share this post


Link to post
Share on other sites

I've come across an error unfortunately (given I'm on the previous version) but I was using the M3 Super on pump mode and all of a sudden when reload the weapon emptied itself and two different types of buckshot came out (one being an original or possibly a dummy round?) and now I can no longer load it.

Share this post


Link to post
Share on other sites
8 minutes ago, Khaos said:

I've come across an error unfortunately (given I'm on the previous version) but I was using the M3 Super on pump mode and all of a sudden when reload the weapon emptied itself and two different types of buckshot came out (one being an original or possibly a dummy round?) and now I can no longer load it.

interesting, dont suppose you saved the console stack trace messages? Would help tracking it down.

 

Edit: even more helpful, in the media/lua/client/UI folder is the file ISORGMMenu.lua, around line 200 or so (not sure if your using the previous version) is:

 

        --context:addOption("* Debug Weapon", item, OnDebugWeapon, playerObj, data, reloadable)
        --context:addOption("* Test Function", item, OnTestFunction, playerObj, data, reloadable)
        --context:addOption("* Reset To Defaults", item, OnResetWeapon, playerObj, data, reloadable)

 

remove the -- from the 'debug weapon' and 'reset to defaults' functions....the debug will print the weapon stats to the console log, reset to defaults will fix any errors

Edited by Fenris_Wolf

Share this post


Link to post
Share on other sites
1 hour ago, Khaos said:

Will try get on it as soon as possible.

No rush...I'm giving the weapon class a workover now (few issues unloading breakbarrels).

You didn't by chance have the survivors mod loaded did you? Its not fully compatible, it doesn't understand the new ammo system and uses the dummy rounds...it also doesn't properly track the rounds in the magazine with the new system which sometimes leads to errors when getting guns from dead survivors. I'm adding some fixes in now so whenever a dummy round is inserted, fired or unloaded its converted to a FMJ version.

That M3 that gave you issues is kinda bugging me I'm pushed over a thousand rounds through that one already without issue, not in pump mode though but honestly there isn't any difference. For the record you can tell if you got a dummy round the name in inventory will simply be:

'12 Gauge shells' instead of '00Buck 12 Gauge shells'.  Same with other bullets the real rounds will all be labelled FMJ or HP, if its missing the bullet type you somehow ended up with a dummy.

 

EDIT:  I should ask, what reloading difficulty settings are you playing at?

Edited by Fenris_Wolf

Share this post


Link to post
Share on other sites
2 hours ago, Fenris_Wolf said:

No rush...I'm giving the weapon class a workover now (few issues unloading breakbarrels).

You didn't by chance have the survivors mod loaded did you? Its not fully compatible, it doesn't understand the new ammo system and uses the dummy rounds...it also doesn't properly track the rounds in the magazine with the new system which sometimes leads to errors when getting guns from dead survivors. I'm adding some fixes in now so whenever a dummy round is inserted, fired or unloaded its converted to a FMJ version.

That M3 that gave you issues is kinda bugging me I'm pushed over a thousand rounds through that one already without issue, not in pump mode though but honestly there isn't any difference. For the record you can tell if you got a dummy round the name in inventory will simply be:

'12 Gauge shells' instead of '00Buck 12 Gauge shells'.  Same with other bullets the real rounds will all be labelled FMJ or HP, if its missing the bullet type you somehow ended up with a dummy.

 

EDIT:  I should ask, what reloading difficulty settings are you playing at?

 

No survivors mod running, the ammo definitely read '12 gaueg shells' and I was on hardcore reloading. I used other weapons but it's like that M3 has just ceased to function. I will head to the police station and get another to see if that specific weapon is broken.

Share this post


Link to post
Share on other sites

That really shouldn't be happening then if survivors isn't loaded, uncommenting those 2 lines in ISORGMMenu.lua is probably the best bet, as well as updating the mod from that older version although later today I should be releasing a new beta version.  Either way it shouldn't break your saves.

At any rate, if you uncomment those lines, the "Reset to default' context menu will do exactly what it says on the tin (I created it when testing so I didn't have to respawn new guns everytime i broke something or updated the mod)

The "Debug Weapon" context menu will print to the console:

Spoiler

(a fully loaded M3 in pump mode)

triggerType == DoubleActionOnly
actionType == Pump
roundChambered == 1
emptyShellChambered == 0
containsClip == nil
maxCapacity == 7
currentCapacity == 7
isOpen == 0
hammerCocked == 0
lastRound == Ammo_12g_00Buck
preferredAmmoType == nil
loadedAmmo == Ammo_12g_00Buck
magazineData #1 = Ammo_12g_00Buck
magazineData #2 = Ammo_12g_00Buck
magazineData #3 = Ammo_12g_00Buck
magazineData #4 = Ammo_12g_00Buck
magazineData #5 = Ammo_12g_00Buck
magazineData #6 = Ammo_12g_00Buck
magazineData #7 = Ammo_12g_00Buck
 

(a empty M3 in pump)

triggerType == DoubleActionOnly
actionType == Pump
roundChambered == 0
emptyShellChambered == 0
containsClip == nil
maxCapacity == 7
currentCapacity == 0
isOpen == 0
hammerCocked == 0
lastRound == Ammo_12g_00Buck
preferredAmmoType == nil
loadedAmmo == nil
magazineData #1 = nil
magazineData #2 = nil
magazineData #3 = nil
magazineData #4 = nil
magazineData #5 = nil
magazineData #6 = nil
magazineData #7 = nil
 

 

Edited by Fenris_Wolf

Share this post


Link to post
Share on other sites

v2.00-beta-rc2 is up

dummy rounds that somehow make their way into guns or the inventory are converted to FMJ (or buck) on reloading/unloading or chambering.

fix for bug introduced in beta-rc1 that stupidly spawned ammo and guns in school lockers <_<

recipes added to convert any vanilla ammo spawned by other mods to ORGM ammo

Share this post


Link to post
Share on other sites

2.00-beta-rc3 is up

Reworked some parts to make it easier to incorporate ORGM compatibility into other mods.

Added a patch for the Survivors mod so NPCs can use the new ORGM ammo system.

Fixed rare occurrence gun/magazine spawning bug when a player spawns on a brand new map in the gunshop/police station and getPlayer() returns nil when filling out containers

 

Share this post


Link to post
Share on other sites

Oh man I"m definitely looking forward to testing this out! looks great from what I've read and I'm straight up excited haha. I'm curious if you'll be making a compatibility patch for hydrocraft's ammo crafting system and hunting? There is one on steam that does the ammo crafting but I'm not sure if it'll work with the new update/ If not that's fine too, maybe ill work on it in my free time if that's okay with you? of course my free time now a days is extremely limited lol :P

Share this post


Link to post
Share on other sites

A hydrocraft patch has defiantly been on my mind, its alot of work though the way the hunting system currently works.  Several functions need to be overritten (easy enough) the tedious part though is all the hunting recipes (every game type * every gun * every possible bullet the gun uses = alot of recipes).  I was planning on saving it until after I can officially call v2.00 stable, and probably write a script to fill out automatically all the recipes (useful for maintaining the patch once more guns and ammo start to get added).  The old ammo crafting patch won't work.

 

If you wanted to work on it of course that's fine, people should feel free to do whatever they like with the new code base: compatibility patches, or including parts of the code in their own mod (as long as credit is given). The current models and icons are all from ORMntMan's version so use of those is up to him (those wouldn't be needed for the hydrocraft patch though)

 

 

Share this post


Link to post
Share on other sites

yeah it definitely is a ton of work, honestly I may just worry about the ammo crafting and not hunting and leave the hunting to the vanilla weapons lol. however my OCD wouldn't allow that :I . Im actually working on a text document coming up with a more realistic way to craft ammo including your new types (FMJ and HP rounds) I'm going to be working on art tonight for the new items. I do however need to have a chat with hydro though and see what he thinks of my ideas. Hopefully this idea will run smoothly though lol

Share this post


Link to post
Share on other sites

I was tempted to do a addon Reloading mod, using a reloading press, primer tool & scales, and adding boxes of primers and bullets, reusing spent shells from firing, but I haven't decided 100% if I want to yet as its kinda straying off topic. Plus for some of us trigger happy types the number of ejected shells that would end up littering the map would be pretty extreme (until someone comes along and collects them that is).

If I do though it would be a separate thing not tied into HC and not sure I'd want to add the ability to craft cases, primers or advanced bullet types (if anything only soft points).  Without the primer crafting the whole system would be of limited use in the long game, you'd have to find boxes (extremely rare, probably gunshop only) or salvage them from other ammo.

At any rate the code for dropping the spent shells is pretty much in place but I have yet to add the actual items.

Share this post


Link to post
Share on other sites

now that would be amazing to actually find spent casings on the ground, I actually love that idea haha. especially to be able to pick them up and re use them!. now for the primer crafting. I actually have a chemical recipe put together using the hydrocraft chemistry system, which already has almost all the chemicals needed, (acetone, hydrogen peroxide, Muriatic Acid) I'm currently doing the art for the sodium bicarbonate aka baking soda lol. after using the lab station in hydrocraft and various of the chemicals stated above and it'll leave you with a dried bag of primer ready to press into caps. So if you are thinking about adding in the whole crafting system, hydrocraft already has most needed items integrated into it. thats why i figured a side compatibility mod would be best. I also have it set to be able to smelt down brass into shell casings and for shotgun shell you'll need brass for the shell rim, then plastic sheets melted into tubes for the upper casing of the shell, and more plastic sheets to complete the wadding. personally ive always thought ORGM and  hydrocraft could merge well together, its just a good bit of work coming up with the recipe ideas, at least the coding isn't to hard

Share this post


Link to post
Share on other sites

I defiantly agree they merge nicely, always thought it was a shame that they weren't fully compatible. For the hunting system, HC currently has the weapons and % chances hardcoded into the functions, If these were in a global table instead then new weapons could be inserted to it and it would make compatibility alot easier as there would be no need to override the functions, preserving mod compatibility over future versions as well. When you start overriding functions the chances of it breaking in a future update rise...the recipes are still the dragging point though, IMO those should be dropped and have it 100% in lua.

Manufacturing cases is actually a pretty difficult process, between the metalworking and precise measuring tools required, as well as knowledge of the actual measurements required for each caliber. Its not the kind of precision work most people can wrap their heads around, even with metalwork training (your working in the 0.001 inches scale, and angles need to be exact).  I worked and trained for several years as a gunsmith before moving into the world of software dev, so understand just how finicky the inside of a chamber is. I think the measurement blueprints shouldn't just be a simple learned recipe, but would have to be kept in a book or notes the player would have to have on hand while building their setup.

Share this post


Link to post
Share on other sites

hmm, this makes me think that maybe in order to make the casing molds i should add in needing to have a measuring tape/ some other kind of measuring device since theres some in HC already, and to need to have the Ammo manufacturing textbook on your character while making the casing molds ect. i did add for FMJ rounds you need a Cupronickel ingot to case the lead tips in. I know irl its much harder and requires a ton of presision , but I do have to dumb it down a bit for game sake lol. although i think maybe i should make certain rounds require a higher gun & aiming skill to manufacture? just to keep it harder to do, although to make some of this stuff you need a high metalworking for the brass smelting, and for making the primer takes a ton of resources on its own.

 

But yes the hunting will be a bit of a beotch to mess with, unfortunately the hunting stuff was actually a separate mod that someone made that gave hydro permission to add it in. so for the time being I fear it may have to stay the way it is.

Edited by Man_In_The_Purple_Hat

Share this post


Link to post
Share on other sites

Heres actually a pretty basic explanation of the process involved in case manufacture https://www.petersoncartridge.com/our-process/drawing-brass

Some rounds are defiantly harder then others, a plain lead softpoint bullet is much simpler to make then a FMJ (you want the jacket a uniform thickness around the core) or jacketed hollowpoints.  Some cases (most pistol rounds) don't require the necking process, and rimfire rounds like the .22 don't use a typical primer that can be punched out but have the priming material packed inside..these are actually harder to reuse, as the firing pin will strike and crush part of the rim, and require special reloading tools.

Share this post


Link to post
Share on other sites

Oh this is awesome!!!!! This link will help me out soooo much! thanks! now im not sure weather to use molds for smithing the brass or to use brass sheets and other equipment...hmm or both!? maybe I could make a basic way and an advanced way to produce ammo, basic would be smelting the bars ect. or once you have high enough levels and the good machinery you can make ammo in bulk using the sheets and the proper machines. oh man, more ideas turn into more work haha but it makes it fun in my opinion :P

Share this post


Link to post
Share on other sites

does the mod come with new 3D models? because the only customized models from the guns I've looted and seen when equipped are:
retextured pistol colors
revolver
retextured black shotgun
sawn-off shotgun
M14
M16
AR-15/M4
FN FAL model

Share this post


Link to post
Share on other sites

2.00-beta-rc4 is up

 

Guns now have a chance of jamming based on weapon condition. Racking the gun clears the jam. Revolvers and break barrels are not susceptible to jamming. Easy and Normal difficulty will auto rack to clear.

At any rate, the jammed round will fall to the floor. This is affected by the lucky/unlucky traits.

 

Guns found on zombies and in houses once again are in random condition.

 

Increased durability of all firearms, especially revolvers

 

Fixed bug causing all bullets to be set to penetrating. Fixing this also fixed a bug with buckshot not properly hitting multiple targets.

 

Buckshot minimal damage has been lowered to reduce the some of the unbalance in using shotguns on hordes.

 

Added fix in the Survivors mod patch to handle the jams

Edited by Fenris_Wolf

Share this post


Link to post
Share on other sites

Holy moley,

 

This is awesome. You don't need to keep calling it ORGM by the way given the amount of work you're/you've put in.

 

I'd settle for an honorable mention, if even that.

 

I can upload it for our steam users, do you have a logo or anything?

Share this post


Link to post
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
6 6