Holi_D Posted March 9, 2015 Share Posted March 9, 2015 (edited) SO I'm trying to mod Xenonauts. Read up on the forums, adding weapon tutorials and whatnot. Looked up other mods for mod structure and to understand how to patch it all together. It's still a WIP. I plan on using a few assets from other people's work, bu I haven't gotten far enough to actually even think about publishing, so I haven't asked anyone for permissions yet. But I will. Now. For what I am trying to do with this mod: I want to add two sidearms for all tech tiers. SMGs, burst fire, no accuracy, suppressive. Hv pistols, improved damage and range, mitigation at the cost of accuracy, ammo capacity and TU cost. Simple enough. So I added my entries in the files, weapons_gc weapons items ammos strings I even dabbled at the research and manufacture files to unlock the weapons with the corresponding tech. Went around the internet to find cool images to use cuz I can't draw. Tried to the best of my understanding to make a mod. But then. CTDs. The mod loads, GS displays. But whenever I go the soldier equipment screen. CTD. So I tried going over the forum again, changing things here and there. Complete trial and error. Mostly errors I guess. Cuz it still CTD. So I ask for anyone who can figure out what's wrong. Cuz I don't understand the thing enough to make it work myself. Here's the link to the google drive with the files: Here Cheers. Edited March 9, 2015 by Holi_D link didn't work Quote Link to comment Share on other sites More sharing options...
kabill Posted March 9, 2015 Share Posted March 9, 2015 The link just goes to the dropbox log-in page. Without looking at the files, though, the issue is likely one of three things: 1) File paths to the weapon images are incorrect 2) The ammo for the weapon isn't assigned correctly/the ammo types haven't inserted correctly 3) The image path for the ammo is incorrect Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 9, 2015 Author Share Posted March 9, 2015 Updated link. I think I did the image pathing correctly. That being said, I'll go double check right away. Thx! Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 9, 2015 Author Share Posted March 9, 2015 GOT IT. The ammo.xml file. I didn't use the proper MODMERGE arguments and it was not loading so my new ballistic weapons were causing the crashes. I also have discovered that I want transparency on my images. lol Quote Link to comment Share on other sites More sharing options...
kabill Posted March 9, 2015 Share Posted March 9, 2015 Glad you managed to find the issue. And yes, transparency is a must! Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 9, 2015 Author Share Posted March 9, 2015 So round 2. I got to fix the entries in various XML files, mostly by checking the carbines & shotguns mod Khall made, btw. and I managed to debug the equipment screen. Now the game crashes during the loading screen for the ground combat, but the logs do not make too much sense. There are error that pop up, but they seem to be related to xce. And finally, the log file just ends without telling me what caused the crash. I have updated the files on the Gdrive. Quote Link to comment Share on other sites More sharing options...
kabill Posted March 9, 2015 Share Posted March 9, 2015 I've just had a quick glance at weapon_gc and noticed that you've not used MODMERGE="update" for the ammo entry for the pistol. If you're not modding that part of the entry you should either remove it (if you don't care about other mods possibly changing it) or you should use MODMERGE="update" to ensure that the value stays as you want it. Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 10, 2015 Author Share Posted March 10, 2015 While looking at that entry, I compared it with the pistol entry in weapons, and the two of them don't fit. Also, the entry in strings is doesn't fit. The reload cost are not the same. The laser pistols ammos are off. I was wondering if there was a way to make the string entry fetch the correct values in the other documents, but since I have noooooooooooooo coding experience whatsoever... i don't know if it's doable. I added the MODMERGE="update" to the ammo entry. Are these tags recursive? Like the ammo entry, for exemple, I am compiling the True Laser mods along with my stuff, but if I change the projectile do I need to add the MODMERGE="update" attribute to it as well? Or just having the attribute on the ammo element also updates its child elements? Quote Link to comment Share on other sites More sharing options...
kabill Posted March 10, 2015 Share Posted March 10, 2015 Regarding your first point - many of the stats in weapons.xml are unused hence why they don't align. In ground combat, any variables in weapons_gc.xml take precedence; the only significant values in weapons.xml for ground combat are ammunition (because this sets how many shots the weapon will have at the beginning of the mission, regardless of the limit specified in weapons_gc.xml) and the item size (which is still used in the GC soldier equip screen). Regarding your second point - maybe, but it's far more work than would be worthwhile. Regarding the final point, using MODMERGE="update" in an element will update all child-elements that are included. The only exception is where you have a child-element which also has it's own properties, i.e. <SingleShot> and <Ammo>, which has to have it's own MODMERGE="update" command specified. So to update an ammo type for a weapon, you need to use MODMERGE="update" with each the <Ammo> element but everything within that element (e.g. the projectile type) will be updated following from this without having to specify it for the individual child elements. If that makes sense? Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 10, 2015 Author Share Posted March 10, 2015 A - weapons and weapons_GC - Thanks for that. I was wondering which were pertinent and which were not. B - Yeah I understand. The advantage is that if such a structure is feasible and can work, then you can implement a mod friendly structure that will simplify the life of the people modding from that point on. I'll start looking into that for kicks. C - Actually that does make sense. Updating the parent will update the child elements, unless they have child elements themselves, in which case I need to specify the update for that parent's child. Right? <element1 MODMERGEATTRIBUTE="name" MODMERGE="update" name="element1"> <child1 attrib1="value1" /> --no update required-- <child2> <grandchild1 MODMERGEATTRIBUTE="name" MODMERGE="update" name="grandchild1"> <greatgrandchild1 attrib1="value1"/> --no update required-- </grandchild1> </child2><element1> like such? Quote Link to comment Share on other sites More sharing options...
kabill Posted March 10, 2015 Share Posted March 10, 2015 Yes, that's right, except on <grandchild1> you only need MODMERGE="update" as there's only one element of that type. In other words, you only need MODMERGEATTRIBUTE in instances where you have the same element type repeated several times. E.g. Most weapons only have one <Ammo> element under <Ammos> so only need to use MODMERGE. However, the rocket launcher has multiple <Ammo> entries under <Ammos> therefore you need MODMERGEATTRIBUTE too in order to deliniate which of the several <Ammo> elements you're trying to change. It's worth noting that using MODMERGEATTRIBUTE as you have in your example wouldn't break anything. But it's not needed either. Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 10, 2015 Author Share Posted March 10, 2015 So I could say, add more ammo type to my weapons and the game would support that? or is the some hardcoded rule somewhere that state that only certain weapons can have multiple ammo types? Quote Link to comment Share on other sites More sharing options...
kabill Posted March 10, 2015 Share Posted March 10, 2015 No, sadly. The key issue is that there's no support for extra ammunition types in the geoscape soldier equip screen, i.e. weapons can have only a single ammo assigned to them there so other ammunitions are inaccessible. Rockets are coded as a special case but it's impossible to appropriate that system for other weapons, at least without losing multiple rocket types for rocket launchers. (It's also on my to-do list for XCE, although is probably beyond my skill). Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 11, 2015 Author Share Posted March 11, 2015 I'm just dishing out item off the top of my head here. and the new ammo couldn't be specified as an equipment in the "others" tab? I mean, if it's specified as an ammunition type in the ammos.xml but then when the time comes to define the item you cram it in the equipment tab? With a full fledge entry in the items.xml specifying that? Gorram!! I can't test it cuz my mod file still crashes when I load GC!!! ARG. Quote Link to comment Share on other sites More sharing options...
drages Posted March 11, 2015 Share Posted March 11, 2015 Holi, i tried nearly every possible way about multi ammo.. dont lose your time at this.. Even you create many ammo, you can only give one ammo to a weapon at weapons.xml.. so rockets are weapons rather then ammo.. realy there is no way.. Quote Link to comment Share on other sites More sharing options...
kabill Posted March 11, 2015 Share Posted March 11, 2015 Yup, really doesn't work. That said, I spent 'til the early hours of last night trying to implement support for multiple ammo types in XCE. I've had partial success so far: I can get the game to load multiple ammo types into the game but have yet to work out how to manage the UI side of things. Partly this is a technical issue which might require a bespoke solution but it's also a question of player interaction (i.e. how actually to enable the player to swap between ammo types in the UI). My current working idea is to have a right-click on the ammo type cycle through them but I'm open to ideas as its not ideal (might open a new thread on that actually). Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 11, 2015 Author Share Posted March 11, 2015 (edited) you mean in GC, right clicking on the quick ammo to open up a pannel similar to that of the quick grenades and clicking on the new ammo type to load up that mag? EDIT: but then you'd have to obligation to start GC with the regular mag in the weapon and since there is no way to go around that because of how the game handles ammo in weapons_gc... EDIT2: did you have, by any chance, any clue as to why my thing crashes when I load gc? Edited March 11, 2015 by Holi_D Quote Link to comment Share on other sites More sharing options...
Holi_D Posted March 11, 2015 Author Share Posted March 11, 2015 Damn it. I changed my pictures, replaced the ones that were missing transparency and bam. GC loaded correctly with my weapons working!! Seriously. I am le happy. Quote Link to comment Share on other sites More sharing options...
kabill Posted March 11, 2015 Share Posted March 11, 2015 EDIT: but then you'd have to obligation to start GC with the regular mag in the weapon and since there is no way to go around that because of how the game handles ammo in weapons_gc... Yeah, probably something that needs working on too (would be really useful for rockets if nothing else). I changed my pictures, replaced the ones that were missing transparency and bam. GC loaded correctly with my weapons working!! Victory! Quote Link to comment Share on other sites More sharing options...
Max_Caine Posted March 11, 2015 Share Posted March 11, 2015 <rant> This game is so damn fussy about the sizes for every image. Woe betide you if your images are even 1 px out of the acceptable bounds, for thou shalt not pass and thou shalt scratch thy damn head for hours trying to figure out what the problem is. </rant>. Eh, it's one of the first things I check now when I add something new with images. Especially the Xenopedia, because that has very specific sizes it likes. 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.