Jump to content
Mikhail Ragulin

Tutorial - how to add a new weapon.

Recommended Posts

First things first - when one is modding, or going to add mods, the best thing to do is make a clean copy of your Xenonauts download, and do your interfering there.. Messing around with files in the steam folder is never a good idea, as they can easily be overwritten - and any extra files will stay in there, as steam won't delete these upon verification, which can lead to further problems.

Files needed for adding a new weapon

There's a few of them. They're in the assets folder, unless otherwise stated. All xml files can be opened and edited with notepad. It's what I use, I don't see the need for anything else when it comes to editing text files, although your preference may vary.

- weapons_gc.xml

- weapons.xml

- ammos.xml

- items.xml

- strings.xml

Weapons_gc

This is the file that the game uses for ground combat. For the purposes of this tutorial, we'll be adding a revolver - the Smith & Wesson Model 29, aka the .44 Magnum - with exactly the same stats as the normal pistol (I'll leave it up to you to come up with your own damage models). Open up weapons_gc and find the default pistol entry:

	<Weapon name="weapon.pistol" bulletType="normal" emptySound="Empty Click 1">	<props range="10" hands="1" recoil="0" weight="2" isHeavy="0" clipSize="15" reloadAPCost="15" reloadSound="Weapon Pistol Reload" reactionModifier="1.5" />	<SingleShot sound="Weapon Pistol Single" delay="0.6" suppressionValue="20" suppressionRadius="1">		<Set1 ap="28" accuracy="35" />		<Set2 ap="40" accuracy="65" />	</SingleShot>	<GUIImage name="gui/weapons/pistol" />	<GroundImage name="grounditemimages/ballistic_pistol.png"/>	<Ammos>		<Ammo name="ammo.ballistic.pistol" type="kinetic" damage="30" mitigation="0">			<Projectile spectre="projectiles/bullet/bullet" speed="2000" showAfterDistance="60.0"/>			<Impact spectre="particles/bulletplume/bulletplume"/>		</Ammo>	</Ammos></Weapon>

