I've implemented a small feature that can alter the ways we treat MGs. Basically, we can now have dedicated ammo bearers (and thus create 'true' machinegun teams). It works like this:
When a merc has ammunition in his hands, and that ammo item is defined as an ammo belt, he can feed the guns of his teammates. A icon on his portrait will show you that.
In order to do that, his teammate must be next to him, and they must look in about the same direction, or he looks at his teammate.
Also, the gun of our teammate must allow external feeding. This can also be done via an attachment (G3 to HK21, anyone?)
The calibers of the gun and the ammo must match, as must the ammo type (AP, Tracer...)
If we feed a
What now happens is this: If the gun is fired, the bullet is not deducted from the gun's magazine, but instead from our ammo item. So we provide the bullets that the MG shoots.
We can feed a gun by holding ammo in our hands, or we can feed our own gun from our inventory:
Certain vests (in the trunk the only one will be the LRAK vest) have slots in which ammo belts can be stored.
A ammo belt in these slots can supply our own gun, if it is the ONLY ammo belt in this slot.
To avoid exploits, the gun's ammo is not restored to full capacity when it is fed externally. All that happens is that the bullets get removed somewhere else, so to speak.
Note that the shooting mechanism does not counter in the fact that a gun is fed externally. This means that if your gun's ammo count is down to 1, you can only fire a single bullet at a time, even if someone esle supplies you with a fresh 100-bullet belt.
This system also works if you have a gun in every hand and each one is belt-fed. So yes, you can now wield dual-belt-fed machineguns, provided some modder would allow something this wacky. :headbanger:
This feature can be controlled via the JA2Options.ini.
All necessary xml changes are in the . AS of now, several people are developing new features that need this tag, so I'll decide the definite number once this reaches the trunk.
This does not break savegames at all, as this is a pure xml-based feature.
My advice to any modder wanting to truly emphasize MG teams with this: Lower the magazine site of your MG (like to 20 or so). This will force the player to either reload hideously often, or rely on this feature.
And now a few demo pics:
Blood guns down an enemy. As you can see, his ammo count does not go down. Len currently provides the ammo, as you can see by a) The icon on his portrait and b) his ammo item has an ammo count (which only shows if it is feeding a gun).
Now blood is alone. His gun is now fed from the ammo belt in his vest.
As usual, this could eventually enter the trunk. This thread is the place to discuss this, and find errors in the concept, or improvements I haven't thought of.
Edit: This is now in the trunk (r5415), required GameDir revision is r1474. The necessary tags in the -tag in Items.xml are:
#define BELT_FED 0x00000080 //128 // item can be fed externally
#define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally
#define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots
[Updated on: Mon, 23 July 2012 21:28] by Moderator
Yo Flugente, There used to be a maximum mag size, 250 or something like that, has that been increased e.g. can you have 1,000 round belts now? If not, that is something we should do.
Another thing, is it possible to give the ammo can a size so that e.g. it won't fit into a pocket other than a large backpack? What I mean is we probably need to separate ammo mags which can be potentially attach to a gun from ammo containers which can never be attached to a gun. Ideally we want an entire backpack slot for mostly just ammo for WH40k.
Don't forget that some ammo containers can not be used as a mag or belt fed, such as retail boxes of e.g. 20 or 50 rounds in styrofoam in cardboard (or a tin can). Some mods have these retail style boxes, they are usually small-ish and relatively heavy.
I have seen a mod with a belt feed attachment. Once you attach the item to a gun, it becomes a belt fed weapon. Maybe this can be used somehow to switch from magazine operated to belt fed, which is also called in professional circles as "let it rain". :giggles:
In the screens the MG is loaded as per usual but it's also being fed by another belt, does this mean the gun can fire all of both before needing to reload or do you have to spend reload aps when the first belt finishes?
Also re: max mag size, there seemed to be some relevant work in the New Mag System (http://www.bears-pit.com/board/ubbthreads.php/topics/280585/6/IDEA_New_Magazine_System.html) Somewhere near the top ChrisL mentions that adding a 1,000 round belt would be possible, so presumably the max mag has had something done to it. Maybe it might be worth someone having another crack at the NMS?
Thanks DB! Flugente and I were talking about Meltaguns in WH 40k with a very high ammo count due to self recharging batteries, something like 9999 or so would be sufficient for the duration of the game.
DepressivesBrot
... remember: Crates are magazines ...
Yah, this is why I wanted something that disallows some ammo containers to be used as belt fed (essentially remote) magazines.
For example an ammo crate may not have links to chain each bullet to another. Or you can't just take a box of 50 you picked up at the supermarket and use it out of your pant pocket.
I have to correct Depri here. I originally planned to introduce a new magazine type, yes (and asked about that in IRC). However, I also want to allow the possibility to feed from ammo crates. That is why wether an item can be used as a belt (or, more generally speaking, 'external ammo source') is determined by the new flag 'AMMO_BELT' in in Items.xml. This allows shenanigans like this:
Yes, gentleman, Blood's MG is fed from a 2500-bullet box
It's that simple: if the tag is set it works, if not, then not.
@H412: The gun can fire both boxes. At first, the bullets will be deducted from the external belt, after that from the internal magazine.
@Dieter: In WH40K, I plan to simply allow a crate of bolter ammo to be attached to power armor, and will put in an additional check to check that slot. Thus the Adepta Sororitas can feed their Heavy Bolters from their armor.
[Updated on: Tue, 17 July 2012 21:06] by Moderator
In WH40K, I plan to simply allow a crate of bolter ammo to be attached to power armor, and will put in an additional check to check that slot. Thus the Adepta Sororitas can feed their Heavy Bolters from their armor.
Oh my God, sooo cool!! I probably came a little just now...
For future development, it could be ubercool for the Bodybuilding (and a specific amount of STR) - mercs to be possible to use a heavy MG in one hand and an ammo belt in the other hand!
While the system perfectly accepts feeding a gun with ammo in the other hand, Machineguns are currently only usable with both hands. Allowing mercs with high strength to hold them in one hand wouldn't require much coding, but it wouldn't be nice, and could lead to some weird stuff (especially if a merc loses strength while holding an mg.
For starters, you could just make an MG a one-handed gun.
Update: This feature is now in the trunk (r5415). You will need the newest GameDir files for it (r1475).
The MG3 and the FN Mag can now be fed externally from any 100-rnd 7.62 NATO mag. You can also feed from your inventory if you store the ammo in the medium slots in the LRAK vest.
See first post for the specific numbers required to Items.xml if you want to add this to your guns.
Edit: Thanks to DepressivesBrot, any MG in the standard that could possibly be beltfed can now be beltfed. The 100-rnd 7.62 NATO, 200-rnd 5.56 NATO and 200-rnd 7.62x54R WP ammo items can be used for that.
[Updated on: Mon, 23 July 2012 22:07] by Moderator
Messages:262
Registered:February 2009 Location: Finland
Seems like an excellent system. Nice job, Flugente.
Maybe someone has told you this before, or you've thought about if yourself, but IMHO, you should also concentrate on making all of these cool new features available to the AI, if that's within your expertise. To be honest, with all this fancy new stuff, some further (Edit: Along the lines of WarmSteel's latest work) improvements to the AI would be extremely welcome.
[Updated on: Tue, 24 July 2012 22:17] by Moderator
Messages:1965
Registered:March 2009 Location: Middle of Germany
What features exactly are you thinking of here, Haza?
Since the AI soldiers are just created anew randomly in the moment you load the tactical view of a sector, i don't think it'd be of relevant worth to enable AI using externally fed MGs.
I mean, better have the one with MG spray its internal 100+ bullets and another attacks you also with his gun instead of the 2 of them just fire a single gun against player's mercs, don't you think?
Messages:262
Registered:February 2009 Location: Finland
Right now, mostly this and the scope modes. You have a point there, so I guess that leaves only the scope modes. The rest of Flugente's work doesn't seem to fit the AI very well, either.
Mostly I'm trying to say that with all the new features that get added to 1.13, the AI should also be improved and given the chance to use as many of the actions available to the player as possible, like scope modes, walking with weapon raised, sidesteps, using scopes for observing an area (I doubt this one is added yet, despite the discussion some time ago). I know it's easy to ask for all these things, and that AI programming is hard and not many people here can do it properly. Still, personally I'd love to see the AI being improved along with the general gameplay, a better and less predictable AI goes a long way to making the combat much more interesting.
But just to be clear, I respect every coder and modder here for all the hard work they have already done.
[Updated on: Tue, 24 July 2012 23:10] by Moderator
The AI can use this feature just as the player does. However the AI doesn't put ammo into their hands. However:
Feeding from your own inventory is also possible. For the player, this can only be done via dedicated slots in a vest (see LRAK-vest). For the enemy, however, any slot will do, as long as there is only one ammo belt there. So the AI can automatically use it.
However this point is pretty insignificant, as the AI rarely ever gets the chance to shoot over 100 bullets and then reload
Messages:1965
Registered:March 2009 Location: Middle of Germany
ACK. Better, more challenging AI would always be highly appreciated (by all, i guess). Tho i doubt that switching through scope modes would be worth the effort for AI. Using recently added movements and stances etc. should be available for AI, if possible, ACK.
Using scopes for observing is AFAIK implemented since 4870 release. At least i do see AI sniper raising gun and scanning around now and then.
It looks like something could easily get caught in that belt and dislocate the links or something, leading to jams ... I'd prefer the enclosed versions:
A question/concern about the requirement that there is only one magazine item (ammo belt) in a pocket before it will feed - is this a technical limitation or a design choice?
It struck me that I could cut down on items if I could use shorter lengths of belt and stack a bunch of them in the Belt ammo pocket. The weapon's inherent capacity would be 40-50 rounds, and a stack of the same 40-50 round magazine items could sit in a vest pocket to represent the remaining rounds to make up a 200 round belt.
Previously I was considering adding a series of low capacity magazine items for a belt fed weapon's inherent capacity, but if I could replace the "full" belt item with a stack of "short" belts sitting in a Vest pocket then I wouldn't need to create these extra items. Also the weapon could create belt items on its own. The split ammo crate feature seems to fill all empty pockets. I still prefer some way to produce only the belt magazines item(s), and having the weapon 's internal feed use the same mag size as the belt just makes sense to me.
Technical limitation because I was unsure if I wanted to display a huge sum of bullets and had a problem with deleting mags from stacks.
Design choice... I wanted some kind of 'punishment' for using the external feed mechanism from inventory, and the limitation to only one belt struck me as feasible. I am not really happy with the slot implementation, I just can't think of any way to better represent the belts people wear around their neck...
Your suggestion seems very reasonable. I'll propably make a change to the code today in that regard.
Also, I just heard that you have made cleaning kits for Urban Chaos. Could I add the item pictures for that to the trunk? And if yes, where can I get them from?
Actually, you only need to increase one capacity for the sling pocket from 0 to something else and change the restriction on that pocket to include ammo to be able to store belts. So what are the other problems?
Also, I just heard that you have made cleaning kits for Urban Chaos. Could I add the item pictures for that to the trunk? And if yes, where can I get them from?
Sure, the cleaning kit graphics are available in the current UC-1.13 v3.7x release as P5Items 758. Graphics are kept in a separate Data-Graphics folder.
While we're on the subject of graphics and your features, you also have permission to grab the interface image for the Masterkey. I seem to remember that the current one is only a place holder. Graphic P4Items 89. Additionally, it fits a small attachment slot.
EDIT: both graphics also have tileset graphics as well. One of the things I'm doing is filling in some tile sets for attachments and gun items.
[Updated on: Sat, 11 August 2012 17:56] by Moderator
Planned to add that in the far far future for my WH40k stuff... but I do not have any explosion animations for that. I also don't see any real-world electric explosions that would fit the game.
Hello!
You refused the idea of replacing a gun magazine with an ammo belt what seems to be one bad decision!
Was that decision made purely by design concept or unwilling to mess with accordingly boosted complexity of coding?
I think it'd be righter to focus on MG feed process instead of MG team. Something like this:
1) MG must be UNLOADED
2) MGner must have his weapon IN ANY HAND
3) if 1)+2)=OK he/helper must spend APs for READYING / INSERTING belt into the gun (10-20 by default) *
* maybe by $-menu? You could even to choose which belt in a vest (if a vest has some belts) / other places to feed from this way!
4) the ammo belt TEMPORALLY CLONES itself. One copy stay like it is (and is the base). Another is temporally inserted (temporal magazine). Shooting the gun causes both copies sync-spend ammo! Of course "temporal magazine" disappears if 5) happens!
5) Removing MG from hands, depleted or taken away belt means the process must be repeated
If you could do this that would be very cool! I like very much both this feature and how it interfaced now. But I feel strong luck of adjustments I described above.
To explain further I have to highlight the most disturbing things at now! It is inability to feed MG with unmatching ammo (HP, AP, Tracer...) and this weird way how ammo count allowed to be fired (from OUTER source) depends on ammo count INSIDE MG magazine.
Additionally possibility to feed (the way described above or the present one) from attachment may be useful. And further would go a special ammobelt slot (somehow involving spending APs) instead of secondary hand for guns recognized as belt-feeded to allow belt-feed without helper / special vest. This way could difference between MG able to attach an ammobox to itself like PKM and MG not able to be highlighted.
Another problem is you cannot transform ammo to for example 200 round belt IF you don't have a MG with this amount!!! Not sure how this is to do the simplest but have one thought. It's an attachment like "masterkey" UB shotgun plus coding that an UBgun cannot be chosen by scrolling through firemodes (by "B" key) if it's ammo belt.
Yeah, no. Cloning objects this way (so the same object is at 2 placces at once and properly synchronized all the time) would require waaaaay to much code, especially for such a niche feature.
I don't really get how attaching ammo would help at all. That would complicate firing and display code for no gain I can see.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
Is this in the program now? I cannot seem to get it to work..
Using 1.13-version v0-3967-g27954b (gitHub release) from 23.05.2023 for this video
Currently it only works with LRAK SAW-Vest and some belts/weapons added after the feature got implemented (2012, so a few ...) ain't yet defined to use it
So, only this vest will work. And not all ammo belts. the ones that do show the symbol you can see at video in item description. and if conditions are met, the merc faces will show the symbol too.
I'm currently tinkering on it to update it. But apart from some not yet defined items (and the symbol indicating feedable for weapons) it's working fine. 4x 200 in vest-slots and if weapon also fits 200, that's a whopping 1000 bullets
it will drain your merc, see the "?" in the video instead of cursor at some point. That's when Ace run out of enough BP.
you can check items.xml for the flags in first post to see which items are used at the moment
edit: video is partly mute due to copyright complaint about the music. taught me something, next ones will be mute or using SSA