Veroci Posted June 24, 2014 Share Posted June 24, 2014 Greetings! I tried to create a new weapon, using the following files with the codes in those. Got an awp.png strings.xml - same as the sniper <Row ss:AutoFitHeight="0"> <Cell><Data ss:Type="String">ammo.ballistic.awp</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell><Data ss:Type="String">AWP rifle Magazine</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> </Row> </Row> <Row ss:AutoFitHeight="0"> <Cell><Data ss:Type="String">weapon.awp</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell><Data ss:Type="String">AWP sniper rifle</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> </Row> <Row ss:AutoFitHeight="0"> <Cell><Data ss:Type="String">weapon.awp.desc</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s68"><Data ss:Type="String"><font face="fonts/arial.mvec"\><b>Precision Rifle:</b> Precision weapons are more accurate than rifles and do slightly more damage, making them useful at long range. Their mitigation also gives them a damage bonus against armoured (i.e. robotic) enemies. However, each shot has a higher TU cost than a rifle and the weapon lacks burst fire. It also receives no short-range accuracy bonus and has a negative modifier for reaction fire, making it a poor assault weapon. Range: 30 Damage: 35 Kinetic Suppression: 25 Suppression Mitigation: 10 Ammo Capacity: 6 shots Reaction Modifier: 0.5x Fire Modes: - 38%% TU 60 Acc x 1 shot - 49%% TU 105 Acc x 1 shot - 65%% TU 165 Acc x 1 shot</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> </Row> weapons.xml - same as the sniper rifle <Row ss:AutoFitHeight="0"> <Cell ss:StyleID="s65"><Data ss:Type="String">weapon.awp</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s65"><Data ss:Type="String">weapons/ballistic/awp</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s65"><Data ss:Type="String">weapons/ballistic/awp</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">1</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s66"><Data ss:Type="Number">50</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s66"><Data ss:Type="Number">40</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s66"><Data ss:Type="Number">10</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s66"><Data ss:Type="Number">1.6</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s66"><Data ss:Type="Number">7</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s66"><Data ss:Type="Number">5</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.awp</Data><NamedCell ss:Name="_FilterDatabase"/></Cell> <Cell ss:StyleID="s66"><Data ss:Type="Number">30</Data></Cell> <Cell ss:Index="16"><Data ss:Type="String">Ballistics</Data></Cell> </Row> items.xml - same as the sniper <Row ss:AutoFitHeight="0"> <Cell ss:StyleID="s70"><Data ss:Type="String">weapon.awp</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> And the game crashing when i want to equip the soldiers. What i have missed? Quote Link to comment Share on other sites More sharing options...
Max_Caine Posted June 24, 2014 Share Posted June 24, 2014 Have you made a weapon.awp entry for weapons_gc.xml, and an ammo.ballistic.awp entry in ammos.xml? Quote Link to comment Share on other sites More sharing options...
Veroci Posted June 24, 2014 Author Share Posted June 24, 2014 maybe, that two thing left? I will try it too. Quote Link to comment Share on other sites More sharing options...
Max_Caine Posted June 24, 2014 Share Posted June 24, 2014 I would take a look at work by Mikhail, or catmorbid to see where you might be going wrong, as they've got some fairly impressive ballistic weapon mods. Quote Link to comment Share on other sites More sharing options...
catmorbid Posted June 24, 2014 Share Posted June 24, 2014 (edited) There's a lot of redundancy in the current version of Xenonauts regarding the data (I'm hoping X: CE will eventually fix those!). Basically, to create a new weapon from scratch you need to mod the following files, ALWAYS using the same name: weapons_gc.xml - for the actual weapon stats weapons.xml - for geoscape. The only stats you need to care about here is the clip size and weight, but you need to assign it the correct ammo as well. The damage stats etc. are all redundant. items.xml - this is important, since it determines if the item will exist at all, and how its available: manufactured or unlimited etc. Both weapons and ammo need to be here! ammos.xml - if you use custom ammo, you need to create an entry here strings.xml - weapons and ammo need entries here. You need a separate entry for the weapon name AND its description. e.g. for a new weapon and its ammo: weapon.newweapon, weapon.newweapon.desc, ammo.newweapon, and if you use rockets etc. which also need description, ammo.rockets.newrocket / ammo.rockets.newrocket Beware that for weapons.xml, items.xml and strings.xml you actually need to edit them with excel or similar spreadsheet software if you want to add new entries, because at least I THINK the file has some internal structure -related values that you can easily break if you just text-edit new entries. At least I managed to break mine, after trying a merge with the X: CE, so be careful about using straight text-editor for those. The ones that are safe to edit directly are e.g. weapons_gc.xml which have a different (no mention of cells anywhere) structure. Frankly, the system is shit and I hate the redundancy, but once you know what you're doing, you can do it with decent trouble You can always check my or others' mods for examples on how things should be done, if in doubt. The most important is that you use the same naming convention for your item everywhere. Also, never add more than one weapon at once, since you can easily break things and it'll be hard to trace if you've several weapons you know might cause problems. Also, lacking strings should just show #### instead of crashing it if they're missing. Good luck to you, hope this helps! Edited June 24, 2014 by catmorbid clarification Quote Link to comment Share on other sites More sharing options...
Mikhail Ragulin Posted June 24, 2014 Share Posted June 24, 2014 It should work with the last two steps that Max said...as long as the images are there. Here's what you need to add a new weapon: - weapons_gc.xml - ground combat entry for weapon - weapons.xml - the equip screen for weapons, most of the variables are unused - ammos.xml - add ammo type - items.xml - add new weapon and ammo - images in weapons\ballistics (or wherever one puts the images/points the game to in weapons.xml) for weapon and ammo - image in gui\weapons - makes the weapon show up in ground combat - image in gui\quickthrowimages - clipped ammo image for the quick reload slot - strings.xml - localises the descriptions That's a simple version for adding a new weapon. I might do a proper one (with pictures) soon. Beaten to the punch! Quote Link to comment Share on other sites More sharing options...
Veroci Posted June 24, 2014 Author Share Posted June 24, 2014 I will try them, thanks to you. I will give the property to the weapon and after that, i will write if it worked. I just need to do some paint work Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.