Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » WW2 Restricted Weapons (Cutting down the weapons list to WW2 only weapons)
WW2 Restricted Weapons[message #365001] Tue, 29 November 2022 00:30 Go to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Hello everyone.

For a while I've been wanting to mod 1.13 by removing the vast majority of weapons down to only those used during WW2.

1.13 mod already has a decent number of WW2 era weapons implemented like the 1911A1, M1A1 Thompson, Kar-98K rifle, Browning M1919 machine gun, etc.

My initial idea was to just go through the weapons.xml file and delete out any weapons I didn't want to appear in the game, however, I'm concerned that this might break some scripted events in-game like the enemy mercenary that is supposed to carry the HK G11.

What obstacles will I run into if I just start deleting out weapons en-masse?

Eventually if my first idea works (IE deleting out non-WW2 weapons), and I am motivated to do so, I might want to start adding in other WW2 era weapons that the game doesn't already feature. But that is certainly a phase 2 step and not something I want to contemplate right now.

So please let me know if I'm setting myself up for some issues. Will I break scripted events? Will I cause the game to crash? Will I need to edit the starting equipment tables?

Thank you.

-MadMechanic

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365002 is a reply to message #365001] Tue, 29 November 2022 12:20 Go to previous messageGo to next message
Hawkeye is currently offline Hawkeye

 
Messages:2346
Registered:October 2005
Location: Australia
I might be mistaken but I think it will be more than likely if you've deleted an item that is being used in an characters inventory, or is placed on a map the game will just present that missing component as a NADA item.

If you are on the look out for more ready to use WW2 items you may want to take a look at the 'Fight For Freedom' mod too.

Report message to a moderator

Lieutenant

Re: WW2 Restricted Weapons[message #365005 is a reply to message #365002] Wed, 30 November 2022 18:21 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Great, thank you for the reply and the information. Trying someone else's mod first might be a better idea than going through all the headaches of setting up item tables for the first time.

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365007 is a reply to message #365005] Sat, 03 December 2022 23:58 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Hello everyone, I'm back with an update and a question.

In the interest of learning how to mod the files and assets of 1.13, I decided to go ahead with my own "WW2 Weapons Only" mod. Over the last couple days I have gone through the various tabledata xml files and deleted out every weapon I don't want to appear (deleted from both weapons.xml and items.xml) as well as ammo types and calibers that I don't want (like modern NATO calibers and ammo types like Glaser and AET).

The last thing I did was to modify the IMPItemChoices.xml file based on the new selection of weapons and equipment. For instance I changed the Default Items to the following:
<uiIndex>0</uiIndex>
<name>Default Items</name>
<ubChoices>8</ubChoices>
<ubNumItems>8</ubNumItems>
<bItemNo1>176</bItemNo1> <!-- Steel Helmet -->
<bItemNo2>1090</bItemNo2> <!-- LBE Gear -->
<bItemNo3>1094</bItemNo3> <!-- TIMS Backpack -->
<bItemNo4>1097</bItemNo4> <!-- TIMS Pack -->
<bItemNo5>1641</bItemNo5> <!-- Large Pistol Holster -->
<bItemNo6>8</bItemNo6> <!-- M1911A1 Pistol -->
<bItemNo7>80</bItemNo7> <!-- .45 ACP Pistol Magazine, 7-rounds -->
<bItemNo8>80</bItemNo8> <!-- .45 ACP Pistol Magazine, 7-rounds -->

The comments are for my own tracking/sanity as I go through this process.

My next step was to start the game, start a new game and create an IMP character. From there I deployed and checked their inventory. What I found was that they received 7 out of those 8 "Default Items", everything except ItemNo6, which is the M1911A1 handgun.

They had all the LBE gear, steel helmet, the pistol holster as well as the 2 spare pistol magazines. Everything was placed in their inventory correctly but the pistol was missing.

Any ideas what happened here? I made no changes to the M1911A1 weapon in items.xml or weapons.xml, it was left exactly as it is implemented in the latest 1.13 file package. I feel like I missed something somewhere like in another xml file but I am hoping someone here can chime in and tell me what I either don't know about or overlooked.

Thank you all for any help you can provide.

-MadMechanic

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365008 is a reply to message #365007] Sun, 04 December 2022 01:31 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Ok, I 'solved' my starting gear issue by discovering there is an XML file editor tool included in the 1.13 download package. Yes, I am dumb to not see that before. But using the XML editor tool I was able to edit the IMP Starting Gear file to provide the default gear that I want.

However, trying to start up the XML editor after having hacked up the items.xml and weapons.xml files by literally deleting items out meant that the XML editor threw a lot of errors when I tried to launch it and it couldn't find a lot of index ID #s.

So I ended up "re-installing" 1.13 so that items.xml and weapons.xml (and all other xml files) are intact. Now the XML editor launches. That said, this now leaves me with 1 issue/setback and 1 annoyance.

The issue/setback I have now is that all the weapons and ammo types that I deleted are back, and now I have to figure out how to disable or delete those items via the XML editor. I tried right-clicking on a row for an item in the items.xml table to see what options I have and I see where I can duplicate an item or create a new item (amongst some other options) but I don't see any option to delete or disable an item, or change it to a "Nada".

The annoyance I'm having is that the XML editor is quite laggy. I don't know if this is just how the editor performs, or if it has to do with me running it on windows 10. I know that the 1.13 project was forced to migrate it's development and source code to github in October of this year and I have looked around on the github repository to see if there is a newer version of the XML editor available and I don't know if there is. I know there is an entire sub-category for the XML editor development but I don't know how to compile the source code into something useable and I didn't see an executable file I could just download.

Any ideas? Anyone familiar with the XML editor that could teach me how to delete/disable/Nada existing items?

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365009 is a reply to message #365008] Sun, 04 December 2022 03:33 Go to previous messageGo to next message
Hawkeye is currently offline Hawkeye

 
Messages:2346
Registered:October 2005
Location: Australia
I don't know if you are aware but the XML editor is broken and has a way of butchering your data. It really should only be used as a viewer for now.

Report message to a moderator

Lieutenant

Re: WW2 Restricted Weapons[message #365010 is a reply to message #365009] Sun, 04 December 2022 03:49 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Hawkeye wrote on Sun, 04 December 2022 03:33
I don't know if you are aware but the XML editor is broken and has a way of butchering your data. It really should only be used as a viewer for now.
I was not aware of this, thank you for letting me know. So my manual editing of the xml files with Notepad+ is a 'safer' way to go about this.

That still leaves me with the question of why the IMP gear settings I made with manual XML edits resulted in no guns being issued to a custom mercenary, but if I use the XML editor it works. I feel like there is something somewhere in the game settings that I don't know about regarding IMP weapon assignments.

Also, I noticed that the game will automatically issue a set number of spare magazines for each weapon the IMP merc is issued. These magazines do not show up in any of the ImpGear xml settings, but I also can't figure out where in the game files this setting is. It does also mean that the 2 .45 ACP magazines I had as line items 7 and 8 in my sample xml data from a couple posts ago are unnecessary, IF I can figure out why the handgun (line item 6) is not being issued during merc creation.

[Updated on: Sun, 04 December 2022 03:54]

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365011 is a reply to message #365010] Sun, 04 December 2022 05:37 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Ok, so I'm poking around the file tree a bit more and perhaps I found part of my IMP gear problem? (maybe?)

So far I have been doing all of my XML file changes to the files located under the folder "Data-1.13", but I also see there is a "Data-UB" folder which seems to contain another copy of the XML data tables.

Do I need to modify XML files in both locations?

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365012 is a reply to message #365011] Sun, 04 December 2022 11:17 Go to previous messageGo to next message
Asdow is currently offline Asdow

 
Messages:102
Registered:August 2010
That depends on which game are you targeting, original campaign or Unfinished Business. The Data-UB folder is only used when the game is configured to start Unfinished Business campaign, and it also requires a ja2.exe file compiled specifically for it.

Report message to a moderator

Sergeant
Re: WW2 Restricted Weapons[message #365013 is a reply to message #365012] Sun, 04 December 2022 17:35 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Asdow wrote on Sun, 04 December 2022 11:17
That depends on which game are you targeting, original campaign or Unfinished Business. The Data-UB folder is only used when the game is configured to start Unfinished Business campaign, and it also requires a ja2.exe file compiled specifically for it.
Ahhh ok. Well I have never played unfinished business and don't plan to anytime soon so I will just ignore that folder tree and focus on the 1.13 data folder tree.

Thank you for clarifying that.

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365016 is a reply to message #365013] Sun, 04 December 2022 21:45 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
I have now started over with fresh files. A fresh installation of JA2 Gold from STEAM, fresh 1.13 official release + the patch.

I have gone back through the items.xml file and set all items I do not want to appear to "Nada" (I copied an existing "Nada" placeholder item to get the correct index parameters). I think I may have caused issues previously by straight deleting index items.

From there I have been tweaking the IMP Starting Gear and I also roughly changed the Regular Enemy Weapons table to only use weapons that are currently available.

So far so good overall. I still can't figure out why in my previous attempts at XML file edits I couldn't get weapons to properly populate in IMP mercenary inventories on creation, but for the time being right now it is working.

I haven't touched the weapons.xml file, I might be wrong about this but I figure that if a weapon is not listed in the items.xml file, then it just won't be available in-game, so there was really no reason at all for me to have edited the weapons xml file originally, I can just leave it alone.

My next task will be trying to figure out how to set enemy weapon/ammo access progression. When I ran my last test game (start new game, make an IMP merc, deploy) the enemies in the deployment sector were already using a mixture of normal 'ball' ammo as well as AP ammo, so that isn't right.

[Updated on: Sun, 04 December 2022 21:46]

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365022 is a reply to message #365001] Tue, 06 December 2022 19:40 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Alright, this is driving me a bit crazy here. not sure

I think I've determined that buried somewhere in some file or chunk of code is a setting that defines the default magazine/ammo load for a given weapon. If the game cannot find the default magazine/ammo item in the items.xml (and associated xml tables), then the game won't allow a weapon to be added to an IMP merc inventory upon merc creation.

My 'proof' for this is as follows. I forced the Baikal MP-133 shotgun to be issued as a default gear item for IMP mercs. This is a 7-shell capacity shotgun. Shotguns are loaded with slugs by default.

I then 'removed' the 7 shell slug magazine from items.xml by setting it's code block to 'Nada', I left the 7 shell buckshot magazine active however. I then launched the game and created an IMP merc. The game issued all other gear from the default gear list to the merc's inventory except for the shotgun.

Next I reinstated the 7 shell slug magazine in items.xml and again launched the game and created an IMP merc. This time the game issued the shotgun along with 2 extra 7 shell 'magazine' reloads of slug type ammo.

So there has to be a setting somewhere that defines the default ammo type and magazine for a weapon and I cannot find it. I've gone through items.xml, weapons.xml, magazines.xml looking for a parameter that might define this and I cannot find it. I've tried poking around some of the other XML files but I'm not finding anything.

Does anyone know what I'm trying to describe here and where I can find this setting? I suspect it will also solve my issue with the M1919 machine gun chambered for .30-06 belts (a magazine item I created) not being issued to IMP mercs when I tried testing that weapon.

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365023 is a reply to message #365022] Tue, 06 December 2022 23:38 Go to previous messageGo to next message
Asdow is currently offline Asdow

 
Messages:102
Registered:August 2010
Hmm.. I have a vague memory of smeagol hitting a similar sounding issue on aimnas mod, where iirc ammo indexes over a certain range were not counted and when the game could not find suitable ammo for guns, it would not spawn them.
Unfortunately I don't remember the exact thread where it was discussed, but maybe you might be able to search for it. Maybe it'll have info that might help you

Report message to a moderator

Sergeant
Re: WW2 Restricted Weapons[message #365024 is a reply to message #365023] Tue, 06 December 2022 23:59 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Asdow wrote on Tue, 06 December 2022 23:38
Hmm.. I have a vague memory of smeagol hitting a similar sounding issue on aimnas mod, where iirc ammo indexes over a certain range were not counted and when the game could not find suitable ammo for guns, it would not spawn them.
Unfortunately I don't remember the exact thread where it was discussed, but maybe you might be able to search for it. Maybe it'll have info that might help you
This would explain a lot and should be 'easy' for me to test. I can pick an un-used ammo type for my mod purposes in the magazine index and overwrite it with the .30-06 belt ammo I am trying to add.

I will try this in a bit and see if it works.

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365025 is a reply to message #365024] Wed, 07 December 2022 00:33 Go to previous messageGo to next message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
Just did some testing and I'm either doing something wrong or there is still something else going on here.

What I did was to move my new magazine from magazine index 604 to position 601 (which is a single neurotoxin dart). I then changed the redirect for my new ammo magazine item in Items.xml to point to magazines.xml index position 601. The neurotoxin dart item in items.xml is overwritten to 'Nada' anyway, so there shouldn't be a duplicate index call/point issue.

I then ran my in-game test and the machine gun I'm trying to create still won't populate upon IMP merc creation.

So my next test was to change the magazine ammo type from Type 2 (AP/FMJ) to Type 1 (BALL) as I figured maybe the game wants the most basic ammo type possible. I ran my IMP merc creation test again and still no machine gun issued.

That said, I kinda figured changing the ammo type assigned to the magazine from AP/FMJ to BALL wasn't going to solve this issue because there are other existing ammo types that don't have a standard BALL type ammo already (like the M1 Carbine's .30 Car ammo, it's most basic ammo is AP/FMJ and I can force this weapon to be issued during IMP merc creation).

So there is still something else going on here.

Report message to a moderator

Private 1st Class
Re: WW2 Restricted Weapons[message #365028 is a reply to message #365025] Fri, 09 December 2022 18:52 Go to previous message
MadMechanic is currently offline MadMechanic

 
Messages:20
Registered:November 2022
I'm still struggling with the issue of getting weapons to be issued when it seems like the game thinks there is no 'standard' ammo/magazine for the weapon. Here is my current example.

I'm moving weapons around in the items.xml for my own organizational purposes, and I'm also moving magazines around for the same reason. So here is my item index #1:
<ITEM>
<uiIndex>1</uiIndex>
<szItemName>Colt M1911A1</szItemName>
<szLongItemName>Colt M1911A1</szLongItemName>
<szItemDesc>The US Military standard issue sidearm. Chambered for .45 ACP.</szItemDesc>
<szBRName>Colt M1911A1</szBRName> <!-- Name in Bobby Ray's Website Catalog -->
<szBRDesc>The US Military standard issue sidearm. Chambered for .45 ACP.</szBRDesc>
<usItemClass>2</usItemClass> <!-- Item Lookup Class, 2 = Gun -->
<nasLayoutClass>1</nasLayoutClass> <!-- Weapons -->
<ubClassIndex>1</ubClassIndex> <!-- Index position in Weapons.xml -->
<ubCursor>3</ubCursor>
<ubGraphicNum>8</ubGraphicNum> <!-- Item Graphic -->
<ubWeight>11</ubWeight> <!-- Item weight in kg, 11 = 1.1 kg -->
<ubPerPocket>1</ubPerPocket> <!-- Allowable number of item per compatible pocket -->
<ItemSize>1</ItemSize>
<usPrice>700</usPrice>
<ubCoolness>2</ubCoolness>
<Damageable>1</Damageable>
<Repairable>1</Repairable>
<WaterDamages>1</WaterDamages>
<Metal>1</Metal>
<Sinks>1</Sinks>
<ShowStatus>1</ShowStatus>
<BR_NewInventory>5</BR_NewInventory>
<BR_UsedInventory>1</BR_UsedInventory>
<BR_ROF>30</BR_ROF>
<usOverheatingCooldownFactor>100.0</usOverheatingCooldownFactor>
<DamageChance>12</DamageChance>
<DirtIncreaseFactor>24.0</DirtIncreaseFactor>
<STAND_MODIFIERS />
<CROUCH_MODIFIERS />
<PRONE_MODIFIERS />
</ITEM>

Now this is really just the M1911 that is normally in index position 8 moved to position 1. I have also updated weapons.xml to correspond to the new index position:

<WEAPON>
<uiIndex>1</uiIndex>
<szWeaponName>Colt M1911A1</szWeaponName>
<ubWeaponClass>1</ubWeaponClass> <!-- 1 = Handgun -->
<ubWeaponType>1</ubWeaponType> <!-- 1 = Pistol -->
<ubCalibre>1</ubCalibre> <!-- Caliber, 45 ACP -->
<ubReadyTime>1</ubReadyTime>
<ubShotsPer4Turns>16.35</ubShotsPer4Turns>
<ubBulletSpeed>21</ubBulletSpeed>
<ubImpact>26</ubImpact>
<ubDeadliness>16</ubDeadliness>
<ubMagSize>7</ubMagSize> <!-- Magazine capacity -->
<usRange>100</usRange>
<usReloadDelay>200</usReloadDelay>
<BurstAniDelay>100</BurstAniDelay>
<ubAttackVolume>55</ubAttackVolume>
<ubHitVolume>3</ubHitVolume>
<sSound>413</sSound>
<sReloadSound>100</sReloadSound>
<sLocknLoadSound>106</sLocknLoadSound>
<SilencedSound>157</SilencedSound>
<bBurstAP>20</bBurstAP>
<APsToReload>12</APsToReload>
<SwapClips>1</SwapClips>
<MaxDistForMessyDeath>7</MaxDistForMessyDeath>
<ManualReloadSound>476</ManualReloadSound>
<nAccuracy>7</nAccuracy>
<ubAimLevels>2</ubAimLevels>
<Handling>1</Handling>
<usOverheatingJamThreshold>20000</usOverheatingJamThreshold>
<usOverheatingDamageThreshold>18000</usOverheatingDamageThreshold>
<usOverheatingSingleShotTemperature>60</usOverheatingSingleShotTemperature>
</WEAPON>

The uiIndex numbers match (which as I've read must be true for weapons, items.xml index number and weapons.xml index number must be the same).

I have restructured the calibers table (AmmoStrings.xml) so that .45 ACP is ammo string 1.

<AMMO>
<uiIndex>1</uiIndex>
<AmmoCaliber>.45 ACP</AmmoCaliber>
<BRCaliber>.45 ACP</BRCaliber>
</AMMO>

I also modified AmmoTypes.xml so that type 0 (previously just called 'Ball') is now 'FMJ'. Ammo Type 1 (previously 'HP') is now 'AP' (copied the AP ammo type data from position 2 to position 1.

I moved the normal .45 acp pistol mag from it's normal items index position to position 11 as follows:

<ITEM>
<uiIndex>11</uiIndex>
<szItemName>.45 Mag</szItemName>
<szLongItemName>.45 ACP FMJ Pistol Mag, 7 rds</szLongItemName>
<szItemDesc>US Military standard issue 230 grain .45 ACP FMJ loaded in a 7-round magazine for the Colt M1911A1 sidearm.</szItemDesc>
<szBRName>.45 FMJ Mag</szBRName>
<szBRDesc>US Military standard issue 230 grain .45 ACP FMJ Loaded in a 7-round magazine for the Colt M1911A1 sidearm.</szBRDesc>
<usItemClass>1024</usItemClass> <!-- 1024 = Ammo -->
<nasLayoutClass>1</nasLayoutClass> <!-- 1 = Weapons -->
<ubClassIndex>1</ubClassIndex> <!-- Magazines.xml Index Position -->
<ubGraphicType>1</ubGraphicType>
<ubGraphicNum>14</ubGraphicNum>
<ubWeight>2</ubWeight> <!-- Item weight in kg, 2 = 0.2 kg -->
<ubPerPocket>8</ubPerPocket>
<ItemSize>12</ItemSize>
<usPrice>10</usPrice>
<ubCoolness>2</ubCoolness>
<Metal>1</Metal>
<Sinks>1</Sinks>
<usOverheatingCooldownFactor>100.0</usOverheatingCooldownFactor>
<STAND_MODIFIERS />
<CROUCH_MODIFIERS />
<PRONE_MODIFIERS />
</ITEM>

I also stripped the magazines.xml file WAY down and started creating magazine positions. The new .45 acp pistol mag, 7 rounds is now magazine index 1 as follows:

<MAGAZINE>
<uiIndex>1</uiIndex> <!-- .45 ACP FMJ, 7 rounds, for use with Colt M1911A1 -->
<ubCalibre>1</ubCalibre> <!-- .45 ACP -->
<ubMagSize>7</ubMagSize> <!-- Magazine Capacity -->
<ubAmmoType>0</ubAmmoType> <!-- FMJ -->
<ubMagType>0</ubMagType> <!-- Magazine -->
</MAGAZINE>

You can see that I changed the ubClassIndex for the magazine item to 1.

At this point I can successfully force the magazine item to be issued during IMP creation using the IMPItemChoices default gear section as follows:

<IMPITEMCHOICES>
<uiIndex>0</uiIndex>
<name>Default Items</name>
<ubChoices>6</ubChoices>
<ubNumItems>6</ubNumItems>
<bItemNo1>176</bItemNo1> <!-- Steel Helmet -->
<bItemNo2>1090</bItemNo2> <!-- LBE Gear -->
<bItemNo3>1097</bItemNo3> <!-- TIMS Pack -->
<bItemNo4>1091</bItemNo4> <!-- Holster, lbeIndex 16 -->
<bItemNo5>1</bItemNo5> <!-- Colt M1911A1 -->
<bItemNo6>11</bItemNo6> <!-- .45 ACP FMJ Mag, 7-rounds -->
<bItemNo7>0</bItemNo7>
<bItemNo8>0</bItemNo8>
<bItemNo9>0</bItemNo9>

But the game stubbornly refuses to issue the actual gun itself. The only thing I can think of, or that I keep coming back to is that the game now thinks (for some reason) that there is no compatible 'default' ammo/magazine for the weapon and therefore won't issue it. From that I have to assume that there is another look-up or association table or setting somewhere in another xml file (or maybe even an ini file) that specifies the default ammo/magazine for a given weapon, but for the life of me I cannot figure out where that would be.

All of my xml code lines up, it should all work, but the game just refuses to issue the weapon. This is the same issue I have been having when trying to create the M1919 machine gun chambered for .30-06. I could create the magazine (ammo belt) item and get the game to issue it, but it would never issue the weapon itself.

Does anyone have any ideas at this point?

Thank you.

-MadMechanic

Report message to a moderator

Private 1st Class
Previous Topic: Vritran's Custom (& RANDOM) Voicesets
Next Topic: Merc lines
Goto Forum:
  


Current Time: Sat Mar 25 03:13:32 EET 2023

Total time taken to generate the page: 0.01002 seconds