Jump to content

ORGM Rechambered


Fenris_Wolf

Recommended Posts

My friend keeps bugging me at least 3 times a day to redo it from scratch as well, I got tons of good ideas for it too...but priorities lol ORGM must come first and I still got tons on my to-do list, and when I look at the list I feel like I've barely done anything so far with the mod.

Link to comment
Share on other sites

4 minutes ago, Fenris_Wolf said:

My friend keeps bugging me at least 3 times a day to redo it from scratch as well, I got tons of good ideas for it too...but priorities lol ORGM must come first and I still got tons on my to-do list, and when I look at the list I feel like I've barely done anything so far with the mod.

hey man, everything in it's time. The games not even finished yet so why should the mods be?

Link to comment
Share on other sites

so just tested out the silencer patch.after installing it, I subsribed to the workshop version of the silencer mod and activated it in game. I cant seem to find the silencer attached to weapons though (tested it by teleporting around and checking the gunstore/police station guns on loot setting extreme for guns-none of them had a silencer attached)

But I can build the homemade silencer from flashlights and that one is working.

I  cant spawn the silencer with necroforge either.

 

I did change a few files here and there, added the case textures, added a few weapons+textures and adjusted the loot spawn in the gunstores and police stations to be higher. So maybe I made a mistake somewhere and messed something up

Link to comment
Share on other sites

I think I may know what's up...the file load order, when I first tested the ORGMDistributions.lua was loading before ORGMCompatibility_ORGMSileners_Server.lua (which i thought was weird since it should be alphabetical order), but thats the order they need to load in to properly spawn...when I fire up a local coop server, they seem to load in that order, but when I checked my log from solo mode, it was reversed.   Not sure why its changing the order, but I'll have to make some adjustments.

 

And necroforge doesn't have compatibility with that silencers mod, I could add it in there, but thats just getting a little extreme: using ORGM as a patch to make two 3rd party unrelated mods compatible with each other lol

Link to comment
Share on other sites

50 minutes ago, Fenris_Wolf said:

I think I may know what's up...the file load order, when I first tested the ORGMDistributions.lua was loading before ORGMCompatibility_ORGMSileners_Server.lua (which i thought was weird since it should be alphabetical order), but thats the order they need to load in to properly spawn...when I fire up a local coop server, they seem to load in that order, but when I checked my log from solo mode, it was reversed.   Not sure why its changing the order, but I'll have to make some adjustments.

 

And necroforge doesn't have compatibility with that silencers mod, I could add it in there, but thats just getting a little extreme: using ORGM as a patch to make two 3rd party unrelated mods compatible with each other lol

 

Haha, no need for making them compatible, i was just trying to see if the silencers are in the game

Link to comment
Share on other sites

at any rate if you change lua/server/ORGMCompatibility_ORGMSilencers_Servers.lua to add a wrapper around the whole code:

 

Events.OnDistributionMerge.Add(function()

    -- original code goes in here

end)

 

That should fix any screwy load order problems. I've already set to include in the next update, but no point pushing a new update just for that.

Or, if you want you can just grab it from the github page, the change has already been pushed to there.

Link to comment
Share on other sites

First of all thank you a lot for your work^^ 

 

In the ORGMDIstribution.lua I changed a few settings for loot spawn on the zombies and they seem to work (I increased the chance a bit and the amount of magazines.) But the problem now is, that quite often they only carry around magazines. Now, is there a way to set it, that they only carry magazines if they also carry the fitting main weapon?

Edited by SKush
Link to comment
Share on other sites

5 hours ago, SKush said:

First of all thank you a lot for your work^^ 

 

In the ORGMDIstribution.lua I changed a few settings for loot spawn on the zombies and they seem to work (I increased the chance a bit and the amount of magazines.) But the problem now is, that quite often they only carry around magazines. Now, is there a way to set it, that they only carry magazines if they also carry the fitting main weapon?

 

