Jump to content
Sign in to follow this  
endersblade

Dart Gun mod - Pulling my hair out

Recommended Posts

I'm attempting to add a dart gun to the game. If I just add the info and images to the XCE folder (since I'm using that), the game and mod work perfectly fine. But I'm trying to put it into its own mod. This is my first time attempting to do this, so I'm really hoping someone can point out WTF I'm doing wrong!

I followed the Tutorial for adding a weapon, that's how I got it working in the first place. I just spent far too long trying to prettyfy the xml files into this post, but it kept telling me I had too many images in it...?

Attached is what I have. All of the text in the files was copied from the working files in XCE. I just took out what I needed. At least, what I thought I needed. I obviously missed something. The game crashes any time I try to go to the Equip Soldier screen on Geoscape. Haven't been able to test it in combat, obviously.

Dart Gun.zip

Dart Gun.zip

Dart Gun.zip

Share this post


Link to post
Share on other sites

I'm clueless as to how XCE operates, but I see there's an extra line in your items.xml:

<Row ss:AutoFitHeight="0">

<Cell ss:StyleID="s70"><Data ss:Type="String">weapon.dartgun</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>

<Cell><Data ss:Type="Number">1</Data></Cell>

</Row>

The bit in bold, it's in both entries. This doesn't appear in the vanilla files at all. What's it for?

Share this post


Link to post
Share on other sites

It's the storage space needed for the item. XCE has a function for making storage space an actual thing, it's just not used meaningfully by default.

Share this post


Link to post
Share on other sites

Yeah, that's why I mentioned I copied the stuff from XCE, in case I nabbed something that isn't in Vanilla lol. Thanks for looking at the stuff, I hope you can find something I missed!

Share this post


Link to post
Share on other sites

Is there any sort of crash log that gets generated somewhere, so I can possibly see what's causing it to crash?

I revalidated my files, so everything is a fresh install. I just recreated it from scratch again. I used the XCE mod, changed its files accordingly, and the gun works ingame just fine. I then copied all the files I changed into a new folder, named it Dart Gun, added a modinfo.xml, and then edited the copied files to have just what I added. I didn't change any existing entry. Game crashes.

When it functions, the gun is unlocked like the stun baton, pops up on the ballistics list, and is unlimited like the rest of the ballistic weapons. I can equip it to soldiers, and it works in combat. All the pics show up properly and everything.

When I test it in the XCE mod, I don't use the research part, so the weapon is there from the start, and it works in combat just fine.

Edited by endersblade

Share this post


Link to post
Share on other sites

Dude seriously? That's twice you've done that. I really wish you'd quit. Pointing me to the instructions doesn't help when, as far as I know, I'm doing everything right, but obviously I'm not. I have every sticky opened in a separate tab, and I've gone over them a million times. Hence the reason I'm asking for help, I'm obviously missing something that maybe someone can point out.

Your tut about modular modding is how I got as far as I did in the first place. I have another mod that is working perfectly fine, but it isn't adding a weapon, just changing .xml files.

I've compared each file I have to that of the Pulse-fire Rifle mod, which basically does the same thing, but adds more items. Other than adding additional items, I don't see a difference.

Edited by endersblade

Share this post


Link to post
Share on other sites
I have every sticky opened in a separate tab, and I've gone over them a million times. Hence the reason I'm asking for help, I'm obviously missing something that maybe someone can point out.

Besides other things, the ability to not miss a million times a whole section titled 'Testing' that says how to get a log file that you asked about?

Dude seriously? That's twice you've done that.

Sorry, I don't have a complete record for everybody here.

I really wish you'd quit.

Fair enough.

Share this post


Link to post
Share on other sites
Besides other things, the ability to not miss a million times a whole section titled 'Testing' that says how to get a log file that you asked about?

Sorry, I don't have a complete record for everybody here.

Fair enough.

Well see? That's something I missed. I didn't even notice it until you pointed it out just now. Like I said, I know I'm missing something but I don't know what. Gonna see what I can see in the logs now. I'm not trying to say you aren't a helpful person, but just posting links doesn't do a whole lot without at least a little explanation!

Edited by endersblade

Share this post


Link to post
Share on other sites

Thu Sep 11 16:06:53 2014: Xenonauts, version .

Thu Sep 11 16:06:53 2014: Pixel Shader Version: ffff0300

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:06:57 2014: ##### : Missing string for label '0'

Thu Sep 11 16:07:05 2014: ##### : Missing string for label ''

Thu Sep 11 16:07:08 2014: ##### : Missing string for label ''

Thu Sep 11 16:07:08 2014: ##### : Missing string for label 'Undefined'

