Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » Questions concerning not "completely" recognized ammos from IoV
Questions concerning not "completely" recognized ammos from IoV[message #328523] Mon, 25 November 2013 07:00 Go to next message
John_5696

 
Messages:38
Registered:November 2009
Location: Mainland China
Greetings,

I just add a simple version of bug phenomena here:

If I feed a gun with the right MagSize magazine, it can be ejected perfectly. If I feed with a larger magazine, or this weapon is feed by the game mechanism, like recruiting a new merc or buying from BR, then bugs appear, either the weapon is lost or the ejected magazine is lost. So basically, the game can't help a weapon to find the bugged mags, but these mags are all right themselves, spilting or merging, they are just transparent to the guns using them through some inner mechanism.

===============
This is the old contents:

As of v929, there is a series of bugs related to IoV specific ammos, for example, when MercStartingGear of someone contains a weapon with different magazine size than 1.13 XML, even if these series of magazines are well defined, and behaves normal in everything except:

1. they cannot be automatically assigned into a weapon after recruiting, this weapon will simply disappear (such as Colt 9mm SMG with 32 rounds of 9x19mm). If we purchase it from BR, it will appear with no ammo inside (for other normal weapons they will come with the ammo).

2. If we reload this weapon with ammo of a different size (for example we feed Colt 9mm SMG with 100 rounds 9x19mm Mag, this action will be successful), the game will not recognize what kind of ammo it is when we draw the new one out, the ammo will also disappear (even though they were well defined in XMLs). Strange thing is these ammos are not "completely unrecognized" because if we feed this weapon with exactly the right size of ammo, they can be drawn out fine.

So, the bug seems complicated but the questions here are simple:

1. For each calibri of ammo, there is a series of different ammo types defined in the AmmoTypes.xml. So is there a tag somewhere defines which type of ammo the game will choose when a merc gets its gun (as well as purchasing from BR) in the XML file? I think it is most probably due to not recognized ammo in this specific action that causes the weapon to disappear.

2. Also, when we click to remove ammo from a weapon, the game went through a procedure to choose which magazine it should be, and I'm pretty sure it remembers which was "fed in" before and trying to come out, if it is the right ammo for the weapon, exactly as what is fed in. But if it was fed by a "wrong" size of magazine, it will remember that the original size was wrong and it should select the right ammo when we draw the ammo out, and this is exactly where the problem is: the game failed to locate Index for this ammo so it draws out nothing.

I'm not familiar with sourcecode and I couldn't find any XML tags describe these kind of actions. So please help me figure out where the problem is, thanks.

Edit1: add a short version of bug phenomena.

[Updated on: Thu, 28 November 2013 04:28] by Moderator

Re: Questions concerning not "completely" recognized ammos from IoV[message #328532] Mon, 25 November 2013 15:31 Go to previous messageGo to next message
Sam Hotte

 
Messages:2033
Registered:March 2009
Location: Middle of Germany
To me this sounds like you'd have to add the correct magazine item (e.g. have a 32rds 9mm mag for all applicable ammo types [ball, AP, ...]) to or change existing 30rds SMG to 32rds in XMLs and are done without coding.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328533] Mon, 25 November 2013 16:07 Go to previous messageGo to next message
John_5696

 
Messages:38
Registered:November 2009
Location: Mainland China
Sam_Hotte
To me this sounds like you'd have to add the correct magazine item (e.g. have a 32rds 9mm mag for all applicable ammo types [ball, AP, ...]) to or change existing 30rds SMG to 32rds in XMLs and are done without coding.


Thanks for your advice, and here is what I've got following your suggestion:

1. There are 30 entries in the AmmoTypes.xml, and 30rds 9x19mm SMGs (who behave entirely normal) have only 6 types of ammos just like 32rd SMG mags (who are bugged). (almost identical except for MagSize/pic/sound etc.)

2. Well it is definitely OK to change 30rds to 32rds and simply delete original bugged 32rds, but this doesn't explain the reason for the bug.

3. There are many codes concern recognizing MagSize, such as splitting crates and boxes into magzines, merge all magazines into crates etc., and under such circumstances these 32rd magazines behave normal, except for those two phenomena I've mentioned above.

I'm really running out of idea, it's like a maze to me.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328534] Mon, 25 November 2013 16:32 Go to previous messageGo to next message
Sam Hotte

 
Messages:2033
Registered:March 2009
Location: Middle of Germany
Your description doesn't hint to ammotypes.xml, for me at least.
I'd rather think there is an error with linking the magazine (32rd 9mm SMG mag) with the gun (Colt 9mm SMG); hence I'd look into:
1. items.xml - are the 6 32rd mag items and the gun using them correct?
2. magazines.xml - are they correctly in there?
3. weapons.xml - just to make sure, nothing went wrong with the gun.

Ah, and take a look into bug report section, I've read just today somebody reporting issues with special calibres in last/recent version - perhaps your thing may be related with this.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328537] Mon, 25 November 2013 17:17 Go to previous messageGo to next message
John_5696

 
Messages:38
Registered:November 2009
Location: Mainland China
Sam_Hotte
Your description doesn't hint to ammotypes.xml, for me at least.
I'd rather think there is an error with linking the magazine (32rd 9mm SMG mag) with the gun (Colt 9mm SMG); hence I'd look into:
1. items.xml - are the 6 32rd mag items and the gun using them correct?
2. magazines.xml - are they correctly in there?
3. weapons.xml - just to make sure, nothing went wrong with the gun.

Ah, and take a look into bug report section, I've read just today somebody reporting issues with special calibres in last/recent version - perhaps your thing may be related with this.


Yada, that's the first thing I do when I found this bug, I checked back and forth like a hundred times till I got myself really mad, I cannot find anything missing.

As I said above, if I manually feed the 32rd magazine to that SMG, this very magazine can be drawn out perfectly, if there is anything wrong with classindex (like missing tags, repeating index or anything) this would not have been done.

Anyway, I still feel that I have left something unnoticed, maybe it's better just to wait for a while. Thanks for your patience.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328549] Mon, 25 November 2013 20:08 Go to previous messageGo to next message
JMich

 
Messages:580
Registered:January 2011
Location: Greece
John_5696
Anyway, I still feel that I have left something unnoticed, maybe it's better just to wait for a while. Thanks for your patience.
Is any of the 32-round magazine Standard Issue? That is the "default" ammo so to speak, and as I recall, one of the magazines should have that tag.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328560] Tue, 26 November 2013 00:21 Go to previous messageGo to next message
Flugente

 
Messages:3051
Registered:April 2009
Location: Germany
1. The magazine a fresh gun 'starts' with is mostly the first fitting magazine that has the -tag in AmmoTypes.xml.


