Home » MODDING HQ 1.13 » v1.13 Coding Talk » [IDEA] New Magazine System
Re: [IDEA] New Ammunition System[message #281323] Sun, 29 May 2011 19:03 Go to previous messageGo to previous message
Kazuya is currently offline Kazuya

 
Messages:208
Registered:January 2009
T_Bolt
how gun remembers that the round chambered is a different type I leave up to you smart folk.
In other words, your idea isn't fully thought through.

T_Bolt
There's not really any need for loose ammo other than for those guns that don't use magazines. Working within the existing system we just need empty magazines that can be refilled, ammo crates/boxes already act as non loaded ammo it doesn't need to get any more complicated than that.

No, you missed the point. The current system leads to an exponential increase of entries in items.xml. This is because, ammunition and magazines are currently one and the same thing. Once they get seperated, the required number of entries will merely grow linear. The creation of empty magazines is merely a by-product of that seperation. Just adding empty magazines to the existing system will not address that issue. And the loose ammo is needed, otherwise you won't be able to refill your mags. The ammocrates already represent loose ammo to a certain degree, they just have a crate picture. The proposed loose ammo would behave similar to ammocrates, with the exception, that they would be dividable.

T_Bolt
Likewise there's no need for a chamber attachment, the logical thing to do is increase the ammo capacity of any semi-automatic and automatic weapon to +1 over the maximum magazine size.

That's certainly the wrong way to do it. If I reload a half filled magazine, using the maximum mag size would create bullets out of thin air. What you probably mean is to increse the current ammoload of the inserted magazine by one. First your system doesn't allow to unload a magazine and fire the remaining round without inserting a new mag. Second, magically increasing ammunition is a crude way to achieve the desired effect. You would have to make sure, that the player doesn't get all the ammo back, when he unloads the gun. So you would have to magically decrease it as well. This approach is prone to creating new bugs in the code. Overlook an instance, or a situation where this is needed in the code and you will have rounds appearing or disappearing into and out of thin air. Finding such a mistake is another tedious task.

T_Bolt
Then when you load a full magazine while the gun still has 1 round left, an empty magazine is created leaving the gun with max ammo count +1. If the previous magazine contained a different ammo type then that data is transferred to the created empty magazine
Why would you transfer that data to the magazine? That makes no sense whatsoever. A chambered round stays in the gun.

T_Bolt
Now the question is how to create an empty magazine, rather than create a whole new set of items in the xml list, what is needed is an invisible bullet. Have the game add one to the ammo count of every magazine.

Oh please no. This is ridiculous. This invisible bullet can't know which ammotype was previously loaded into the gun. So you would have to create extra code that determines that. Otherwise your AP round left in the chamber could change into something else, just because the player inserted a different ammotype. What if the player changes half way his mind and reloads a different magazine with different ammo? For example, The gun has a standard ball round in the chamber and I reload a mag with AP ammunition, but then decide to unload that mag and load Glaser rounds. Now you would have to additionally check, if the player fired a round. If he did, the new invisible bullet would have to become the new ammotype, otherwise it would have to remain the old ammotype. All this can easily be avoided by storing the last bullet, either as ChrisL proposed by an ammolist or as I proposed with a chamber attachment. Creating invisible bullets that magically change in the magazines is anything but logical. The design is far from elegant, it is a rather nasty hack. And that system will cause more problems as soon as someone tries to create further demanded features. Just think of magazines with mixed ammotypes.


T_Bolt
This should be invisible to the player and weapon so a 31 round magazine still displays as 30 and only fires 30 (unless there was 1 round already chambered). So weapons can have plus one over their max capacity but can only load their max capacity.
With such a system in place, coding the ability to load drum- and c-mags would turn into a real nightmare, because this requires to remove the max capacity entry from the gun.

T_Bolt
I know this wouldn't allow for everything the OP was asking for but it wouldn't require any new items to be created.

That's a moot point, because the proposed ammunition and magazine system would overhaul the required items anyway.
Your system would store information (the chambered round) in an object where it doesn't belong to (the magazine) and utilize a value (ammocount) which is used for something else. This is not logical. It is not even intuitive. And once the other features are tackled, your system would be rather a burden than an improvement.

Report message to a moderator

Sergeant 1st Class
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: (New) Common Attachment Framework (new title; was The NAS Receiver)
Next Topic: Path finding problems in 1.13
Goto Forum:
  


Current Time: Fri Jan 10 14:35:56 GMT+2 2025

Total time taken to generate the page: 0.07662 seconds