[MOD] Blueprint Analysis

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

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

Post Reply
marksmango
Posts: 4
Joined: Wed, 17. Oct 18, 15:47
x4

[MOD] Blueprint Analysis

Post by marksmango » Thu, 16. Jan 20, 20:23

Requires functions introduced in the 3.0 beta. Almost guaranteed not to work in previous versions.

Beta link: Blueprint Analysis on github

To me, scanning stations has always been a repetitive, hardly-rewarding mechanic in X4. No longer.

With this mod installed, every ship and station module you scan will register as progress towards unlocking the blueprint for that object. Different modules have different costs, with connection modules requiring less than 100 scans, while production and build modules can cost 300+. Entering scan mode isn't necessary for modules (just need to be close enough to trigger the normal scan), but ships require a manual scan from the selection menu.
As a bonus, if the object you scan has equipment attached-turrets, weapons, shields, or engines-there's a small chance to increase progress on one of those objects at random.


This was the first mod idea I had for this game, but us modders didn't really have the capability to create our own menus. Thanks to SirNukes, this is no longer an issue. You'll need Simple Menu API installed, which you can find on his github here (you only need the first folder simple_menu_api, not the test).

To access the mod menu, go to Extension Options in the Esc. menu and select Blueprint Progress.

Should be compatible with new ships and modules provided by mods, assuming they aren't marked as 'noplayerblueprint.' This also applies to any vanilla objects.

Notes/Plans:
  • The level of scan currently doesn't affect the amount of progress you make. Scanning from your suit gives the same progress as scanning from your ship. I believe you can double scan objects by doing ship then suit, but not vice versa. I plan to account for scan levels in a future update.
  • If you look closely, you'll notice that storage module progress may randomly increase as you fly around. As far as I can tell, the game does a scan of each storage module right as it leaves your visible range for what I assume to be trading purposes. For now, storage unlock requirements are a bit higher than the others but should accumulate rather quickly. In the future I may attempt to handle this differently.
  • Learning some objects like shipyard modules will probably never be possible with this mod alone because you probably won't find 500 shipyard modules. However, a supplement mod I've created called Blueprint Exchange will allow you to trade the salvage introduced by my Scavengers mod for blueprint progress. I expect to add more functionality here as well.
  • Having said that, I will likely adjust the scanning costs based on feedback and more testing. I may also reduce the costs if you aren't running the Exchange to make the 'better' modules still achieveable. Increasing rewards for more in-depth scans will also help out here.
  • This does not affect blueprints sold by faction representatives (unless you learn one, in which case you won't be able to buy it). It's possible I could set up some sort of discount, but that is unlikely.
  • Ignoring objects marked as 'noplayerblueprint' should rule out any objects we aren't meant to build, but there's still the possibility that some things are unmarked when they should be. If I come across any of these I will disable them manually.

tylitalo
Posts: 46
Joined: Thu, 3. Jan 08, 09:56
x4

Re: [MOD] Blueprint Analysis

Post by tylitalo » Thu, 23. Jan 20, 23:10

Looks interesting, but what exactly does the scavenger mod do? There's no description on the github page for it, and I can't find another post here from you on it.

marksmango
Posts: 4
Joined: Wed, 17. Oct 18, 15:47
x4

Re: [MOD] Blueprint Analysis

Post by marksmango » Fri, 24. Jan 20, 22:08

Right, I never posted that one here. It's over on the nexus.

Basically they're a garbage collection faction that scoops up unowned ships and cargo so there isn't free stuff laying around all the time. To make up for it, most ships have a chance to drop salvage when destroyed that you can then sell at Scavenger stations for money. With this mod and Exchange installed, you can also trade that salvage for blueprint progress.

tylitalo
Posts: 46
Joined: Thu, 3. Jan 08, 09:56
x4

Re: [MOD] Blueprint Analysis

Post by tylitalo » Sat, 25. Jan 20, 02:45

Oh, that's neat. I was kind of hoping it'd be a system of "mining" wrecks, but that'll do. ;)

wanderer
Posts: 278
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: [MOD] Blueprint Analysis

Post by wanderer » Fri, 30. Apr 21, 20:34

Still working in the newest game.

A problem occured while updating a ship mod (XRShipMod).
I scanned the Arwen (from the ship mod) and got the blueprints. Now I updated the ship mod to the newest release. Afterwards my Arwen blueprint was gone, but the Blueprint mod still showd that it was scanned fully. This is happening, when the ships blueprint are changed. In case of the XRShip mod this happend to the Arwen there.
To overcome this problem here a diry fix inside the BlueprintAnalysis.xml from the Bluepront mod.

Search for <library name="UpdateProgress">
Change this code segment:

Code: Select all

				<library name="UpdateProgress">
					<actions>
						<do_if value="not $macro.ware.tags.indexof.{tag.noplayerblueprint} and $macro.id">
							<do_if value="not $scanned.{'$'+$macro.id}?">
								<set_value name="$scanned.{'$'+$macro.id}" exact="table[$name=$macro.name, $objectmacro=$macro, $count=0]"/>
								<!--<show_notification text=" '$'+$macro.name + ' added to list ' + $scanned.{'$'+$macro.id}.$count" timeout="5s" priority="8"/>-->
							</do_if>
							<do_if value=" $scanned.{'$'+$macro.id}.$count lt $goal">
								<set_value name="$scanned.{'$'+$macro.id}.$count" exact="$increase" operation="add" />
								<!--<show_notification text=" $scanned.{'$'+$macro.id}.$name + ' updated to ' + $scanned.{'$'+$macro.id}.$count" timeout="5s" priority="8"/>-->
								<do_if value="$scanned.{'$'+$macro.id}.$count ge $goal" >
									<add_blueprints macros="$macro" />
								</do_if>
							</do_if>
							<do_if value="$scanned.{'$'+$macro.id}.$count ge $goal" >
								<add_blueprints macros="$macro" />
							</do_if>
						</do_if>
					</actions>
				</library>
As seen, I added/copied the blueprint macro when the conditions are met. This also leads to a msg. every time you scan an already finished blueprint. Not nice, but working. When all (Re-)scanned blueprints are done, redo the change and those msg's. are gone...

Post Reply

Return to “X4: Foundations - Scripts and Modding”