Jump to content

[WIP] Weapon Addition and Replacement Suite (WARS)


antistar

Recommended Posts

  • 2 weeks later...
  • Replies 2.7k
  • Created
  • Last Reply

Top Posters In This Topic

I personnally would like to imagine that all PAs golves come with a second set of fingers that allows the operating of conventional firearms when needed. Power Armors being cutting-edge tech i suppose.

I would argue the 10mm pistol falls into the same category as the assault rifle - an extremely oversized, bulky and impractical design once you put on all the attachments which was clearly designed for Power Armor. I would argue that PA should only be able to use heavy weapons such as the minigun, gatling laser, junkjet etc as those are the ones that make most sense to be wielded in PA. It's ridiculous to be able to use something like the Deliverer considering the fingers wouldn't even fit through the trigger guard as with most other weapons actually. Of course, the selection of heavy weapons would then have to be increased and diversified

Link to comment
Share on other sites

Another update on the AmmoTweaks v1 (ATv1) integration:

 

It's going well! Just yesterday I got the "Dropped Magazines" system I've been thinking about for ages working.

 

I think I've mentioned it before, but the way it works is that when you reload without having emptied the magazine, the remaining ammo goes into a magazine item that is physically dropped into the game world. If you can find the magazine, you can recover the ammo - along with a random number of spent casings up to the number of shots fired from that mag. (Obviously the casings wouldn't realistically be in the magazine; it's an abstracted way to represent gathering up any reusable spent casings after firing the weapon. Something that was isathar's idea, to give proper credit.)

 

The dropped magazines work like containers - because that's what they are - but with physics enabled, and scripted to only accept appropriate ammo/casings, and only up to their actual capacity. No stuffing literal tons of loot into a mobile container and carrying it back home. ;)

 

The mags are disabled and deleted when you recover their contents - or once you leave the area - so they shouldn't cause save bloat.

 

This is configurable via the WARS-AT MCM menu. The options are to always drop mags, never drop mags, or only drop mags when in combat (the default). If it's set to not drop mags, the recovered casings are added to the player's inventory automatically - same as with weapons that don't use detachable magazines.

 

Oh - also: NPCs drop physical mags now too. (Only containing a variable number of casings, though; not ammo.) I almost wasn't going to do that, because it made the system even more difficult to script - but I'm glad I did, because I think it looks pretty cool. Surprisingly so, actually - from my limited testing so far. The dropped mag originates from the magazine node on the weapon, so (again, with limited testing) the mag dropping from the weapon matches up seamlessly to the reload animation.

 

I have to give credit to the author of the Visual Reload mod for that; looking at their scripts is what made me realise that I could use the nodes like that, and think "okay, maybe I should try to have this work for NPCs too".

 

Also, I should mention that the dropped mags system relies on new functions (that let you get the current ammo type, count and max capacity of the player's equipped weapon) added by the DLL plugin in Better Scrounger, so that mod is now a requirement for WARS. (The actual changes that mod makes to rank 4 of Scrounger don't take effect when using WARS, though. As with the vanilla perk effect, the chance to literally conjure extra ammo out of nowhere is the kind of thing WARS specifically sets out to remove from FO4.)

 

I also used those functions in the Fire Mode cycling and Launcher Mode toggle features, to keep the currently loaded ammo count consistent when changing fire mode, or going in and out of launcher mode. The game automatically re-equips the weapon if its attached omods change (which is how all these ammo/fire mode/launcher mode changing features work), which in turns automatically refills the weapon, annoyingly - so I had to code around that.

 

But yes; ammo swapping, fire mode cycling and launcher mode toggling are all in and working now; just like in STALKER. :)

 

It was very complicated to work out. The interactions between all these functions - ammo swapping, fire mode switching, launcher mode toggling and now the dropped mags system - was all very difficult to solve. To give an example of the interactions between the systems that I had to specifically account for, swapping ammo types triggers a reload, which can drop a magazine containing the ammo type that you just switched from.

 

It was brutal. I had to keep reminding myself that I already knew that the different parts of the system could work - basically that "I know the pieces fit". ;)

 

It's been hard work, but I'm proud of how it's come together.

 

 

