[MOD] Research Blueprints

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

language
Posts: 73
Joined: Mon, 9. Dec 13, 10:55
x4

[MOD] Research Blueprints

Post by language »

I am happy to announce my next mod: Research Blueprints. Tired of playing the "good guy" with other factions to improve relation and unlock the possibility to buy blueprints? Tired of farming credits to be able to actually buy the blueprints from other factions? Check this mod out!

I will release it to steam workshop once 6.0 releases. But I already published it on github:

https://github.com/yujin44/researchblueprintsmod

Edit: 6.0 releasing tomorrow, here is the steam workshop link:
https://steamcommunity.com/sharedfiles/ ... 2961007180

What it will allow is research blueprints with wares in the player HQ. Here are some screenshots for explanation:

https://ibb.co/RBpKCy5
https://ibb.co/BVCzFDJ

A few words regarding this mod (from developer perspective):

Creating it was more dedious than I initially thought. Once I started started creating it and experimenting what would work best, I quickly realized, that the devs really didn't give modders a lot of freedom here. First I thought it would be easy, just find all wares, let the player choose one and then calculate the cost of the research based on the ware average price and resources needed for production (like a ship costs X energycells and X hullparts) and then create that research. But no, all research wares have to be statically predefined in the library and there is no way to change that definition in runtime.
So what I did is define some wares which act like categories and differ in kind and amount of resources needed, so in runtime the mod finds all wares for which the player can have a blueprint (and does not have it yet) and then finds the corresponding "category" and add that "category" ware to research. Once the research is finished, the blueprint is granted to the player and the actual research is undone and disappears to be able to reuse it for the next blueprint in the same category. It is only possible to start the reseach with talking to Boso Ta and it is only possible to research once at a time (game limitation), so I kept research durations low-ish. This was the most work tbh, the balancing... Making it worth doing but also not feel like a cheat, getting all wares, finding all ratios, finding all costs, prices and comparing to actual blueprint prices from a faction representative and then deciding how many category wares to make, how much should each one cost, which blueprint should go into which category and how long should each research category take.
I did it like this, because for me this is the only possible approach in X4 modding, that kinda represents what I understand as "technology research" in classical RTS games. I also had other ideas, like create my own station module explicitly for research, because what keeps me from building a second or third research facility to be able to research multiple blueprints at the same time? But that didn't work out, as a production module can only produce 1 ware and since I have multiple categories, I would need multiple modules and even then it would not feel like actual research to me, where I order a research, collect all needed wares and wait for it to finish so I can start the next one. In a production module I could just let it run automatically, not caring at all, because that is what the game makes a production module do, products would just pile up in storage, so I would need to convert finished products to blueprints and with a stockpile large enough I could just unlock all blueprints at once, that would not be really immersive.

So this is what I ended up with, also since I didn't want to bother with lua modding, I went with dialog options, which is a bit cluncky ngl, but what gives?
If anybody wants to collaborate, like creating a small UI for blueprints choosing, or even has better ideas what to improve/rework (Im not gona remake the whole mod from the ground up though, just saying), tag me on discord in the ego server.

Return to “X4: Foundations - Scripts and Modding”