[MOD] Player Owned Ship Production

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

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

aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: [MOD] Player Owned Ship Production

Post by aftokinito » Sat, 19. Jan 19, 20:00

pit800 wrote:
Sat, 19. Jan 19, 08:20
i buy bluprints after ownning a schipyard and x 4 stopt work
I no read thread so no konw.

Staberind
Posts: 119
Joined: Wed, 5. May 10, 23:32
x4

Re: [MOD] Player Owned Ship Production

Post by Staberind » Sun, 20. Jan 19, 05:43

Heh,
Anyway, even with 0 mods there is deffo something wrong with blueprints/research, even if you have not got the research done, they sometimes drop anyway, plus I have had crashes at similar points with and without POSP, buying blups from faction reps. I think crashes with shipbuilding just reveal this quicker, so I don't think its an issue with POSP, more due to X4 needing a little more work.
mmmh, probably quicker to talk about it on disco.
Aladna Hill, Again, AP, 3.1. in the last Game worthy of the "X" title. <<<< X4 might just be changing this. :?:

Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: [MOD] Player Owned Ship Production

Post by Berserk Knight » Sun, 20. Jan 19, 13:40

I have 2 additions that'll make things go smoother.

/md/InitUniverse.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="//cue[@name='CreateShipDealerNPCs']/@checkinterval">1min</replace>
</diff>
This will create ship dealers on shipyards every 1 minute instead of the stock interval of 29 minutes.
Yes, the lack of ship dealers on the station is the exact reason why you can't build ships in your shipyard for a while. (...Unless you got lucky and the build module got built right before the tick.)


/md/Job_Helper.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="/mdscript/cues/cue/actions/do_if/add_to_group">
          <do_if value="$Shipyard.isplayerowned">
            <cancel_cue cue="AddShipyard"/>
          </do_if>
          <do_else>
            <add_to_group groupname="md.$Shipyards" object="$Shipyard"/>
          </do_else>
	</replace>
	<replace sel="/mdscript/cues/cue/cues/cue/cues/cue[@name='FindSuitableShip']/actions/do_if/do_if/do_while/do_all/do_if/do_all/do_if/do_if/add_build_to_construct_ship">
                                <do_if value="$Shipyard.isplayerowned">
                                  <set_value name="$Build" exact="null"/>
                                </do_if>
                                <do_else>
                                  <add_build_to_construct_ship result="$Build" object="$Shipyard" buildobject="$Ship"/>
                                </do_else>
	</replace>
</diff>
The first part was SUPPOSED TO stop player shipyards from being registered and then cancel the cue.
...Which shouldn't happen anyways since every trigger for this cue has a player faction check in it, so this cue shouldn't be firing for player shipyards.
Both of them fail for some reason, and the cue still fires.

So I put in the second part. When the shipyard looks for a job ship to build, if it's a player owned shipyard, it'll do nothing.

This will keep your shipyards free of NPC faction build orders.
It will NOT prevent NPC ships from using it like an equipment dock to restock ammo or get repairs.

Baldamundo wrote:
Fri, 18. Jan 19, 01:23
Huh. I'm only seeing one set of blueprints available at any of the faction reps.

Is this the distinction between <blueprint ware="shield_par_m_standard_01_mk2"/> and<blueprint ware="shield_par_m_standard_02_mk2"/>, and would I be able to fix it with a savegame edit?
Ah...I see the problem. The wares.xml only changes a single ware for shields.

Then the answer is yes to both.

Mysterial
Posts: 645
Joined: Wed, 6. Nov 02, 20:31
x4

Re: [MOD] Player Owned Ship Production

Post by Mysterial » Sat, 26. Jan 19, 02:46

Berserk Knight wrote:
Sun, 20. Jan 19, 13:40
The first part was SUPPOSED TO stop player shipyards from being registered and then cancel the cue.
...Which shouldn't happen anyways since every trigger for this cue has a player faction check in it, so this cue shouldn't be firing for player shipyards.
Both of them fail for some reason, and the cue still fires.

So I put in the second part. When the shipyard looks for a job ship to build, if it's a player owned shipyard, it'll do nothing.

This will keep your shipyards free of NPC faction build orders.
Are you sure this is actually where the build orders come from? The code in Job_Helper checks for the shipyard owner matching the desired ship. But I was poking around in the resupply code and found that order.restock.subordinates does not. It just uses the closest friendly shipyard.

Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: [MOD] Player Owned Ship Production

