Jump to content

Alien Weapons in Inventory


aajs

Recommended Posts

I do not know why I want to do this as alien weapons are rubbish for humans.

I just have an issue that you can capture alien weapons but not keep them.

Is there a way of doing this. I have set them to uncapped and also tried setting them to normal in items.xml but nothing seems to let them appear.

Any ideas?

Link to comment
Share on other sites

I do not know why I want to do this as alien weapons are rubbish for humans.

I just have an issue that you can capture alien weapons but not keep them.

Is there a way of doing this. I have set them to uncapped and also tried setting them to normal in items.xml but nothing seems to let them appear.

Any ideas?

Set them to unlimited.

Link to comment
Share on other sites

I manage to move this on a little, I am still setting them to normal in the items.xml but if I also change its images column to patch the other items that show in the inventory to "weapons/airplane/rocket" then it does finally appear in my stores.

This is good but I still can get them to show in my weapons view. I have tried changing their catagory to ballistics and other but still not showing. Has anybody got this to work?

Link to comment
Share on other sites

Thanks Mikhail,

my weapons xml now looks like this

<Row ss:AutoFitHeight="0">

<Cell ss:StyleID="s25"><Data ss:Type="String">weapon.AlienPlasmaPistol</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">weapons/alien/alienpistol</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">weapons/alien/alienpistol</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">plasma</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Boolean">0</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">50</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">16</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">9</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">0.6</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">2</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">3</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">2</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">ammo.alienplasmacell</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">20</Data></Cell>

<Cell ss:Index="16"><Data ss:Type="String">Plasmas</Data></Cell>

</Row>

my items.xml for these entries is now set to unlimited however they still do not show.

I also added them to researches xml as unlockitem entries just in case...

Link to comment
Share on other sites

Thanks Mikhail,

my weapons xml now looks like this

<Row ss:AutoFitHeight="0">

<Cell ss:StyleID="s25"><Data ss:Type="String">weapon.AlienPlasmaPistol</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">weapons/alien/alienpistol</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">weapons/alien/alienpistol</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">plasma</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Boolean">0</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">50</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">16</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">9</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">0.6</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">2</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">3</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">2</Data></Cell>

<Cell ss:StyleID="s25"><Data ss:Type="String">ammo.alienplasmacell</Data></Cell>

<Cell ss:StyleID="s26"><Data ss:Type="Number">20</Data></Cell>

<Cell ss:Index="16"><Data ss:Type="String">Plasmas</Data></Cell>

</Row>

my items.xml for these entries is now set to unlimited however they still do not show.

I also added them to researches xml as unlockitem entries just in case...

I think the problem is likely the whole entry. For the human weapons, there's a slightly different code (it looks more spread out if one opens the file in notepad):

   <Row ss:AutoFitHeight="0">   <Cell ss:StyleID="s65"><Data ss:Type="String">weapon.pistol</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">weapons/ballistic/pistol</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">weapons/ballistic/pistol</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">ballistic</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Boolean">0</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">20</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">16</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">15</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">0.9</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">2</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">3</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">2</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">ammo.ballistic.pistol</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s66"><Data ss:Type="Number">20</Data></Cell>   <Cell ss:Index="16"><Data ss:Type="String">Ballistics</Data></Cell>  </Row>

That's for the ballistic pistol - there's extra bits ("filterdatabase") that might be needed for the weapon to appear. Try copying a ballistic entry (ie the pistol), and then fill it in with an alien weapon name etc., and delete the original alien one. And the numbers don't mean much, the only ones that work are the clip size, weight, and size.

Link to comment
Share on other sites

While I am trouble shooting this I have set the item for the alien pistol back to unlimited, and set it to use the ballistic pistol ammos as i know that setup correct as other items are using it. However whenever I got to the equip screen and click the plasmas button the game crashes. I have checked the picture paths and they check out ok.

Link to comment
Share on other sites

The problem could actually be in items.xml:

