Hello all,
Let me start by saying that I've never made any kind of mod before, nor do I have any kind of programming background. I wanted, basically, to rebalance a couple of things for my own use -- mostly little tweaks here and there to give ships with no use case a niche. From there, I got ambitious, but it's all still just xml edits and nothing that I shouldn't be able to figure out. No advanced scripting, no basic scripting, just a rebalance of weapons and a few ships that might have gotten slightly out of control.
I've got the tool, I've extracted the thing, I understand the calculations and more or less what all the weapon and ship parameters in the props/weaponsystems, fx/weaponfx, units/ship stuff over here macros do. I have a decent sense of where I'm going, and I've looked at some examples from VRO and a couple of other mods to get a sense of how I want to structure the diff entries. So far so good! But, of course, there are still questions.
Firstly, to understand what I'm doing -- I'm using the existing weapon entries, revising them, and redistributing a few things. I want to get rid of the Mk1 and Mk2 distinction and put new weapons that feel different in their place (not unlike what shuulo did in VRO). I'd also like some of these to be faction-locked. Basically, the intention is to have a general pool of weapons and turrets that (almost) everybody can use, while anything with a maker prefix on it (TEL Muon Charger, say), should ideally only be compatible with ships from that faction. I'd also like to re-Boronize the Terran and have them back to the X3 style, using only their own tech that's mutually incompatible with Commonwealth items.
Questions:
1) Some of the entries in the vanilla Cat01 extract don't match what's actually in the game, and it's driving me crazy. I haven't seen this issue with any of the extensions. For instance, bullet_gen_s_plasma_01_mk1_macro.xml lists the damage value of the S Plasma Cannon Mk1 projectile at 226, bullet speed at 503 and lifetime at 8. In game, those values are completely different (1024 dmg, bullet speed 1229, lifetime 3.3). What gives? I'm going to be changing the values anyway, so to some extent it probably doesn't matter, but I'm uncomfortable in my understanding. These are supposed to be the values the game uses, so why is it using something else? Everything I've spot checked in the Boron, Terran and Split stuff is an exact match for what I'd expect it to be. Is there an overwrite or weird multiplier somewhere, and if so, will my changes also get eaten?
2) How do I faction-lock things? I've had a look at (for instance) the Boron and Terran highpower .xml. I would have expected to see some sort of class to be assigned (like Highpower) at the weapon level and a corresponding these-are-the-classes-the-ship-is-compatible-with entry at the ship level, but I don't think I've found anything like that.
I think I may have figured this out. I found a terran unlocker mod and looked at the changes it made. If I'm not mistaken, it's in the connections section of the big ship file (rather than the little macro file).
I'm not sure what the platformcollision and symmetry tags do in the example below, but it seems to me that if I were to remove 'standard' from the line below, that ship would only be able to use the highpower and missile categories in that weapon slot. Now I guess the question is how I create (for instance) an 'argon' tag and assign it to a specific weapon.
<connection name="con_weapon_01" tags="weapon small platformcollision standard highpower missile symmetry symmetry_right symmetry_2 combat ">
3) Check my understanding, please -- the min/avg/max price on a given weapon is what you're charged at the store. The price of such equipment is coded this way, rather than being a function of the cost of the production wares * some sort of markup.
Cracked this one. Not 100% sure of what's happening under the hood, but there is a direct relationship between cost of production and price. It's not linear, though. The average price of a ship = 5*production cost. The low price takes a higher margin at ~6.11, while high takes a lower margin at 4.41, more or less. This seems to hold pretty consistently for Foundations. Terran ships seem to have different margins on either end, but they're also 5 in the middle. I assume both components and price need to be changed, and that it's possible to have a faction take a bigger or smaller gross margin if the relationship between the specified production resources and ship price change. That said, if you want to maintain the link, average price = average cost*5.
4) How will the AI incorporate these weapons? My plans include changing, for instance, some redundant Split weapons into extra faction-locked weapons for ARG and co. Will changing the makerrace variable automatically put these in the appropriate shops / blueprints, or is this something I'll need to do manually? Will AI ships buy my redesigned weapons? Is there a way to assign specific ones to AI loadouts? My thinking was that altering the original entries rather than creating new weapons will cut down on the amount of work involved to situate them.
5) How is ship speed and acceleration calculated? I'm assuming it's got to be some function of the relevant engine's thrust compared to the ship's drag and/or mass. Guessing drag and thrust somehow = speed and acceleration is a function of thrust to mass? Maybe?
Solved. Was using a 2-engine ship in my calculations and didn't think to double the thrust. Speed = sum (all engine thrust values) / drag; accel = sum (all engine thrust values) / mass. Simple.
Thanks for reading. This is kinda daunting, but pretty fun to tinker with. If I like my end result, who knows, maybe somebody else will too!
My first mod -- would love some help!
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 3
- Joined: Fri, 28. Apr 23, 16:14
My first mod -- would love some help!
Last edited by rattlejaw on Mon, 1. May 23, 21:06, edited 1 time in total.
-
- Posts: 245
- Joined: Mon, 27. Jun 11, 05:58
Re: My first mod -- would love some help!
First of all, welcome to the forums, and to X4 modding.
1) The file that is 'reading' the game is located in '05'. I recommend unpacking all script files in the game, if you haven't already done so, i.e. all data files that can be modified and referenced, xml, lua, xsl, etc, to get a broader view of how they interact. There are files that overwrite other files as cats are incremented.
2) If I understand what you mean, what you are looking for are connections. Slots for weapons, shields, engines, everything, are governed by 'flags', which tell the game which part it can install and which it can't. 'highpower' is a delimiting flag that you can find on those connections in the 'tags' attribute.
3) Well, prices fluctuate depending on supply and demand, commissions and discounts, there are a variety of factors that influence this issue. For the formula let's say you take the average price of the item and take these factors into account. Sorry, I can't be more concise.
4) There are a lot of gun modding gurus on this forum, I'll just tell you to check wares.xml.
5) Based on the values corresponding to the attributes:
Start by downloading a mod with some affinity to what you intend to do, see how it's done, make your diffs ... X4 modding has a lot to offer but also a lot to learn. Unpack the whole game, study its structure. Don't forget the sticky section of tutorials and resources.
EDIT: I was drafting my reply and saw that you had edited. Be careful to remove that flag: https://www.egosoft.com:8444/confluence ... %20weapons
1) The file that is 'reading' the game is located in '05'. I recommend unpacking all script files in the game, if you haven't already done so, i.e. all data files that can be modified and referenced, xml, lua, xsl, etc, to get a broader view of how they interact. There are files that overwrite other files as cats are incremented.
2) If I understand what you mean, what you are looking for are connections. Slots for weapons, shields, engines, everything, are governed by 'flags', which tell the game which part it can install and which it can't. 'highpower' is a delimiting flag that you can find on those connections in the 'tags' attribute.
3) Well, prices fluctuate depending on supply and demand, commissions and discounts, there are a variety of factors that influence this issue. For the formula let's say you take the average price of the item and take these factors into account. Sorry, I can't be more concise.
4) There are a lot of gun modding gurus on this forum, I'll just tell you to check wares.xml.
5) Based on the values corresponding to the attributes:
Code: Select all
speed = ('engine: forward' * 'ship: slots engine') / 'ship: forward'
acceleration = ('engine: forward' * 'ship: slots engine') / 'ship: mass'
EDIT: I was drafting my reply and saw that you had edited. Be careful to remove that flag: https://www.egosoft.com:8444/confluence ... %20weapons
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.
Thank you for your efforts.
-
- Posts: 3
- Joined: Fri, 28. Apr 23, 16:14
Re: My first mod -- would love some help!
Thank you! I'd been trying to extract selectively to keep from drowning in the file structure, but that's mostly just meant I had to keep going back to the well. So, fair enough! I've extracted all of 05 and will poke around.
I think I'm going to plan around a smaller subsection of mod first; just a few Teladi ship edits and tweaks to the Phoenix main guns. Figure those out, check to see if it works, and go from there.
I think I'm going to plan around a smaller subsection of mod first; just a few Teladi ship edits and tweaks to the Phoenix main guns. Figure those out, check to see if it works, and go from there.
-
- Posts: 3
- Joined: Fri, 28. Apr 23, 16:14
Re: My first mod -- would love some help!
Does anyone know what the restitution bullet property does?
e.g. the 0.5 in shard battery:
<bullet speed="2880" lifetime="0.8" amount="5" barrelamount="1" icon="weapon_shotgun_mk1" timediff="0.004" angle="1.25" maxhits="3" ricochet="0.5" restitution="0.5" scale="0" attach="0" />
e.g. the 0.5 in shard battery:
<bullet speed="2880" lifetime="0.8" amount="5" barrelamount="1" icon="weapon_shotgun_mk1" timediff="0.004" angle="1.25" maxhits="3" ricochet="0.5" restitution="0.5" scale="0" attach="0" />