Jump to content

Help with adding new ammo types, replacing default ones.


Xhaleon

Recommended Posts

I'm trying to replace the three researched ammunition types for Laser, Plasma and MAG with three separate new ones for each. This was done to split them into small, medium and large sizes for different weapons.

Problem is, I'm entering the base loadout screen and the game is crashing to desktop when I click on the Laser weapon tab. I know that this is probably due to some missing or misnamed item in the files I've made, but I can't figure out what. Since the debugger in this forum is for the ground combat only, it isn't helping.

I know I've got the following down:

1. Create new entries in ammos.xml along with pointing them to the new images, 9 in total

2. New entries for them in strings.xml

3. Changing the entries in weapons.xml to point to the new ammunition types, vanilla ones are not referred to anymore

4. Same thing in weapons_gc.xml, but this shouldn't come into effect in the geoscape

5. Create entries in items.xml

6. Put the new ammo images into the weapons folder (and GUI folder, for that matter)

There might be more problems I will stumble upon entering ground combat, but for now this geoscape issue is stumping me. Is there something hardcoded about these ammo types that prevents them from being messed with? Is there one more file that I need to modify to get the game to recognize them?

Edited by Xhaleon
Link to comment
Share on other sites

Bit of an obvious question, but one I have to ask anyway just for clarification. Are you trying to get one weapon to point at two different ammo types?

No, they are all only pointing to a single ammo type. _Small cells go in pistols, _Mediums for assault rifles, carbines and precision rifles, _Heavy cells for machineguns. I did this so that I could better fine tune weights, size and capacity for each weapon type, not let a single weapon have multiple properties.

Link to comment
Share on other sites

First thing that springs to mind is the research and manufacturing aspect of the ammunition.

Have you made changes to those parts so that your new ammo types are unlocked when the weapons are?

If not can you try making them always available in items.xml to try and see if they work before creating another set of changes?

Link to comment
Share on other sites

First thing that springs to mind is the research and manufacturing aspect of the ammunition.

Have you made changes to those parts so that your new ammo types are unlocked when the weapons are?

If not can you try making them always available in items.xml to try and see if they work before creating another set of changes?

Earlier on while the forum posting was down I thought of that myself, checking the research and manufacturing files. I realized that I forgot to unlock these new ammo items once the Laser/Plasma/MAG research is complete, and now those have been changed. I already added in their ManTech entries in manufactures.xml. Unfortunately my changes didn't have an effect and the game was still crashing on entering the Laser weapons tab.

I am chasing a new lead. I added string names for the new ammunition items and have been using them this whole time. There was some strange issue about the string names and descriptions that I have encountered before; I once added in a name and full description for the Combat Shield (the normal game so far doesn't have one, the ingame tooltip just shows a raw ID of some sort) and the game crashed when entering the loadout screen. I don't understand what causes this, but I had to remove the shield's name and description cells in order to get it working again.

I will try this method as soon as I can get back to the game. However, it would be better if I could find the root cause of this. Why does the Combat Shield have no name or description string, and why does the game crash when I add new entries to give the shield those strings? Is there one more file somewhere specifying which strings go with which item? Or is this something hardcoded?

Gauddlike, thanks for the advice about setting those items as always Unlimited, that will definitely help.

Link to comment
Share on other sites

If there isn't an entry in strings.xml, then the game draws on the xml definitions in other files (so ITEM.COMBATSHIELD or ALIENBASE.SMALL.CAESAN for example). Having no entry in Strings.xml is probably an oversight on Chris's part, but why it would crash beats the hell outta me.

Link to comment
Share on other sites

Ho, so apparently what I did with the strings didn't seem to make a difference, still crashing on Lasers.

However, setting everything on Unlimited has revealed something. The MAG weapon tab works just fine, the Singularity Cannon and the five MAG weapons are there plus the new ammo types and all of my sweet edited weapon images. Equipping those on a soldier works as expected.

So that leaves Lasers and Plasmas. Both of these tabs crash when I get into them. So now what? Did I accidentally delete an entry for something on the lasers and plasmas? I'm pretty sure those don't have something extra in them, not like the Singularity Cannon in the MAG tab.

Looks like I'll just have to keep digging and comparing with my backup files, maybe re-do my work from the ground up. I'll post here if I manage to solve it. Thanks for the help so far.

Edited by Xhaleon
Link to comment
Share on other sites

I would try duplicating the new MAG ammo types onto laser weapons as a test.

You know all of those items work so if the laser tab still crashes it could be something to do with the laser weapons rather than your new ammo types.

By that I mean leave everything the same but point laser weapons to the new MAG ammo, see if the crash remains.

I think the early UI used to crash sometimes if strings were too long to be displayed in their allotted location.

I don't know if that is still the case though.

Link to comment
Share on other sites

Welp, I found out exactly what caused the problem, and it was between chair and keyboard.

I wanted to make small, medium and large ammo types, but I blindly attached _heavy to a laser cell and a plasma cell, both mistakes in two different files!

Moral of the story: Quadruple check EVERYTHING, and take a piece of handwritten paper to write down things rather than flicking through five different Excel and Notepad++ windows. It will save you many headaches when you have easy comparisons on-hand.

Nice to see Xenonauts be another great modular game, we really need more of those. dis gonna b gud

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...