<Row ss:AutoFitHeight="0">   <Cell><Data ss:Type="String">weapon.AlienPlasmaPistol</Data></Cell>   <Cell><Data ss:Type="Number">5000</Data></Cell>   <Cell ss:Index="4"><Data ss:Type="String">Capped</Data></Cell>   <Cell><Data ss:Type="String">items/assaultrifle</Data></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">Item.Dispose.Destroyed</Data></Cell>  </Row>

The entries for other weapons (that we know are useable) are slightly different:

   <Row ss:AutoFitHeight="0">   <Cell ss:StyleID="s70"><Data ss:Type="String">weapon.pistol</Data></Cell>   <Cell><Data ss:Type="Number">0</Data></Cell>   <Cell ss:Index="4"><Data ss:Type="String">Normal</Data></Cell>   <Cell><Data ss:Type="String">weapons/airplane/rocket</Data></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">Item.Dispose.Destroyed</Data></Cell>  </Row>

Try deleting the original entry and putting this in:

  <Row ss:AutoFitHeight="0">   <Cell ss:StyleID="s70"><Data ss:Type="String">weapon.AlienPlasmaPistol</Data></Cell>   <Cell><Data ss:Type="Number">0</Data></Cell>   <Cell ss:Index="4"><Data ss:Type="String">Unlimited</Data></Cell>   <Cell><Data ss:Type="String">weapons/airplane/rocket</Data></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">Item.Dispose.Destroyed</Data></Cell>  </Row>
Link to comment
Share on other sites

Thanks a lot for that, it actually did the trick.

It now appears in my inventory....phew .

Now I set it to normal, however it does not appear when I go on a mission and one appears back in my stores.

I tried unlockitem on it in researches.xml but thats not getting it to show.

Link to comment
Share on other sites

erm not exactly.. Its was currently "unlimited" back at base and you could give it to a man and it appear when you deploy soldiers.

The thing is I do not want it to be "unlimited" I want the ones that I win in combat to appear in the stores where I can choose to sell them, however if I dont want to sell them I want to be able to equip them.

To do this I set the items.xml entry to "normal" and then expected to see them when I win them in battle, however they only show up in the stores and not in the equipment view.

Link to comment
Share on other sites

to set it to manufacturable you need to set the item to normal in items.xml then you need to make an entry for it in manufactures.xml then in the researches.xml file you need an entry that when researched says unlockManufacture("Mantech.<item name in manafactures.xml>") then it should work.

I have not finalised this work myself yes as I am working on other areas in my mod. However I once I complete this I will post back all the changed you need to make here.

Link to comment
Share on other sites

SOLVED

OK. I promised to post back here when I finally got these added into my mod. Firstly this is not a difficult task to accomplish, if you have already modded in some of your own weapons then the approach has not changed. I could not seem to get this to work first time around, however I think that was just down to my introducing some bad syntax.

Why Mod in Alien Weapons when they are Pretty Inaccurate.

For me I didnt like the fact that any weapons my soldiers picked up in the field were instantly taken off me and sold. I should at least have the choice if I want to use them. Of course its all about game balance, these weapons are very effective at close range and therefore they are most likely not available for game balance reasons. In Xcom Enemy Unknown the weapons just blow up so you cant get them. Anyway I wanted the option to use them or sell them, so I will now write a step by step guide to add them back in. I am sorry if this is a little verbose, however I thought it might be a nice opportunity to introduce some of the newer modders to the different files and what they are for.

This example will get the plasma pistol into the soldiers inventory. Don’t forget to backup your files before starting.

Items.xml

First we need to find and edit the items.xml file where all items in the game are held.

Edit this file using excel and locate the row that starts “weapon.AlienPlasmaPistol” now under is “Type” column it will currently be set to “Capped” you need to change this to “Normal”.

Now find the row that starts “ammo.alienplasmacell” and set its type to “Normal”.

Save the file and close it.

Now It took a while for me to work this out but as far as I can tell the type fields do the following:

Capped = This item is sold of at the end of a ground battle and you get the money

