Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » All about modding JA2 » New weapons with inexplicable behavior.
New weapons with inexplicable behavior.[message #352270] Sat, 03 February 2018 05:15 Go to next message
AllisonIsLivid

 
Messages:12
Registered:January 2018
Location: New England
Following up on a post from last week, I have successfully ported a number of items between mods. However, despite the help of a few of the mod wizards around here, I've encountered some problems with no apparent cause, and am desperately looking for solutions.

First, I am unable to port weapons with manually cycled action, or more specifically, when moving bolt and pump action weapons, they stop functioning as bolt and pump action weapons despite everything (apparently) being in place for them to work properly.

[insert weapon/item.xml screenshots here]

This pump shotgun is one of the offenders. As I understand, all it requires is an <APstoReloadManually> field in order to require manual cycling, but this didn't seem to be working. Until at some point where it and one other shotgun I ported both suddenly started functioning normally. And I do mean suddenly, as I hadn't altered the entries for them, or done anything but run another test, only with NCTH activated for once. Flugente tells me that manual cycling should work fine with either aim system, and their tests and my own with other weapons showed no difference in behavior. So it's a mystery what changed, or how, which means I unfortunately can't replicate it with other broken weapons.

[picture in your mind's eye an image of a weapon and item.xml file, describing an Enfield 1917. It's nice, isn't it?]

This rifle, for example. Added not long after the shotguns, and suffering the same issue with the game treating it as though it were a semi-auto. Unlike the shotguns, it has not suddenly fixed itself. The only thing that's different about these guns from when I ported them is the <APsToReloadManually> for the rifle, which I lowered while testing, and has since returned to it's starting number.

The second problem is more frustrating, and game impacting. This rifle, and several other weapons I intend to port use ammunition that is in 1.13, but in quantities other than the 1.13 standard magazine size. I ported a few variants of the 5 round stripper clips for this gun from the same mod, and they are working just fine. But for some reason, the rifle itself shows up loaded with a partially filled magazine for the M1 Garand, which uses the same caliber of ammunition. I can load and unload it into the gun, but it ejects as the 8 round en block clip, with 5 rounds in it, every time. This is despite the fact that the stripper clips are available, spawn in inventory correctly, work with the rifle, and eject from the rifle as 5 round stripper clips. Aside from increasing the AP cost of reloading the gun, and being strange, the en blocks make the AI unable to use the rifle properly, as they spawn with spare en block clips in their inventory automatically, and can't reload the gun from them.

This is an issue I can't move on without fixing, as all the remaining guns on my project list, both for porting and building from scratch, use existing ammunition calibers, but in non-default quantities, requiring new magazine items. If they're all going to have the same problem, then they aren't going to be useful to my mod.

[I admit, this wasn't a great screenshot. But I think it could have helped illustrate what's going on.]

Seen here, the perfectly functional stripper clips, and the partial en block that spawns in the rifle.

If anyone has any thoughts, or sees what I may have done wrong here, please give a shout, as I have run out of ideas, and nothing I've tried has improved any of the issues. Except for doing nothing, which worked twice, somehow.

P.S. I apparently can't include the screen grabs I've taken to illustrate the problems. So pop into the discord if you want to examine them.
Re: New weapons with inexplicable behavior.[message #352273 is a reply to message #352270] Sat, 03 February 2018 08:06 Go to previous messageGo to next message
edmortimer

 
Messages:939
Registered:January 2015
Location: Home Free
Ammo magazines can be a real pain to mod. The problem is Magazines.XML - all entries must be in sequence. Once that is set you must then adjust all the references in Items.XML of the magazines/boxes/crates that you moved to make room for the new magazines.

So . . . you can't add .30-06 5-rnd clips to the end of the file or the end of the .30-06 entries. You must move the 8-rnd clips up (and everything above them), place the 5-rnd clips where the 8-rnd clips were, then adjust all the references in Items.XML for everything you moved.

If you look at my Magazines.XML you'll see that I moved stuff around to make room, and deleted ammo AV doesn't use in order to make room for ammo that AV does use. It's a real pain but there's no way around it.




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: New weapons with inexplicable behavior.[message #352274 is a reply to message #352270] Sat, 03 February 2018 12:49 Go to previous messageGo to next message
Shanga

 
Messages:3549
Registered:January 2000
Location: Danubia
AllisonIsLivid wrote on Sat, 03 February 2018 05:15

P.S. I apparently can't include the screen grabs I've taken to illustrate the problems. So pop into the discord if you want to examine them.


Sorry, we've been constantly targeted by automated spambots so we had to limit on new accounts. Just add the links with spaces (like https:// i.imgur.com / o9ELGP1.jpg) and I will make sure to edit the message and make them appear. Once your reach 10 message posted you will have full rights.


Re: New weapons with inexplicable behavior.[message #352280 is a reply to message #352274] Sun, 04 February 2018 00:47 Go to previous messageGo to next message
AllisonIsLivid

 
Messages:12
Registered:January 2018
Location: New England
That makes sense, I get it. I can't seem to edit the post though, and the spacing thing isn't working either.

And that is really good info Ed, thank you. I guess that's going to be some work, but at least I know what to do about that problem now.
Re: New weapons with inexplicable behavior.[message #352291 is a reply to message #352280] Mon, 05 February 2018 00:04 Go to previous messageGo to next message
AllisonIsLivid

 
Messages:12
Registered:January 2018
Location: New England
Hypothetically, couldn't I append all the magazines in question to the end of the list, nada their current index entries, and not have to update literally everything in between the ammo types I'm adjusting and the end of the items index? Or will that not work for a reason I haven't considered?
Re: New weapons with inexplicable behavior.[message #352292 is a reply to message #352291] Mon, 05 February 2018 00:32 Go to previous messageGo to next message
edmortimer

 
Messages:939
Registered:January 2015
Location: Home Free
All magazines of the same caliber have to be together and in sequence in both in number of bullets per cartridge (smallest number to highest, each type of mag all together - all 5-rnd, all 8-rnd, etc)) AND in ammotype (Ball, HP, AP, etc (as they are indexed in AmmoTypes.XML), within each block of one type of mag in sequence by ammotype).

So:

.30-06 5-rnd Ball
.30-06 5-rnd HP
.30-06 5-rnd AP etc
then
.30-06 8-rnd Ball
.30-06 8-rnd HP
.30-06 8-rnd AP etc

skipping over the ammo types you don't have for that cartridge -- but staying in sequence.

If not, then what will happen in game is that ammo might disappear when ejected (that plagued me no end), change ammo type when ejected, change magazine when ejected, or even do minimal damage until ejected and re-loaded because the game couldn't find the type of ammo it was supposed to load for the enemy. Or . . . it can crash the game when ejecting ammo (even if the enemy goes to reload). There really is no way around it.

The best thing I can think of doing is for you to decide ahead of time what calibers and types of ammunition you will be using, map each caliber out as to type and magazine in order to see how many entries you'll need, and then either:

1) add them all to the end of the file, adjusting any existing references in Items.XML (the easiest way)
2) delete ammo magazines not used in your mod to free up spaces, move other ammo around to get enough space for each caliber, and adjust all references in Items.XML (a real pain - and what I did because I decided to add ammo over time, and did it piecemeal)

If I had it to do over again (and it's on my long list) I'd go with #1. Just don't try to leave existing mags where they are and add new mags in a different spot - it won't work.

OH - one more thing - they have to be in sequence by AmmoString also -- so .30-06 can't appear after, say, Pepper Spray. So, when moving calibers to the end of the file you'll also have to move calibers (and adjust references) for all calibers after and between the calibers you are moving. You can leave the old entries alone as long as there are no references to them anywhere.

Though, I guess you could re-add only the calibers you are needing to move to AmmoStrings.XML with their new index number . . . and not have to move those above or between calibers you've moved. I haven't tried this, but it should work - again, as long as nothing else references the old index number in AmmoStrings.XML.


BTW, all of this is not savegame compatible - there will be glitches.

[Updated on: Mon, 05 February 2018 00:44]





Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: New weapons with inexplicable behavior.[message #352293 is a reply to message #352292] Mon, 05 February 2018 00:43 Go to previous messageGo to next message
AllisonIsLivid

 
Messages:12
Registered:January 2018
Location: New England
That sounds like the sort of thing that's happened as I tried to solve this myself. Which is very heartening, honestly. Thanks again! I'll get to work organizing the ammunition types.

Do I need to make sure that the ammunition in a given caliber is in order as well? For example, if I have .30-06 as ammo caliber 45, and .30 Car as caliber 44, doe I need to make sure that all the .30-06 ammo is in the items list after all of the .30 car? Or does it only matter that the magazine sizes and types are in order?

EDIT: never mind, looks like you answered that already. So it does sound like the easiest thing to do is move everything I want to work with to the end of the line, in the proper order, and then adjust the ammo strings to match. So I should be able to do this cleanly, and only have to replace a few chunks of ammo from the item index. .45, .30 car, and .30-06. Then adding anything new, like the Boys .55, would just go on the end again.

[Updated on: Mon, 05 February 2018 00:52]

Re: New weapons with inexplicable behavior.[message #352294 is a reply to message #352293] Mon, 05 February 2018 00:54 Go to previous message
edmortimer

 
Messages:939
Registered:January 2015
Location: Home Free
Yes, you got it!




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Previous Topic: Copying items into 1.13
Next Topic: JA2 archive
Goto Forum:
  


Current Time: Tue Feb 20 21:36:37 EET 2018

Total time taken to generate the page: 0.01429 seconds