[MOD] Blueprint Analysis

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

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

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

[MOD] Blueprint Analysis

Post by marksmango »

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 »

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 »

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 »

Oh, that's neat. I was kind of hoping it'd be a system of "mining" wrecks, but that'll do. ;)
wanderer
Posts: 279
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: [MOD] Blueprint Analysis

Post by wanderer »

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...
ColManiac
Posts: 124
Joined: Thu, 17. Nov 05, 19:05
x4

Re: [MOD] Blueprint Analysis

Post by ColManiac »

How do I download the BP Analysis mod? I cant find a download link. Looking at the files they say 6 years, assuming 6 years old and out of date?
Can you not upload to steam or nexus?
Taylor2008
Posts: 302
Joined: Fri, 20. Mar 09, 16:38
x4

Re: [MOD] Blueprint Analysis

Post by Taylor2008 »

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

Re: [MOD] Blueprint Analysis

Post by wanderer »

Same answer as Taylor2008....

While I overwrote several scriptfuntions of the old mod for my playstyle, DeadAirs are better !
The old ones are still working (with some quirks), but i cannot recommend them, they never where updated...

Also when using DeadAir BP, be aware that the ship you scaned is saved in an array (from the mod itself). This means different to the old Bluprint scan, where you could scan a ship countless times to get the blueprints. Now, you need another ship of the same type to scan to increase the scans. So, eg. XL takes 100 scans (as its the standart for the mod), now with a police scanner you get 2 scan 'point's. Meaning you need to scan 49 more ships of this XL ship type to get the ship blueprint. You can change the scanning options in the extended menue for it.
If you do not want to scan so much different ships, you need to change the deadairdynamicuniverse.xml. Here look for the $DADVT.$DABPAlreadyScanned variable and when the scaned ship is added to it - comment it out, so there's no add to this array. Of comment out the checks for this array.

Return to “X4: Foundations - Scripts and Modding”