Uncapped = At the end of a ground battle this item is kept and appears in your “Store Room” at your base. This is generally because the item is used in the manufacture of something new. However you will never see these items in you Equipment screen.

Normal = This is an item that will appear in you “Soldier Equipment” screen and is the same item you see in your “Store Room”. These Items require a manufacturing process to be tied to them and that then needs to be unlocked in order to get the item to show up in the equipment screen. This will make adding in the Alien weapons a bit difficult in this Mod as they will not appear unless we have a manufacturing step, however we do not want to make them, just use the ones we recover. I have a bit of a story bodge for this that will have to do for now. (Someone will always come up with a better way)

Unlimited = This will show in the inventory from the beginning of the game and as its says the items are unlimited in number. (Indicates that you have ample stockpiles or that the items can always be easily acquired at a cost that does not effect your budget).

UnlimitedOnResearch = This items needs to be unlocked by a research event in the game that will allow it to show up in your solder inventory from that point on in unlimited numbers.

Manufactures.xml

Unfortunatley as I said previously the only way to get the alien weapons to show in the soldier inventory is to add a manufacturing step. So open this file and go about half way down the list and insert a row. Then paste in this line:

ManTech.AlienPlasmaPistol SoldierWeapons 1 1 1xweapon.AlienPlasmaPistol manufacture/ManTech.AlienPlasmaPistol StockItem( "weapon.AlienPlasmaPistol" )

then insert another row and past this line in:

ManTech.alienplasmacell SoldierWeapons 1 1 1xammo.plasma.plasmacell manufacture/ManTech.alienplasmacell StockItem( "weaponManTech.alienplasmacell" );

If you understand the file format you will probably wonder why the item I require to manufacture the item is the item produced. The reason is I want this pistol added in at the begging of the game but I dont want players actually making them, so It costs 1 Pistol to make 1 Pistol. Its a bit silly I know, but we will change the words to say something along the lines of “Check the Pistol is safe for Xenonaut use” or some other suitable excuse for this entry being here. (Incidentally if someone can come up with a better solution please post it)

strings.xml

If we leave the manufacturing step as it is both items will appear in the list as #### which is not very helpful. So open strings.xml with excel and somewhere in the list insert two blank rows and post in the following.

Line 1:

ManTech.AlienPlasmaPistol Check Recovered Alien Pistol

Line 2:

ManTech.alienplasmacell Check Recovered Alien Cell

save and close the file.

Researches.xml

Now we have the manufacturing process in place we need to unlock it at the correct point in the game. When the manufacturing process is unlocked its going to be show it to the players, therefore the only place that makes sense to put the unlock step is after the research of the alien plasma pistol.

Therefore open researches.xml with excel and locate the row that starts with name: Researches.AlienPlasmaPistol” in the first column. Then move along the columns to the one titled "When finished" Delete the contents of this cell and paste in the following:

UnlockKnowledge( "Researches.AlienPlasmaPistol" );

UnlockManufacture("ManTech.AlienPlasmaPistol");

UnlockManufacture("ManTech.alienplasmacell");

A little tip here: Do not click the cell and past the above 3 lines in directly to the highlighted cell as they have carriage returns, if you do it will overwrite the below 2 lines as well. You need to highlight the cell then click into the formula bar and past the entry there, that way it will all go into the one cell with the carriage returns.

Save the file and close it.

Xenopedia.xml

The xenopia.xml file contains all the unlocked research data. We will have to edit this in order to somehow try to explain why there is a manufacture alien weapons option at this point in time of the game when you do not have the resources or knowledge to make one. As I said before we are just going to say that the manufacturing items are there to check that the weapons are safe and operation for xenonaut use...blah blah..

Open Xenopedia.xml for editing with excel and locate the row where the first column reads:

Researches.AlienPlasmaPistol

Now move along the columns to the one titled Description and delete the contents.

Now highlight that cell and past back in the following using the formula entry bar at the top:

The Plasma Pistol is an alien sidearm that is approximately eight inches long and roughly a kilogram in weight. Though it bears some resemblance to a human firearm, it does not fire a bullet but rather a searing bolt of superheated plasma.