I'm assuming you changed the AddToCorpse function, and there is a way. I decided not make that standard...people tend to drop what in their hands when they turn Z, which is why it allows you to find mags without a gun.

 

local AddToCorpse = function(container)
    local choice = SelectGun(80, 14, 6)
    if SpawnReloadable(container, choice.gun, choice.ammo, 3, 1, true) then
        SpawnMags(container, choice.gun, choice.ammo, 1, 3, true) -- has mags
    end
    SpawnItem(container, choice.ammo, 3, 15) -- loose shells
    SpawnItem(container, choice.ammo .. "_Box", 1, 1) -- has box
end

 

Notice what I did there was change that SpawnReloadable into a IF statement (SpawnReloadable returns true/false if it spawns something)

So now the magazines only spawn if the gun does as well.

 

EDIT: SKush, your silencers not spawning issue should be fixed next update to the steam workshop, but I need some more worthy changes before pushing a new update. If you don't want to wait, see 3 posts up for instructions on manually fixing this problem.

 

Edited by Fenris_Wolf
Link to comment
Share on other sites

 

1 hour ago, Fenris_Wolf said:

 

I'm assuming you changed the AddToCorpse function, and there is a way. I decided not make that standard...people tend to drop what in their hands when they turn Z, which is why it allows you to find mags without a gun.

 


local AddToCorpse = function(container)
    local choice = SelectGun(80, 14, 6)
    if SpawnReloadable(container, choice.gun, choice.ammo, 3, 1, true) then
        SpawnMags(container, choice.gun, choice.ammo, 1, 3, true) -- has mags
    end
    SpawnItem(container, choice.ammo, 3, 15) -- loose shells
    SpawnItem(container, choice.ammo .. "_Box", 1, 1) -- has box
end

 

Notice what I did there was change that SpawnReloadable into a IF statement (SpawnReloadable returns true/false if it spawns something)

So now the magazines only spawn if the gun does as well.

 

EDIT: SKush, your silencers not spawning issue should be fixed next update to the steam workshop, but I need some more worthy changes before pushing a new update. If you don't want to wait, see 3 posts up for instructions on manually fixing this problem.

 

Thanks a lot, now that you write that it seems quite obvious, I just don't have any experience with this stuff at all, sorry :D 

I have done the same what the other post said but I didn't find any weapon with silencer yet, but I haven't played too much since then, so I probably just had no luck yet. Just in case I was being a noob again though, does it look right or did I mess up? (see screenshot)

(I am pretty sure this will be the last time I am bothering you, sorry ;D)

SilencerCompatibility.JPG

Link to comment
Share on other sites

  • 3 weeks later...

Its been a while since I posted so figured I'd better update people instead of leaving all you ORGM'ers in the dark.

After a few weeks break from the mod, I'm back at it.  As it currently stands Rechambered accomplished alot, but there's a number of things about the way it works that bug me.  When I started I was pretty much new to PZ modding (but not lua), since I can no longer claim the newbie excuse its probably time to take another go at it.  Most of my projects go through at least 3 rewrites before I'm content, this was #1 :lol:

So here's the list of things that annoy me and what I plan to do about them.

 

1) Code Simplicity

Rechambered was designed to make it easier for other people to modify and maintain the code. While this was a good idea, it limited the mods potential in several areas.  Simplicity is still a main goal, but not at the sacrifice of usefulness. I prefer to write code that is dynamic and can be used in ways beyond what I've thought of.

 

2) 3rd Party Mod Support

By this I mean extra mods adding additional weapons, ammo, etc, or making use of things like Rechambered's Alternate Ammo System.  While it is possible to do so, any items currently need to use the ORGM module namespace (ie; names need to be ORGM.MyNewGun, or ORGM.MyCustomAmmo). This is fine for the most part, but defiantly not ideal. 

Take the example of using hydrocraft slingshots using the ammo system to fire all sorts of misc junk. Under the current implementation this simply wouldn't work, which is a real shame and must be fixed.