Thar she blows. Copy and paste it to the bottom of the file (so it's easy to find), just before "</Weapons>" (which closes the file). We'll need to change it's name. First line: weapon.pistol, change it to weapon.44. Next, we need to give it a picture in ground combat. This is the "GUIImage name" - change it to gui/weapons/44. Finally, we can give it it's own ammo. Change the "Ammo name" to ammo.44, and we should look like this:

	<Weapon name="weapon.44" bulletType="normal" emptySound="Empty Click 1">	<props range="10" hands="1" recoil="0" weight="2" isHeavy="0" clipSize="15" reloadAPCost="15" reloadSound="Weapon Pistol Reload" reactionModifier="1.5" />	<SingleShot sound="Weapon Pistol Single" delay="0.6" suppressionValue="20" suppressionRadius="1">		<Set1 ap="28" accuracy="35" />		<Set2 ap="40" accuracy="65" />	</SingleShot>	<GUIImage name="gui/weapons/44" />	<GroundImage name="grounditemimages/ballistic_pistol.png"/>	<Ammos>		<Ammo name="ammo.44" type="kinetic" damage="30" mitigation="0">			<Projectile spectre="projectiles/bullet/bullet" speed="2000" showAfterDistance="60.0"/>			<Impact spectre="particles/bulletplume/bulletplume"/>		</Ammo>	</Ammos></Weapon>

Save the file and close it.

Weapons.xml

Find the pistol entry:

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

Copy and paste it to near the bottom of the file...just after the alien battle rifle, and before "</Table>". There's an explanation of what the values in this file mean near the beginning of it (although most are redundant...the only relevant numerical values are the hands boolean, clipsize, x & y sizes, and the big gun boolean - remember to change the clipsize in both files if you are doing so, but for this tutorial we are leaving it as 15). Change weapon.pistol to weapon.44, like in our weapons_gc. The next line is the images, change them to weapons/ballistic/44. Change the ammo to ammo.44:

   <Row ss:AutoFitHeight="0">   <Cell ss:StyleID="s65"><Data ss:Type="String">weapon.44</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">weapons/ballistic/44</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell ss:StyleID="s65"><Data ss:Type="String">weapons/ballistic/44</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.44</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>

Save and close.

Ammos.xml

The ammo.44 that we have created, it needs an entry in here. Copy and paste the ballistic pistol ammo to the bottom of the file (within the "</Ammos>"), and make it relevant for the new ammo, by changing it's name to ammo.44 and the images to 44:

    <Ammo name="ammo.44">       <stockTextureName>weapons/ballistic/44_ammo</stockTextureName>       <dragTextureName>weapons/ballistic/44_ammo</dragTextureName>       <slotsizex>1</slotsizex>       <slotsizey>1</slotsizey>       <weight>1</weight>   </Ammo>

Items.xml

We need entries in here for the weapon and the ammo, so that they become part of the game. Find and copy the entries for the ballistic pistol and its ammo, and paste them to near the bottom of the file (within "</Table>"). Change weapon.pistol to weapon.44, and ammo.ballistic.pistol to ammo.44:

   <Row ss:AutoFitHeight="0">   <Cell ss:StyleID="s70"><Data ss:Type="String">weapon.44</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>  <Row ss:AutoFitHeight="0">   <Cell ss:StyleID="s70"><Data ss:Type="String">ammo.44</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>

Save and close.

Strings.xml

This is where the items are localised, so their proper names appear in-game. We need entries for the weapon and its ammo. Find and copy the pistol and pistol ammo entries, and paste them near the bottom again, within the boundaries of " </Table>". weapon.pistol becomes weapon.44, and the ammo becomes ammo.44 - like all the other entries we have done for them. Two lines below each entry is how they are named in-game. Change pistol to S&W Model 29, and pistol magazine to .44 Magnum Rounds.

   <Row ss:AutoFitHeight="0">   <Cell><Data ss:Type="String">weapon.44</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell><Data ss:Type="String">S&W Model 29</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>  </Row><Row ss:AutoFitHeight="0">   <Cell><Data ss:Type="String">ammo.44</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell><Data ss:Type="String">.44 Magnum Rounds.</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>  </Row>

There's also an entry underneath the pistol entry, entitled weapon.pistol.desc. This again can be copied and pasted for your new Model 29 - it contains the tooltip information for the equip screen. Save and close. This is the end of our text editing.

Images

We need new images for the weapon and its ammo. If we go back through what we've changed, we'll see we need to make these images:

- gui/weapons/44

- weapons/ballistic/44

- weapons/ballistic/44_ammo

- and a previously unmentioned one for the ammo, in gui/quickthrowimages

The easiest way to do images is to look at the vanilla ones - e.g., size and format. For weapons and ammos, they're all .png. Sizes start at 103x103 for a 1x1 square, and go on 204, 308, 512, 615. Undersize doesn't matter, as the game re-sizes them (I think it's the same for oversize too...but one area is for nades...they musn't be wider than they are high, or they won't show in the quick nade window).

For the first two locations, we'll need a 3x2 (308x204) image of the weapon. I'll leave that up to you.

The third location need an ammo picture of 1x1 (103x103) - we defined the sizes earlier in weapon.xml and ammos.xml. If in doubt, copy the vanilla sizes for borders and the like.

The last location is for the ammo slot in ground combat. This is the standard ammo image that you've put in weapons/ballistic - but cropped, so it's borderless. If it's uncropped, it appears tiny.

Once the images are added, it's a good idea to start a new game, and check all is well in the soldier equip screen. The weapon should appear under the ballistics tab. If all is not well, re-trace our steps and check for errors.

How to make it show up in the hands of the soldiers

Phil Spectre's are needed. These dummy files point to an already available sprite for the weapon to use. There's a thread about unpacking the spectre files floating around here. Unpacking the spectres is the best way to understand them - look within the units\xenonaut\armour\weapon.xxx folders for the soldier_spectre. The spectres don't need to be unpacked into the game folder - find a nice new place somewhere on the hard drive, and unpack them there. Also, there is no need to re-pack them - the engine detects them anyway.

So, for our Model 29 we're likely to want some kind of sprite where the soldier is wielding a pistol. In the unpacked folder, look in assets\units\xenonaut\ and you'll see the folders for the specific armours. Open up armour.basic, and then weapon.pistol. In here is a list of spectre files that correspond to the various animations for weapons. The only one we need is the one called soldier_spectre. Copy that, and go back to our modded game folder. Open up assets\units\xenonaut\armour.basic, and create a new folder - call it weapon.44. Simply paste the soldier_spectre file into this empty folder. That's all we need. If you take a look at the vanilla weapons, for example by opening weapon.pistol, one can see all the various animations that are used - the spectre file is a replacement for these, telling the engine where to look when it wants to show our soldiers using the new weapon.

One needs to create a weapon folder in units\xenonaut for all the armour variations (with the exception of predator, unless it's using the big-gun boolean). For this tutorial, we need folders called weapon.44 (like we did above), and within them the soldier_spectre for the ballistic pistol, and relevant armour type (basic, buzzard, jackal, predator, sentinel, wolf).

Research & Manufacturing

So, we've made our new weapon. It appears at the start of the game in unlimited quantities. However, one may like some weapons to appear after a certain research level has been achieved, and may want it to be manufactured in limited numbers. For this part, we're looking at 3 files:

- items

- manufactures

- researches

- strings

Items - Open it up, and search for "weapon.laserpistol", and this is what we'll see:

   <Row ss:AutoFitHeight="0">   <Cell ss:StyleID="s70"><Data ss:Type="String">weapon.laserpistol</Data></Cell>   <Cell><Data ss:Type="Number">10000</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>

Spot the difference with out entry. The third value here is "Normal", whereas ours is "Unlimited". We know that the laser pistol is manufacture-only, and so change our .44 entry from unlimited to normal. Now, it won't be showing in unlimited numbers. For the ammo, we'll set it to be unlimited after research. Change the line in the 44_ammo entry with "unlimited" to

    <Cell ss:Index="4" ss:StyleID="s71"><Data ss:Type="String">UnlimitedOnResearch</Data></Cell>

Save and close.

Manufactures - Search for "Mantech.Laserpistol":

   <Row>   <Cell><Data ss:Type="String">ManTech.Laserpistol</Data></Cell>   <Cell><Data ss:Type="String">SoldierWeapons</Data></Cell>   <Cell><Data ss:Type="Number">20</Data></Cell>   <Cell><Data ss:Type="Number">20000</Data></Cell>   <Cell><Data ss:Type="String">2xItems.Alienalloys</Data></Cell>   <Cell><Data ss:Type="String">manufacture/ManTech.Laserpistol</Data></Cell>   <Cell ss:Index="8"><Data ss:Type="String">StockItem( "weapon.laserpistol" );</Data></Cell>  </Row>

Copy this and place it at the end of the file, like we did with entries in other files earlier. Change it to ManTech.44. Change the fifth entry to manufacture/ManTech.44, and the last entry to StockItem( "weapon.44" ). The numerical values (20 & 20000) are the man-days and cost respectively. The alloys is the materials needed for each item. We'll leave them be. In which case, our new gun takes 20 man-days to make, costs 20000, and consumes 2 alien alloys.

Researches - to unlock our new weapon, we'll add it to an existing research. Search for "LaserWeaponry":

   <Row ss:AutoFitHeight="0" ss:Height="76.5">   <Cell ss:StyleID="s77"><Data ss:Type="String">Researches.LaserWeaponry</Data></Cell>   <Cell ss:StyleID="s72"><Data ss:Type="Number">80</Data></Cell>   <Cell ss:StyleID="s73"><Data ss:Type="String">Weaponary</Data></Cell>   <Cell ss:StyleID="s80"><Data ss:Type="String">Researches.AlienPlasmaTechnology</Data></Cell>   <Cell ss:StyleID="s74"/>   <Cell ss:StyleID="s74"><Data ss:Type="String">UnlockKnowledge( "Researches.LaserWeaponry" );UnlockManufacture( "ManTech.Laserpistol" );UnlockManufacture( "ManTech.Lasercarbine" );UnlockManufacture( "ManTech.Laserrifle" );UnlockManufacture( "ManTech.Precisionlaser" );UnlockItem("ammo.laser.lasercell");</Data></Cell>   <Cell ss:StyleID="s76"><Data ss:Type="String">Researches.LaserWeaponry</Data></Cell>  </Row>

We need to make an entry here for our new weapon. Copy one of the unlocks, and change it to:

UnlockManufacture( "ManTech.44" );

Paste it in-between the ";" and "<" (after the lasercell entry).

For the ammo, copy the lasercell entry, changing it to ammo.44_ammo, and place it like above. Our laser weapon research should now look like this:

   <Row ss:AutoFitHeight="0" ss:Height="76.5">   <Cell ss:StyleID="s77"><Data ss:Type="String">Researches.LaserWeaponry</Data></Cell>   <Cell ss:StyleID="s72"><Data ss:Type="Number">80</Data></Cell>   <Cell ss:StyleID="s73"><Data ss:Type="String">Weaponary</Data></Cell>   <Cell ss:StyleID="s80"><Data ss:Type="String">Researches.AlienPlasmaTechnology</Data></Cell>   <Cell ss:StyleID="s74"/>   <Cell ss:StyleID="s74"><Data ss:Type="String">UnlockKnowledge( "Researches.LaserWeaponry" );UnlockManufacture( "ManTech.Laserpistol" );UnlockManufacture( "ManTech.Lasercarbine" );UnlockManufacture( "ManTech.Laserrifle" );UnlockManufacture( "ManTech.Precisionlaser" );UnlockItem("ammo.laser.lasercell");UnlockManufacture( "ManTech.44" );UnlockItem("ammo.44_ammo");</Data></Cell>   <Cell ss:StyleID="s76"><Data ss:Type="String">Researches.LaserWeaponry</Data></Cell>  </Row>

Save and close.

Strings - Just like earlier, we need to tell the game what to call our new manufacture. Search for "mantech.Laserpistol":

   <Row ss:AutoFitHeight="0">   <Cell><Data ss:Type="String">ManTech.Laserpistol</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell><Data ss:Type="String">Laser pistol</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>  </Row>  <Row ss:AutoFitHeight="0">   <Cell><Data ss:Type="String">ManTech.LaserpistolDesc</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>   <Cell><Data ss:Type="String">The laser pistol is a one-handed laser weapon ideal for close-quarter use or as a sidearm.</Data><NamedCell     ss:Name="_FilterDatabase"/></Cell>  </Row>

There are two entries - the first being a label for the manufacture (appears in the list of manufactures in the workshop), and the second is the description that accompanies it. Copy and paste them to the end of the file.

In the first entry, "ManTech.Laserpistol" becomes Mantech.44. Change "Laser Pistol" to Smith & Wesson Model 29.

In the second entry, change "ManTech.LaserpistolDesc" to ManTech.44Desc. Give it an appropriate description in the text-field. Save and close.

Job Done

So, there we have it. That's covered the basics for adding a new weapon. The fine-tuning is waiting to be discovered by you.

Good luck, pilgrim.

Edited by Mikhail Ragulin

Share this post


Link to post
Share on other sites

Is far more easy use Microsoft Excel 2010 or Apache Open Office to manage:

items.xml

weapons.xml

strings.xml

When modders use text editor tend to mistake in typos.

Share this post


Link to post
Share on other sites

Thank you very much !

This is very well explained and very useful for a good start.

Are you also planning to make an expended turorial about how to make a researchable and craftable weapon ?

Share this post


Link to post
Share on other sites
Thank you very much !

This is very well explained and very useful for a good start.

Are you also planning to make an expended turorial about how to make a researchable and craftable weapon ?

Yeah, adding that would make sense.

Share this post


Link to post
Share on other sites

I have a dumb question : How do I repack with xen_pack... Please ? Anything I try result in an error in the console.

Share this post


Link to post
Share on other sites
I have a dumb question : How do I repack with xen_pack... Please ? Anything I try result in an error in the console.

There's no need to re-pack. Just drop the soldier spectres into the new folders. I'll clear that up in the guide.

Share this post


Link to post
Share on other sites
There's no need to re-pack. Just drop the soldier spectres into the new folders. I'll clear that up in the guide.

Right... the solution was pretty simple in fact.

Excellent tutorial by the was, everything I tried so far is working now, next step I will try on my own is create new researches/tech trees... but I thing I will mess things up :P But lets try anyway.

Share this post


Link to post
Share on other sites

Mikhail, I'll be happy to sticky this when you consider it complete, especially if you consider making it more generalised than just weapons.

Share this post


Link to post
Share on other sites

I've clarified the spectre's section, and added some basic info about researching and manufacturing weapons.

Max Caine: Forum Moderator - it's now about as complete as intended, covering the basics of adding a weapon and leaving the stats/performance for the individual to investigate. I'll make changes if anyone spots errors, obviously. I'm hoping that others will jump on the bandwagon and add their own tutorials in specialist areas of the game to make a more generalised series. If not, well shame on them.

Share this post


Link to post
Share on other sites

Well, there's also the sound files, but they should be pretty simple to understand. However, a handy bit of info could be how to convert Rounds Per Minute to BurstDelay. Just use the following formula:

60 / RoundsPerMinute

E.g. A MAC-10 SMG with RPM of 1200 would have a BurstDelay of (60/1200) 0.05.

Share this post


Link to post
Share on other sites

There could be a lot of other tutorials, like "How to add a new aircraft" or "How to add a new science research".

I will continue to investigate those parts and see if I do something correct ( probably not :P ).

Share this post


Link to post
Share on other sites

Hey, I followed your tutorial to make AK-47 with 30 round magazine, increased damage, increased suppression, custom sounds and ammo. However I failed to make it work (the weapon doesn't appear in the equip screen at all) and I am not sure where I went wrong. I'd appreciate your help on this matter.

Edited by Boroski

Share this post


Link to post
Share on other sites

Boroski : you don't have the weapon's image in the gui/weapons and the magazine's image in the gui/quickthrowimages folders.

Share this post


Link to post
Share on other sites
Boroski : you don't have the weapon's image in the gui/weapons and the magazine's image in the gui/quickthrowimages folders.

Still nothing.

Share this post


Link to post
Share on other sites

A quick question if you don't mind (rather than posting a new thread, it's relevant here).

In weapons.xml, there is a column for range and in weapons_gc.xml, there is a value for "props range". These are different, the props range is shorter. What is the difference between the two? In your notes above, you mention that weapons.xml is only used for a few values, is the range in this document just ignored?

Great tutorial by the way!

Share this post


Link to post
Share on other sites
I've just taken a look...why are all the files blank, except for the ak entries?

I misunderstood this then. I thought all that was needed were the starting and ending lines and your weapon stuff in the middle.

I'm fixing the files right now.

*edit*

Yeah, nope. Still nothing.

I copied unmolested files, copied the "AK47" stuff from the violated ones into the unmolested ones, fixed the folder directions (I think. It's weapons/ballistic right?) and packed all into the .zip file.

https://www.dropbox.com/s/9wet4rvs5jm9hcg/AK47%27S%20FOR%20EVERYONE%21.zip

Good thing I've done some visual basic in my time or my eyes would have melted by now.

Edited by Boroski

Share this post


Link to post
Share on other sites
A quick question if you don't mind (rather than posting a new thread, it's relevant here).

In weapons.xml, there is a column for range and in weapons_gc.xml, there is a value for "props range". These are different, the props range is shorter. What is the difference between the two? In your notes above, you mention that weapons.xml is only used for a few values, is the range in this document just ignored?

Great tutorial by the way!

Yeah, the one in weapons.xml is not used (damage, range, and accuracy are ignored in that file).

I misunderstood this then. I thought all that was needed were the starting and ending lines and your weapon stuff in the middle.

I'm fixing the files right now.

Ah...I've not used that, I don't know how it works.

Share this post


Link to post
Share on other sites

Well, the first thing I see that might cause an error, you don't have the ammo in Items.xml (you need an entry for "ammo.7.62x39mm). It's possible that the format of the ammunition name is screwing it up, maybe change that to "ammo.ballistic.AK" in Ammos.xml, Weapons.xml, and Weapons_GC.xml.

I'm still looking, but that might be your problem.

Next problem - in Weapons_GC.xml, the sound is tagged wrong (i had this same problem). You have the sound as "AK47_single" and "AK47_burst". That needs to actually point to the reference in Sounds.XML, which is "AK47 single" and "AK47 burst".

I have been using the AK with the assets already included in the game, by just changing the reference in "Items.xml" from Normal to Unlimited, everything else worked as is. Although it is using the wrong mag, I hadn't bothered fixing that yet. Is your sound actually an AK shooting? If so, I may grab it for myself. :)

Edited by Dogbarian

Share this post


Link to post
Share on other sites

Even with those fixes it still does absolutely nothing.

I don't care what you do with those files, borrow them all you want. Just make this work please.

I have recreated this mod following this tutorial step-by-step for three times now and billion little adjustments and changes. Nothing seems to work.

here's the broken mod with the latest "fixes"

https://www.dropbox.com/s/9wet4rvs5jm9hcg/AK47%27S%20FOR%20EVERYONE%21.zip

Share this post


Link to post
Share on other sites

Well, sometimes, maybe it helps to start over from scratch. In the course of making lots of little changes, maybe we have broken something important. If you still have your clean Xeno files, let's start from there.

Make these changes from "clean":

1) Edit Items.XML to change the AK47 from Normal to Unlimited

2) Edit Sounds.XML to add this:

  <Sound name="Weapon AK Single" volume="1.0" group="1" comment="">     <Wave>audio/sfx/weapons/AK47_single.ogg</Wave>   </Sound>   <Sound name="Weapon AK Burst" volume="1.0" group="1" comment="">     <Wave>audio/sfx/weapons/AK47_burst.ogg</Wave>   </Sound>

I would add that right after Weapon Shotgun Burst, as a convenient place to search for it in the file and find it again later.

3) Drop your sounds in the correct folder -> Assets/audio/sfx/weapons

4) Edit Weapons_GC.XML to edit the existing AK information for the sound to replace the single shot sound "Weapon Assault Rifle Single" with "Weapon AK Single" and the burst sound with "Weapon AK Burst". If you want to change the accuracy, TU, clip size and damage while you are here, go for it. I myself changed the "shot count" for the burst fire to 5, the suppression value was already greater than the M16 stats.

Test your game like this, before doing the other changes.

If that works fine (which I'm betting it does), then you can add the changed artwork to the correct locations and go back into Weapons_GC to set the name changes for the images. It might even be an issue with your artwork, which unfortunately, I can't offer much help with.

Share this post


Link to post
Share on other sites

Are you now talking about replacing the files in the game directory or putting them into a mod .zip file because the latter doesn't work 100% of the time it seems.

I literally just made a zip file in the mod directory with the modinfo.xml and the items.xml with the ak47 set to "unlimited" and it absolutely, positively, doesn't work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×