Question: Making a weapon or turret mod for player faction only?

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

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

Drake
Posts: 40
Joined: Wed, 28. Nov 18, 14:16
x4

Question: Making a weapon or turret mod for player faction only?

Post by Drake »

Is there a way to make a weapon or turret available only to the player with a special flag for just the player faction? I ask because I am looking at tinkering with making an extension of the research base to allow for research into weapons only the player would have late game. Thought process is if you can research teleportation, modding all ships parts, and hacking advanced station leaks for BPs then why would the player not be able to use the most advanced research facility in existence staffed my a genius scientist to make technologically superior weapons?

I have to start somewhere so learning how to lock a weapon turret group to just the players shipyards and collection would be it. Thank you in advance for any and all replies.
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Question: Making a weapon or turret mod for player faction only?

Post by DeadAirRT »

If I understand you correctly, just don't give the bp to AI factions but that would only allow player to use them at player owned wharf/shipyard.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Question: Making a weapon or turret mod for player faction only?

Post by Max Bain »

DeadAirRT wrote: Tue, 21. Apr 20, 18:56 If I understand you correctly, just don't give the bp to AI factions but that would only allow player to use them at player owned wharf/shipyard.
I dont think that works because you need to buy the bp from an npc.
Something that came into my mind would be to set the threshold bigger than 1. If possible the ai will never fit the weapon. But don't know if the game allows that.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Question: Making a weapon or turret mod for player faction only?

Post by DeadAirRT »

Max Bain wrote: Tue, 21. Apr 20, 19:28
DeadAirRT wrote: Tue, 21. Apr 20, 18:56 If I understand you correctly, just don't give the bp to AI factions but that would only allow player to use them at player owned wharf/shipyard.
I dont think that works because you need to buy the bp from an npc.
Something that came into my mind would be to set the threshold bigger than 1. If possible the ai will never fit the weapon. But don't know if the game allows that.
If you set the owner to player it should be fine

You also would get the BP finishing the research (if done correctly)
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Question: Making a weapon or turret mod for player faction only?

Post by Max Bain »

Ah ok, didnt know that.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Question: Making a weapon or turret mod for player faction only?

Post by DeadAirRT »

Max Bain wrote: Tue, 21. Apr 20, 20:00 Ah ok, didnt know that.
in wares, if no owner is set then all factions have the bp (including xenon).
in factions.xml, if a license is granted to another faction it just allows them to buy at their stations (does not share bp though).
Drake
Posts: 40
Joined: Wed, 28. Nov 18, 14:16
x4

Re: Question: Making a weapon or turret mod for player faction only?

Post by Drake »

DeadAirRT wrote: Tue, 21. Apr 20, 19:39
Max Bain wrote: Tue, 21. Apr 20, 19:28
DeadAirRT wrote: Tue, 21. Apr 20, 18:56 If I understand you correctly, just don't give the bp to AI factions but that would only allow player to use them at player owned wharf/shipyard.
I dont think that works because you need to buy the bp from an npc.
Something that came into my mind would be to set the threshold bigger than 1. If possible the ai will never fit the weapon. But don't know if the game allows that.
If you set the owner to player it should be fine

You also would get the BP finishing the research (if done correctly)
Thank you for all the replies, I really appreciate it! So how would I set the BP to be player only? I see on wares.xml you can list factions but I believe that is who sells it correct? I tried meddling with that and changing it to a single line with "player" as the faction but it did not take hold so I am missing something here.
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Question: Making a weapon or turret mod for player faction only?

Post by DeadAirRT »

Setting the owner actually just makes it available to another script that builds the blueprints granted.

Just to be certain, you tried owner="player" and it gave you an error message or you didn't notice any change in a new or saved game?

I'll take a look at it in depth tomorrow and give you a clear answer.
Drake
Posts: 40
Joined: Wed, 28. Nov 18, 14:16
x4

Re: Question: Making a weapon or turret mod for player faction only?

Post by Drake »

DeadAirRT wrote: Wed, 22. Apr 20, 08:34 Setting the owner actually just makes it available to another script that builds the blueprints granted.

Just to be certain, you tried owner="player" and it gave you an error message or you didn't notice any change in a new or saved game?

I'll take a look at it in depth tomorrow and give you a clear answer.
I really appreciate it, just my first dabbling with modding and I appreciate the help from all of you.
dyosseek
Posts: 1
Joined: Thu, 11. Dec 25, 19:26
x4

Re: Question: Making a weapon or turret mod for player faction only?

Post by dyosseek »

If I'm not mistaken, in Wares.xml tag "noblueprint" should prevent AI from using weapon. But I have absolutely no idea how this tag would affect the research

Return to “X4: Foundations - Scripts and Modding”