The new system should allow for other mods to register weapons, magazines and ammo into Rechambered's core.

 

3) Custom Settings

Far too many things are hardcoded for my liking: % chances of choosing civilian/police/military weapons when spawning, % chance of jamming, various aspects like dropping empty cases, etc. 

All settings should all be moved into a single table for easy configuration, that servers can pass to clients on connect. (via sandbox settings or similar)

 

4) Global Tables

Rechambered uses multiple tables that exist in the global namespace and can be accessed anywhere (ORGMMasterWeaponsTable, ORGMMasterAmmoTable, ORGMUtil, etc).  This is mostly fine, but semi-pointless. These should all be moved into a single global table called ORGM.  So instead of a ORGMMasterAmmoTable, it would be ORGM.AmmoTable.

Custom Settings (issue #3) would exist in the ORGM.Settings table.

 

5) Spawning

Even though the distributions file was completely reworked to make it more dynamic,  documented and spawn rates tied into the loot rarity settings, how to edit spawns still seems to be the #1 question.  While I've been happy with the new rates,  this clearly needs to be tied into custom settings and made more dynamic.  I don't mind answer questions on how to modify the files, but I shouldn't have to when another option exists.

 

6) Modularity

Rechambered currently is a 'all or nothing' mod. You either load the mod and get all of its guns and features, or you don't load it and get nothing.

While this is fine for most of us, it may not be for others.  Some server admins might not want the submachine guns, or military weapons, or only want the pistols, or maybe just want the core features without any of the guns at all (and have a 3rd party mod's guns instead).

It should be broken up into modules for those that only want some of ORGM.  The official main version should remain a 'all or nothing' that includes everything,  with a second branch that is just rechambered's core with everything else as addon modules. 

Note this wouldn't require maintaining separate code bases, the full version would simply be all the ORGM modules combined into a single folder.

 

The end result should turn ORGM into not just a real guns mod, but a 'realistic firearms framework' that can be used by other modders for their own projects.

And yes... I fully intend to keep everything backwards compatible with the current 2.00 branch so saves and any addon mods don't break (not that any currently exist for Rechambered that I'm aware of)

 

Link to comment
Share on other sites

Version 3.00-alpha has been uploaded to github.  Why the big jump from 2.03 to 3.00? Almost a complete code restructure and rewrite, which is why its back to alpha status.  At this point it hasn't been subjected to thorough testing, and is expected to have bugs and be very unstable.

 

Changelog includes:

 

* Complete code rewrite. Replaced all global tables with a single ORGM table. This table contains
    all functions and data. It is no longer necessary to directly edit ORGM's lua code to customize
    it, every aspect of the mod can be edited/replaced by creating a extra patch mod.


   
* Item Spawning now obeys container weight limits.


* Added a ORGM.Settings table to allow for easier configuration, including many options:
   
    JammingEnabled to enable/disable weapon jamming
   
    CasesEnabled to enable/disable ejecting of spent cases
   
    LogLevel (0 to 3) to control the amount of text printed to the logfile
        (errors only, warnings, info or debug)
   
    RemoveBaseFirearms to enable/disable the removal of vanilla firearms and ammo
   
    DefaultMagazineReoadTime to control the time it takes to load bullets into a magazine
        (unless the specific magazine overrides)
   
    FirearmSpawnModifier multiplier for fine tuning the spawn rate of all firearms.
   
    CivilianFirearmSpawnModifier multiplier for fine tuning the chances a firearm is civilian.
   
    PoliceFirearmSpawnModifier multiplier for fine tuning the chances a firearm is police.
   
    MilitaryFirearmSpawnModifier multiplier for fine tuning the chances a firearm is  military.
   
    AmmoSpawnModifier multiplier for fine tuning the spawn rate of ammo, boxes and cans.
   
    MagazineSpawnModifier multiplier for fine tuning the spawn rate of spare magazines.
   
    RepairKitSpawnModifier multiplier for fine tuning the spawn rate of repair kits.
   
    ComponentSpawnModifier multiplier for fine tuning the spawn rate of firearm components/upgrades.
   
    UseSilencersPatch inject compatibility patch for Nolan's ORGM Silencers mod.
   
    UseNecroforgePatch inject compatibility patch for Necroforge.
   
    UseSurvivorsPatch inject compatibility patch for Survivors mod.
   
    **Note the spawn modifier settings work in addition to the sandbox loot rarity settings.
    Its now possible to have melee weapons abundant and reduce firearm spawn settings to next to
    nothing, or have lots of guns but limited ammo.