Re: Questions concerning not "completely" recognized ammos from IoV[message #328570] Tue, 26 November 2013 05:17 Go to previous messageGo to next message
John_5696

 
Messages:38
Registered:November 2009
Location: Mainland China
Thanks you guys, I checked this code earlier and looked into the "StandardIssue" tags and I found nothing wrong there, for example, within these 6 types of 9x19mm 32rd mags, there are "Round Nose FMJ (which is Ball in 1.13)", "JHP" as well as "SAP" checked as "StandardIssue" however all three of them are not recognized with the 32rd magazine, but with 30rd magazine, these 3 ammo types are all right.

This bug is two fold and can be check in two ways, first they cannot be recognized when the game checks DefaultMagazine() function, it may fail and return 0. And second, it fails when check EjectAmmoAndPlace(){CreateAmmo()} function because as I postulate, it failed to recognize data.gun.usGunAmmoItem. I still don't know how this usGunAmmoItem gets it's value because clearly the gun doesn't have tags directly link to which uiIndex magazine it is using, but through a procedure of checking both Ammostring value and MagSize value and then check the database to find the right uiIndex, if it fails to find (but actually they are there), we eject the magzine and gets nothing, but EmptyWeaponMagazine() works and cleared the magazine inside.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328577] Tue, 26 November 2013 14:18 Go to previous messageGo to next message
pheloncab

 
Messages:266
Registered:August 2004
Location: So. Cal. or texas
Why don't you zip up your xmls and put them online and maybe we can take a look and see if we can spot anything you might be missing.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328584] Tue, 26 November 2013 17:08 Go to previous messageGo to next message
John_5696

 
Messages:38
Registered:November 2009
Location: Mainland China
pheloncab
Why don't you zip up your xmls and put them online and maybe we can take a look and see if we can spot anything you might be missing.


Thanks for your advice, I uploaded TableData files here:
IoV v929 TableData Files (less than 620Kb)

I also have a working IoV here on Github:
Link to IoV v929 Mod on Github
You can download this and try it on the latest 1.13.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328657] Thu, 28 November 2013 04:02 Go to previous messageGo to next message
pheloncab

 
Messages:266
Registered:August 2004
Location: So. Cal. or texas
Ok so far looking over the XMLs Magazine looks normal
I'm only finding two weapons using the 32 shot 9mm magazine, the colt 9mm smg #346
and the Jati-Matic Pdw #681