Post by Berserk Knight » Sat, 26. Jan 19, 13:49

Mysterial wrote:
Sat, 26. Jan 19, 02:46
Are you sure this is actually where the build orders come from? The code in Job_Helper checks for the shipyard owner matching the desired ship. But I was poking around in the resupply code and found that order.restock.subordinates does not. It just uses the closest friendly shipyard.
Hmm, it seems the AI was trolling me. After 2.5 hours of SETA, one of the NPC factions did indeed get an order (or 2) through. (Apparently, 1+hour of SETA while you have the only functioning shipyard in the galaxy isn't enough.)
Still a lot less than what I normally get without that little patch of mine (which is basically an instant spam-fest of build orders) so it might be working to some degree?

I think there are 2 different job ship build order queues, one that's global which is periodically picked up by Job_Helper, and another that's posted to a specific shipyard and instantly started by order.restock.subordinates.

Fixing that and interrupt.restock as well should make player shipyards NPC order free.

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Re: [MOD] Player Owned Ship Production

Post by Requiemfang » Sat, 26. Jan 19, 16:37

So it appears that that guy who uploaded the shipyard thing to Nexus had the file removed but he decided to reupload the thing again...

https://www.nexusmods.com/x4foundations/mods/279

Thyriel
Posts: 7
Joined: Mon, 28. Nov 05, 11:42
x4

Re: [MOD] Player Owned Ship Production

Post by Thyriel » Mon, 28. Jan 19, 13:31

Requiemfang wrote:
Sat, 26. Jan 19, 16:37
So it appears that that guy who uploaded the shipyard thing to Nexus had the file removed but he decided to reupload the thing again...

https://www.nexusmods.com/x4foundations/mods/279
The Save game dosent work til you download the Shipmod here.. and even then its not possible to buy the blueprints. I told him that already the last time but posts were deleted..
never the less the is one point that is fascinating.. Buildplots with 30x30x30 km Massive Gigacomplexes no problem .. but.. useless Big stations cause big performence issues.. and even big Shipyards build with alot of docking ans maintainence modules will cause trouble .

Dragonmalte
Posts: 2
Joined: Tue, 1. Oct 13, 21:43
x4

Re: [MOD] Player Owned Ship Production

Post by Dragonmalte » Wed, 30. Jan 19, 23:55

The latest version linked here seems to only have the content file in it, which just defines the name of the addon etc from what I can see, no functionality for me in game at least, going to the Source site lets me download an older version named download repository as download which seems to have more files inside at least, but I can't find the blueprints ingame either even with that one, nor do I get an extra research option in game, so I'm at a loss what I'm doing wrong here, do I have to start a new game or is the download simply bugged at the moment?

aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: [MOD] Player Owned Ship Production

Post by aftokinito » Thu, 31. Jan 19, 02:48

Dragonmalte wrote:
Wed, 30. Jan 19, 23:55
The latest version linked here seems to only have the content file in it, which just defines the name of the addon etc from what I can see, no functionality for me in game at least, going to the Source site lets me download an older version named download repository as download which seems to have more files inside at least, but I can't find the blueprints ingame either even with that one, nor do I get an extra research option in game, so I'm at a loss what I'm doing wrong here, do I have to start a new game or is the download simply bugged at the moment?
Fixed, try again.

Dragonmalte
Posts: 2
Joined: Tue, 1. Oct 13, 21:43
x4

Re: [MOD] Player Owned Ship Production

Post by Dragonmalte » Thu, 31. Jan 19, 19:29

Thanks, the modfiles look fine now at least, gonna have to playtest them later

tmshots
Posts: 2
Joined: Wed, 5. Dec 18, 19:55

Re: [MOD] Player Owned Ship Production

Post by tmshots » Tue, 5. Feb 19, 00:34

I am ctd every time I try to buy large and xl blueprints. Any ideas? Or did I miss the part where it says "large and xl not ready yet"...

gorgofdoom
Posts: 203
Joined: Wed, 5. Dec 18, 18:48
x4

Re: [MOD] Player Owned Ship Production

Post by gorgofdoom » Tue, 5. Feb 19, 11:48

You might also look into how the list for the ship trader is changed when you acquire a new BP. Is that addressed at all? To my knowledge, no traders in game have their avalible wares modified while the game is running.

aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: [MOD] Player Owned Ship Production

Post by aftokinito » Wed, 6. Feb 19, 03:06

tmshots wrote:
Tue, 5. Feb 19, 00:34
I am ctd every time I try to buy large and xl blueprints. Any ideas? Or did I miss the part where it says "large and xl not ready yet"...
This is a known bug with LearnBlueprint() that is out of my control. Some people had luck starting from a fresh save with POSP installed from the beginning and others had luck purchasing all the ship building BPs before constructing any of the ship building modules but it's a quite random bug.
gorgofdoom wrote:
Tue, 5. Feb 19, 11:48
You might also look into how the list for the ship trader is changed when you acquire a new BP. Is that addressed at all? To my knowledge, no traders in game have their avalible wares modified while the game is running.
This is completely irrelevant, the ship trader is just a way to open the ship configuration UI.

Param70
Posts: 1
Joined: Wed, 20. Feb 19, 06:47
x4

Re: [MOD] Player Owned Ship Production: 2.00 public beta

Post by Param70 » Thu, 21. Feb 19, 09:20

In 2.00 public beta purchase blueprint work fine. In old saves too. But buttons in ship configuration window missing. Any idea?

Hawkeye.Strikes
Posts: 8
Joined: Tue, 22. Jan 19, 20:48

Re: [MOD] Player Owned Ship Production

Post by Hawkeye.Strikes » Tue, 2. Apr 19, 17:14

When I go to any shipyard /wharf and try to buy or mod a ship all the configuration options are missing other than than those along the top.
I have narrowed it down to this mod by removing all other mods and then testing with my save game and then a new game start. In both cases the configuration options were missing.

If I remove this mod from the extensions folder (in the game folder) the save will not load with a missing mod error.

Does anyone know how to remove this mod successfully?

Thanks

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 19:25
x4

Re: [MOD] Player Owned Ship Production

Post by Cg089 » Wed, 3. Apr 19, 07:52

The saves are .xml inside an archive, so it should be possible with some work to do so. No clue what you'd need to remove tho.

user1679
Posts: 794
Joined: Fri, 20. Jul 18, 23:20

Re: [MOD] Player Owned Ship Production

Post by user1679 » Sun, 5. May 19, 10:03

Game (GOG): v2.21
OS: Win 7 Pro x64
Mod Location: User documents method, game does not load using the 'game folder' method

Bug: When used by itself, this mod completely hides the "upgrade / repair" screen

After starting a new game and boarding my ship, when I click the "upgrade / repair" button, I can only see the model of my ship. None of
the buttons to select new mods are visible and the area where you would add the parts to the build list is missing as well.

When this mod is installed with your companion mod, Mobile Ship Production, the upgrade screen appears as normal but the undock
button is always disabled and the player must use the keyboard shortcut to undock

After looking at your menu_docked.XPI from Mobile Ship Production compared to the X4 one, it appears there are several functions
that have been redefined. I wonder if Egosoft updated those files in v2.21 to the point they are too different from the version you used when
you modded.

docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

Re: [MOD] Player Owned Ship Production

Post by docwho83 » Wed, 27. May 20, 06:34

Ok I looked inside. Feel very blind right now. I just want one part of code. I want to add the research so we can get the data leaks for the build modules. Where am I missing?

Edit never mind I found the code area. Wares. lol ok anyway simple mod up now.

buildmodule
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals

raim729
Posts: 157
Joined: Mon, 17. Dec 18, 16:21
x4

Re: [MOD] Player Owned Ship Production

Post by raim729 » Sun, 31. May 20, 09:56

Hello,

I tested your mod,
Question, with, your mod, I don't get to buy any satellite, equipment? Is that normal?
Schifswerft, wants to buy ship, can't choose, anything?

I have HQ, but under research nothing to see of your mod which can, be researched?

Buying blueprints, there are so many modules listed at once. Which is what?

Manawydn
Posts: 291
Joined: Sun, 26. Jan 20, 06:54
x4

Re: [MOD] Player Owned Ship Production

Post by Manawydn » Sun, 14. Jun 20, 22:51

You can build your own shipyard without mods now, and as such, this (old) mod might break your game.

Post Reply

Return to “X4: Foundations - Scripts and Modding”