It is a powerful weapon, easily capable of killing an unarmoured man in a single shot. However, our tests suggest the compact size of the weapon renders it fairly inefficient: the plasma bolt loses cohesion and starts to dissipate almost immediately. It is thus most dangerous at short ranges, where a single shot has a good chance of killing one of our soldiers outright. As that range increases, the projectile steadily becomes less accurate and damaging. The lesson here should be clear: fight units equipped with this weapon from as far away as possible.

Though it would make a fine addition to our arsenal, this weapon has clearly has been designed for alien troops. Anatomical differences between our species make it difficult for a human to wield effectively, so any soldier attempting to use this weapon on the battlefield will suffer severe accuracy penalties when doing so. Sadly, we are also nowhere near understanding or replicating the technology contained within the weapon (recovering more advanced alien weapons may help in that regard). All is not lost, however - running more tests on this weapon should allow us to develop battlefield infantry armour better suited to protecting our men from extraterrestrial energy weapons.

In the mean time if youre soldiers do wish to put these weapons to use, they will be stored with the rest of the Xenonaut weaponry. We have already contacted the Manufaturing / Engineering department and they are happy to run basic safety checks on any of the weapons we aquire from battle. However the spot checks performed by those collecting the weapons from the field are probalby adequate as they weapons seem to be inteligent and disable themselves if there is a fault. We will leave the addition testing to your discrention commander.

Notice I have added the last paragraph which kind of explains away the Manufacturing steps.

That’s it.

alienplasma.jpg

alienplasma.jpg

alienplasma.jpg.5f166384b7eee57e84971d70

Link to comment
Share on other sites

  • 1 month later...

- any situations where alien weapons are superior to even the basic ballistic human weapons?

I think about alien grenades. Something with explosion size between c4 and normal grenade definitely needed and inability to keep alien grenades after mission really frustrating.

PS thanks aajs , i will try this method on alien grenades now.

Link to comment
Share on other sites

Edit: damn beaten by a few mins ;)

There are several places you need to ensure they appear, then you need to "unlock" them for use:

items.xml is just for setting the sell price and act as items that can be collected after a ground combat mission (like useless alien junk, corpses...etc). These dont have actual use in the equip screen(s)..

weapons.xml controls all the items you see on the equip screen in the base. If its not listed here AND in the proper category, the game may either not display the weapon OR even crash. From the code above, it looks like its all good to go.

weapons_gc.xml controls the weapon data in combat, but you'll want to make sure the stats match that of weapons.xml, otherwise you'll get odd bugs.

Next, you need to also unlock your items for use with a new base/new game:

The fastest way for testing your new weapons is to goto /scripts/_basebuilt.lua

Goto a blank line and add this:

UnlockItem( "weapon.alienpistol" );

If you dont unlock the item, it wont appear in the equip screen, even if its set to unlimited...etc. Manufactured/Researched items unlock for you, thats why you see them on the base and why you never see alien weapons there even after you get some from a mission, because they never unlock for use.

Link to comment
Share on other sites

Thanks for your update. I had forgotten I created this post. I did resolve getting the ammo to show up in the equipment view and there is now a working example in my xenonauts choices part 2 mod. I also explained what the setting in items.xml do in this thread. If you set them to unlimited and just unllock them then the palyers will have an unlimited supply and not need to recover them from battle. In game terms that means you can make them or aquire them cheaply in unlimited numbers, that of course is not true for alien ammo.

The reason I could not get them to show in the inventory was because the naming convention for alien ammo broke the rules. However this was not an issue for the vanilla game as it was not expected to be available in the soldiers inventory. I eventually fixed this by creating a manufacturing process to check recovered alien ammo for battle damage before putting it in the soldier armoury. This is a smoke screen step to actually convert the alien ammo form its non standard name to the games expected name format. I also had to carry out the same process for alien grenades, otherwise they could not be listed in the grenade section of the equipment screen along with the others.

Thanks for you input again, I will close this thread now that I have a working example.

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...