So the first question is .. does the Jati give the same issue as the colt.
if no, its the colt itself thats the problem. if yes it could be the ammo or sounds or graphics.

so if yes, take a working 9mm like an uzi and change the magazine size and see if the uzi breaks which would make it a ammo issue.


<-- I don't use the mod so I can't do more than general Tshooting.
Re: Questions concerning not "completely" recognized ammos from IoV[message #328658] Thu, 28 November 2013 04:23 Go to previous messageGo to next message
John_5696

 
Messages:38
Registered:November 2009
Location: Mainland China
pheloncab
Ok so far looking over the XMLs Magazine looks normal
I'm only finding two weapons using the 32 shot 9mm magazine, the colt 9mm smg #346
and the Jati-Matic Pdw #681

So the first question is .. does the Jati give the same issue as the colt.
if no, its the colt itself thats the problem. if yes it could be the ammo or sounds or graphics.

so if yes, take a working 9mm like an uzi and change the magazine size and see if the uzi breaks which would make it a ammo issue.


<-- I don't use the mod so I can't do more than general Tshooting.



Thanks for your help. There are at least 28 guns using 32rd 9x19mm magazine in the IoV mod, and I'm pretty sure all of them have this issue which makes it an ammo issue of course.

Up to now I've tested about half of the magazines in the IoV mod, and I can confirm that this is a systematic issue and I couldn't find any connections between these bugged mags (actually many IoV specific magazines work just fine). Very tricky it seems to me, which makes me wander if there are any other weird codes that are not externalized from the source-code.

Graphics and sounds are definitely OK, that's for sure because I can split and merge and even extract for example the 32rd 9x19mm magazine if it is the just the magazine I've loaded on the weapon using them.

Thanks again for your test, so that I don't need to worry about a lot of xml parts.


Add:

Finally I grabbed something, when the bugged magazine was in the weapon and I reloaded it directly with another bugged magazine, the game crashed (thanks god it finally crashes), and showed this:

"Assertion Failure: [Line 661 in file Item Types.cpp]."

Attempting to save a debug profile failed.

So I think we can follow this lead to find the ghost of this tricky bug.

Edit1: Game finally crashed.

[Updated on: Thu, 28 November 2013 08:05] by Moderator

Re: Questions concerning not "completely" recognized ammos from IoV[message #328665] Thu, 28 November 2013 13:30 Go to previous messageGo to next message
pheloncab

 
Messages:266
Registered:August 2004
Location: So. Cal. or texas
hmm, I did a find on the magazine size and it kept flipping between the two and no others so I assumed they were the only two using it.

Glad we finally have an error to look into.

Re: Questions concerning not "completely" recognized ammos from IoV[message #332328] Fri, 09 May 2014 11:39 Go to previous message
Toma777

 
Messages:54
Registered:October 2013
Location: serbia
Tried iov 929 alpha from github with stable sci and exe posted by Sevenfm in "Some Experimental Visual Enhancements" thread and weapon with bugged ammo dont diseaper anymore and dont cdt, now instead their mags they use 9x19 SMG 30 rnd mag, examp barret now use 9x19 instead 50bmg!
Previous Topic: How to compile JA 1.13 UB Exe
Next Topic: Stop items from appearing in-game
Goto Forum:
  


Current Time: Sun Jun 25 04:58:24 EEST 2017

Total time taken to generate the page: 0.00873 seconds