Anyway, with the design and implementation all these ATv1-related features (really, they're new features added by WARS, but they closely interact with ATv1), I'm starting with a kind of vertical slice approach, using the AR-15. Along with the SA80, it uses basically the full suite of features, since it has all three of the new switching functions.

 

Once that's more or less finished (I think the main things left are the new/overhauled explosion types for the 40x46mm grenades, and maybe NPCs being able to swap ammo, if I can work that out), I'll show off all these new features in a video, using the AR-15.

 

I personnally would like to imagine that all PAs golves come with a second set of fingers that allows the operating of conventional firearms when needed. Power Armors being cutting-edge tech i suppose.


I'm pretty sure I've seen that sort of double-hand thing in mecha art before, yeah; probably in Japanese media.

Link to comment
Share on other sites

I just added a quality-of-life feature to the Ammo Swap function that I think will make it a lot easier to use. Now, if you have more than one ammo sub-type you can swap to in your inventory, it will pop up a menu asking you which one you want to swap to. If there's only one you could swap to, the menu won't show and it will just swap to it automatically.

 

Previously, it would swap from one sub-type to the next in sequence (and it will still work this way if you disable the Ammo Swap menu in the MCM options), which could make it take a while to get to the sub-type you want if you've got a variety of them in your inventory. Especially since swapping ammo prompts a reload, and the Ammo Swap function is blocked during reloads to prevent the scripts getting messed up by people potentially spamming the Ammo Swap button. You would have to hit Ammo Swap... wait for reload... hit Ammo Swap... wait for reload... and so on until you got to the ammo sub-type you wanted.

 

That last part is what really made me think "... I should add a menu for this".

 

 

While I'm here, I've been meaning to post this Forgotten Weapons video about LPC laser sights - just for the sake of interest, since it shows what I based the usage of LPC Laser Sights on various weapons in WARS on. It's mostly about one designed for the AR-15 - that I didn't actually know about - but it also briefly shows them being used on revolvers, a Mini-14, pump-action shotgun, etc; as in WARS:

 

- S&W M29 01

- M1911 Longslide

- Mini-14 11

- Mossberg 590 12 (Handled differently to the real thing so that it wouldn't be blocked by the suppressor.)

 

He doesn't show one being used on an M1911/Longslide, as in The Terminator (since I think that was custom-built for the movie), but he does mention it in passing, from memory.

Link to comment
Share on other sites

I think I've cracked having NPCs able to swap ammo types. From my tests so far it seems to be working fine, which is a relief. I've been kind of worried for a while about what I'd do if I couldn't get this feature working.

 

If you can imagine giving a weapon and a bunch of assorted ammo for it to a follower or a settler, but then they don't use half of it because it's not the sub-type the weapon was set to when you gave it to them... It would feel pretty bad, I think.

 

If you remember me describing how robots and turrets handle ammo-swapping - by having a separate weightless embedded weapon for each ammo sub-type - this works in a similar way. It may sound kind of roundabout, but it should be pretty light on the script engine to do it this way:

 

A script on a "regular" weapon adds a range of weightless, non-player "dummy" weapons - one for each ammo sub-type - to the NPC that equips it. If the NPC decides via its normal AI that it wants to use a particular dummy weapon (because they're out of ammo for the regular weapon, or they evaluate it as doing more damage), equipping that dummy weapon triggers a script on it that attaches the appropriate ammo sub-type omod to the regular weapon, and then equips it - resulting in the NPC having swapped to the desired ammo sub-type on their weapon.

 

If an NPC equips a dummy weapon but they lack the corresponding regular weapon, the dummy weapon removes itself. The dummy weapons themselves are also set to have lower damage than their "regular" counterpart, so that NPCs won't prefer them over the regular weapon.

 

That's basically it. Since it's using the base game's AI to evaluate when to swap ammo, what's left for the scripts to do is pretty simple, so it should be fine to have a bunch of NPCs doing this in combat.

Link to comment
Share on other sites

  • 2 weeks later...

Here's a video showing off the various features I was talking about in my last few posts:

- AR-15 ammo type testing


As a summary though, the new features include:

- Ammo swapping, Fire Mode cycling and Launcher Mode toggling via hotkeys - as in the STALKER games.
- Weapon condition system (optional), with repairs/cleaning being done at weapon workbenches or with weapon cleaning and repair kits.
- Dropped Mags system (optional and configurable). Reloading before emptying a magazine will drop it into the game world, along with any ammo left in it. (Recoverable if you can find the mag.)
- NPCs also being able to swap ammo types and toggle Launcher Mode. (And drop magazines when they reload.)

I did a kind of "vertical slice" implementation of these features using the AR-15 in WARS, since it uses all of them.


Oh, and Testacles the Tester's name is pronounced "test-ah-clees". Definitely not pronounced any other way.

Edited by antistar
Link to comment
Share on other sites

Thanks everyone. :)

 

A minor-ish thing I forgot to mention - or show very clearly in the video - is that I added electrical tape to the AR-15 magazines, with different colours indicating which ammo sub-type is currently loaded. (Ammo boxes have tape too - with colours that match what's on the mags, of course. This is why I first thought to use tape like this, actually; I didn't want to have to do different ammo box art for all the different ammo sub-types. So it's just electrical tape instead.)

 

This isn't super visible in first-person - and you have the ammo type indicator on the HUD anyway - but it does mean that you can see at a glance what your followers, settlers, etc are currently using. Potentially enemy NPCs too, if you can get a clear look.

Still super hyped for this. Especially that beautiful AR-15

Side note, are you guys adding Mutant compatible animation sets for the weapons that replace say the Combat rifle, assault rifle, and bolt action?


I'm not planning to do custom super mutant animations right now. In WARS I've made more of a division between what kind of weapons the different factions use anyway, and (partially because of these animation issues, admittedly), this means I've got super mutants using more makeshift weapons, mostly. As part of that though, I'll be expanding the calibre options for Pipe guns a bit. E.g. options for 7.92x33mm Kurz and/or 7.62x39mm, to make up for super mutants not getting access to "Assault Rifles" anymore.

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...