* CZ75 Pistol is now a 9x19mm instead of .40S&W, fixed inconsistencies in magazine size.
    The txt file had it listed as 15, while lua data had 10.
    In reality, The CZ75 comes in both 9mm and .40, with magazine sizes of 15 for the 9mm
    and 12 for the .40S&W

 

 

* Firearm/ammo/upgrades/repairkits are no longer required to have the ORGM mod prefix. It

    should now be possible to have other mods guns and ammo behave as ORGM weapons.


* When using the ORGM Silencers mod, silencers now correctly spawn in containers not attached
    to guns. Also, Silencers will appear in necroforge.
 

 

Over the next few days/weeks, I will be giving this a complete testing, polishing off features, and adding example addon mods that tweak various aspects of ORGM, including how to create custom settings for servers.

 

Edited by Fenris_Wolf
Link to comment
Share on other sites

Just now, TheZombiesPro115 said:

Hey, fernis. What about some new things that explode? So far it's been "Pipe bomb" if you spawn as engineer and that's your lot for as far back as i can remember

 

I played around a bit (more like limited experiments) a while back trying to get incendiary rounds to work, and the possibility of adding grenade launcher addons to some of the military weapons but I didn't have much luck at the time...but really I only spent about 5-10 minutes on the task just to test the difficulty.  I'm not sure I'd want to actually add explosives to ORGM though its kinda going off topic. I'm still tempted on the incendiary rounds though...

Hydrocraft has grenades and a rocket launcher (if i recall right)...watched most of west point burn down because my friend kept using them on hordes.  More explosives would be a great idea for a separate mod though.

Unfortunately I'm really trying hard not to start working on any others until ORGM is perfected, which is difficult I REALLY want to code a NPC framework for my next project.

 

Link to comment
Share on other sites

3.00-Beta-rc1 is up.

A download link to the new beta branch has been added to the first post in this thread.

 

Changes include:

* Complete code rewrite. Replaced all global tables with a single ORGM table. This table contains
    all functions and data. It is no longer necessary to directly edit ORGM's lua code to customize
    it, every aspect of the mod can be edited/replaced by creating a extra patch mod.

* All guns now record the ORGM version number they were last used with. Guns that get changed in
    ORGM updates are logged in a 'internal changelog' of the version they were last changed in.
    Any 'in game' gun that has had obsolete stats will now reset to defaults values on equipping.
    Any ammo loaded will be placed in the players inventory.
    This allows for major changes to made to guns without breaking existing saves or breaking existing
    in game guns.

* Added a ORGM.Settings table to allow for easier configuration, these settings are meant to be overwritten
    by extra 'patch mods' that can be loaded just like any normal PZ mod. (see the changelog for complete list

    of options, and the examples in the 'Patch Mod Examples.zip' file for examples on how to tweak the settings)

 

* Basic Firearm inspection window (accessed via context menu for guns in hand). Showing details
    such as basic information on the gun, manufacturer, country of origin, initial production year,
    as well as item specific info such as condition, round chambered, attachments etc.
   
* All guns that spawn naturally have serial numbers generated. Gun spawned with necroforge or other
    admin methods do not. This can be seen via the new firearm inspection window (immersion feature)

* Firearm/ammo/upgrades/repairkits are no longer required to have the ORGM mod prefix. It
    should now be possible to have other mods guns and ammo behave as ORGM weapons.