ERGH this is so frustrating! I have no idea what it's talking about. I don't have any extra 0's floating around, or spaces. I have the -modinfo tag when I launch the game.

I'm attempting to run the game without any other mods at all, just mine. These are the only errors I get.

Edited by endersblade

Share this post


Link to post
Share on other sites

The quick glance I had last night implied that in your .xml files (not the spreadsheet ones, specifically ammo.xml and weapons_gc.xml; I think that was all of them anyway) weren't using the modmerge commands to load the new items you'd added.

If you're adding new items in those files, you need to add in MODMERGEATTRIBUTE="name" MODMERGE="insert" to the top level of the item to make it work. E.g.:

<Weapon MODMERGEATTRIBUTE="name" MODMERGE="insert" name="WEAPON_NAME">

That way, you're telling the game how to load the files. I suspect if you do that for your new ammo and weapon_gc entries then it will work.

Share this post


Link to post
Share on other sites

Hmm, thanks, will try it when I get home! But how come I haven't seen those lines in other mods? Like I said, I compared to the pulse-fire rifle mod. It adds far more stuff than mine does, but doesn't have any modmerge lines.

Regardless, I'm at work now so I can't try it, but I certainly will tonight!

Share this post


Link to post
Share on other sites

Ha, I think that got it! Thank you so much!

Can someone test this out for me? I've removed the research requirements for now, in a fresh game (or at any point I guess) it should show up at the bottom of ballistics. It works at the soldier equip screen as well as in combat for me.

I removed all other mods, and it works like a charm. Also works with them in. I think I'm finally ready to release this, thanks to you and Ilunak!

Dart Gun v1.0.zip

Dart Gun v1.0.zip

Dart Gun v1.0.zip

Edited by endersblade

Share this post


Link to post
Share on other sites

Ok. I decided to make it a new research, after stun weapons. Just made more sense. Anyway, I made all the necessary files, filled everything out, and hit a snag. The Xenopedia page won't pop up! The weapon unlocks, it works in battle just fine, but the xeno page never shows up.

Xenopedia.xml:

<Row ss:AutoFitHeight="0" ss:Height="204">

<Cell ss:StyleID="s70"><Data MODMERGE="insert" ss:Type="String">Researches.DartGun</Data></Cell>

<Cell ss:StyleID="s70"><Data ss:Type="String">Dart Gun</Data></Cell>

<Cell ss:StyleID="s70"><Data ss:Type="String">xenopediaimages/dartgun</Data></Cell>

<Cell ss:StyleID="s71"><Data ss:Type="String">Xenonaut Weapons</Data></Cell>

<Cell ss:StyleID="s71"><Data ss:Type="String">WEP</Data></Cell>

<Cell ss:StyleID="s72"><Data ss:Type="String">We've successfully managed to update our current tranquillizer tech with the materials and knowledge we've gained from the aliens. The dart tip itself is made from Alien Alloy and coated in Alenium. This gives it significantly more penetrating power, allowing the darts to punch through even the thickest skin. The tranquillizing agent itself has been modified from various chemicals we've picked up from the aliens. The dart itself is relatively harmless, but packs enough tranquillizer to take down even a Sebellian in just a few shots. Being a ranged weapon, this gives us a significant advantage over the Stun Rod, as getting into melee range can prove to be both problematic as well as dangerous.</Data></Cell>

<Cell ss:StyleID="s73"/>

</Row>

Researches.xml:

<Row ss:AutoFitHeight="0" ss:Height="51">

<Cell ss:StyleID="s77"><Data MODMERGE="insert" ss:Type="String">Researches.DartGun</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="s76"><Data ss:Type="String">Researches.StunWeapons</Data></Cell>

<Cell ss:StyleID="s76"/>

<Cell ss:StyleID="s76"><Data ss:Type="String">UnlockKnowledge( "Researches.DartGun" );

UnlockItem("weapon.dartgun");</Data></Cell>

<Cell ss:StyleID="s76"><Data ss:Type="String">Researches.DartGun</Data></Cell>

</Row>

I also added the proper xenopediaimages pic.

These are the only three files I had to add (and obviously their entries in Strings.xml) on top of an already working mod. Attached is my current mod with all the files. Again, with or without the research parts, the gun works in game (as far as my tests have gone on a fresh install of Xeno/X:CE). I have deleted and remade the files several times to make SURE I wasn't typo'ing anything.

I copied the entries for Stun Weapons for these files, and just edited them to what I needed. There is also nothing at all in the Error Log: Everything checks out with "merge ok" or "replace ok".

Dart Gun 1.1.zip

Dart Gun 1.1.zip

Dart Gun 1.1.zip

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
Sign in to follow this  

×