* When using the ORGM Silencers mod, silencers now correctly spawn in containers not attached
    to guns. Also, Silencers will now appear in necroforge.

* Item Spawning now obeys container weight limits.

* CZ75 Pistol is now a 9x19mm instead of .40S&W, fixed inconsistencies in magazine size.
    The txt file had it listed as 15, while lua data had 10.
    In reality, The CZ75 comes in both 9mm and .40, with magazine sizes of 15 for the 9mm
    and 12 for the .40S&W

* Taurus P38S is now a double action instead of single action.

* Browning BLR is now single action instead of double action only, it now uses a detachable 4 round
    magazine instead of a internal one.

* Henry Big Boy is now single action instead of double action only.

* M1903 is now single action instead of double action only.

* H&K SL8 magazine capacity reduced from 20 to 10 (all SL8's imported into the US use 10 round mags)

 

 

Note: if testing the beta build, please backup your saves first.  It should be 100% backwards compatible with 2.03 Stable, but hey, this is beta still.

 

Edited by Fenris_Wolf
Link to comment
Share on other sites

On 15/01/2018 at 8:42 PM, Fenris_Wolf said:

Early WIP prototype but I thought I'd share some screenshots

-snip-

 

This is wonderful! Really nice to not only be able to see the weapon details/status but having the background information is a extra bonus.

Link to comment
Share on other sites

27 minutes ago, Khaos said:

This is wonderful! Really nice to not only be able to see the weapon details/status but having the background information is a extra bonus.

Ya, alot of the information is really just selectively copied off wikipedia and other sources...some of it though was actually rather difficult to find, especially initial manufacturing year of some pieces.  I ended up spending almost a week doing nothing but research lol.

I'd like to include more info, such as actual design specifications, controls (manual safeties, select fire switch locations etc) and additional markings & text that can be found on the firearms, but don't want to end up flooding the players with information. Maybe later when the window becomes more advanced...my first experiment playing with GUI controls in PZ though.

Link to comment
Share on other sites

I have a few questions:

-even in a game where reload difficulty is set to easy the weapons from this mod use a separate clip/magazine.  Is this intentionnal? If so, is there a way to force the 'easy' setting over to the mod?

-is there a way to disable the creation of empty casings on the ground when a gun is fired?

 

Thanks.

Link to comment
Share on other sites

3 hours ago, SmithTrLane said:

-even in a game where reload difficulty is set to easy the weapons from this mod use a separate clip/magazine.  Is this intentionnal? If so, is there a way to force the 'easy' setting over to the mod?

yes it is intentional, and not really. I 'may' include that as a optional setting, but requires a fair bit of rework. It was done this way to ensure magazines are spawned on servers when players on easy check containers, plus for when I implement multiple magazine sizes (ie: expanded capacity magazines)

 

3 hours ago, SmithTrLane said:

-is there a way to disable the creation of empty casings on the ground when a gun is fired?

there is in the new 3.00 beta version, included in the ORGM folder is a 'Patch Mod Examples.zip', in there is a example of creating a additional mod that can be loaded and overrides numerous ORGM default settings. This version is NOT stable though, not steam ready, and still going through updates and changes.

Link to comment
Share on other sites

18 minutes ago, Fenris_Wolf said:

yes it is intentional, and not really. I 'may' include that as a optional setting, but requires a fair bit of rework. It was done this way to ensure magazines are spawned on servers when players on easy check containers, plus for when I implement multiple magazine sizes (ie: expanded capacity magazines)

Ah, I understand. Thank you for the clarification.

 

21 minutes ago, Fenris_Wolf said:

there is in the new 3.00 beta version, included in the ORGM folder is a 'Patch Mod Examples.zip', in there is a example of creating a additional mod that can be loaded and overrides numerous ORGM default settings. This version is NOT stable though, not steam ready, and still going through updates and changes.

I'll take a look at that folder then, my OCD won't let me leave all these casings on the ground ^^

 

Thanks!

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