[MOD] Player Shipyards and more

The place to discuss scripting and game modifications for X Rebirth.

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

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

Nikola515 wrote:Hi BlackRain

Is there a way you could make some of PS ships compatible with Miscellaneous IZ Combat Tweaks mod ? For example Succellus Vanguard Destroyer wont act as long range destroyer and it wont use its main cannon anymore. According to w.evans Succellus Vanguard is not registered as long rage ships so that where problem is. Also is there a way you could add drone bay to Succellus Vanguard as well. I noticed that vanilla Sccullus have drones so I assume they all should have ????

Thanks in advance ;)
This is actually all done in CWIR, I'll have to fix it
User avatar
Nikola515
Posts: 3193
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 »

Thanks :)
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....
User avatar
Nikola515
Posts: 3193
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 »

I just noticed that new UI with stations made impossible for manager to order construction drones for shipyard use. I assume they wore increasing speed of ships being built in shipyards ???? Shipyard is still building ships but it seems to me it is slow.....
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....
scotty1025
Posts: 5
Joined: Mon, 25. Jul 11, 21:25
xr

Post by scotty1025 »

Hi,

Is there anyway to turn off autobuilding at the XL shipyard? Its constantly building frieghters & i want to build destroyers instead.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

Nikola515 wrote:I just noticed that new UI with stations made impossible for manager to order construction drones for shipyard use. I assume they wore increasing speed of ships being built in shipyards ???? Shipyard is still building ships but it seems to me it is slow.....

You have to buy construction URVs and transfer them to the shipyard as drones.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

scotty1025 wrote:Hi,

Is there anyway to turn off autobuilding at the XL shipyard? Its constantly building frieghters & i want to build destroyers instead.
I don't know what you are talking about? Player shipyards do not automatically build anything, only NPC shipyards do that. If you are asking if you can turn off autobuilding at NPC shipyards then the answer is no, it is not possible.
vanyfilatov
Posts: 1
Joined: Tue, 18. Oct 16, 00:06

Re: [MOD] Player Shipyards and more

Post by vanyfilatov »

Please teach me, how to add this ship (http://forum.egosoft.com/viewtopic.php?t=378483 Armed Scaldis/Scaldis Plus ingame name) to albion type shipyard.
I would be very grateful.
ns88ns
Posts: 91
Joined: Sun, 11. Sep 11, 22:00
x4

Post by ns88ns »

Hi, BlackRain

A question regarding this mod:

On debug log I found strange errors after installing the mod:

Code: Select all

[General] 0.00 ======================================
[=ERROR=] 0.00 When calling script mining.ship.free on entity 0x11456 - script parameter "$range" was not expected!
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 When calling script mining.ship.free on entity 0x11465 - script parameter "$range" was not expected!
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 When calling script mining.ship.free on entity 0x11474 - script parameter "$range" was not expected!
[General] 0.00 ======================================
Investigating the error entries I found that the mod starts the script with parameter "range" (files NPC_Shiptrader.xml and NPC_Shiptrader_Small.xml):

Code: Select all

<start_script object="$soldship2.pilot" name="'mining.ship.free'">
  <param name="basketoverride" value="[ware.plasma, ware.ions, ware.hydrogen]"/>
  <param name="range" value="'cluster'"/>
</start_script>	
I checked script "aiscript/mining.ship.free.xml and found that only one perameter is defined there:

Code: Select all

<aiscript name="mining.ship.free" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="aiscripts.xsd" version="10">
  <params>
    <param name="basketoverride" default="null" comment="list of wares that takes precedence over any defined warebasket" />
  </params>
I thought I missed a dependency of the mod but there are no dependencies defined in context.xml. So the question is:

Could you please clarify why you call the script putting non-existing parameter?

Thank you.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

It's probably just an error. I haven't worked on this mod in a long time.
ns88ns
Posts: 91
Joined: Sun, 11. Sep 11, 22:00
x4

Post by ns88ns »

Thank you for the reply.

the script is called from IF/ELSE block therefore it doesn't look as error:

Code: Select all

...
<do_elseif value="$soldship2.primarypurpose == objectpurpose.mine and $soldship2.availableunits.{unitcategory.gascollector}.count gt 0">
  <start_script object="$soldship2.pilot" name="'mining.ship.free'">
    <param name="basketoverride" value="[ware.plasma, ware.ions, ware.hydrogen]"/> 
  </start_script>					
</do_elseif>
<do_elseif value="$soldship2.primarypurpose == objectpurpose.mine and $soldship2.isclass.[class.ship_m, class.ship_s] and $soldship2.availableunits.{unitcategory.gascollector}.count gt 0">
  <start_script object="$soldship2.pilot" name="'mining.ship.free'">
    <param name="basketoverride" value="[ware.plasma, ware.ions, ware.hydrogen]"/>
    <param name="range" value="'cluster'"/>
  </start_script>	
</do_elseif>
...
You implemented conditional branching so you foresaw this behavior. Sorry for the questions. I would like to use this mod and I would like to be sure that there are no bugs in the code.

:-)

Respectfully.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

This is fixed in CWIR already, just download and replace with correct files.
ns88ns
Posts: 91
Joined: Sun, 11. Sep 11, 22:00
x4

Post by ns88ns »

Ok. Thank you.
ns88ns
Posts: 91
Joined: Sun, 11. Sep 11, 22:00
x4

Post by ns88ns »

M... It isn't so easy... I just checked and found the same code in the same files in CWIR 1.60 RC (from nexus):

Code: Select all

<do_elseif value="$soldship2.primarypurpose == objectpurpose.mine and $soldship2.availableunits.{unitcategory.orecollector}.count gt 0">
  <start_script object="$soldship2.pilot" name="'mining.ship.free'">
    <param name="basketoverride" value="[ware.ice, ware.ore, ware.silicon, ware.nividium]"/> 
  </start_script>
</do_elseif>
<do_elseif value="$soldship2.primarypurpose == objectpurpose.mine and $soldship2.isclass.[class.ship_m, class.ship_s] and $soldship2.availableunits.{unitcategory.orecollector}.count gt 0">
  <start_script object="$soldship2.pilot" name="'mining.ship.free'">
    <param name="basketoverride" value="[ware.ice, ware.ore, ware.silicon, ware.nividium]"/> 
    <param name="range" value="'cluster'"/>
  </start_script>
</do_elseif>
But... This code is senseless. The second ELSEIF condition in the example abowe will work never because first ELSEIF condition is more generalized.

Really the issue I described prove to be ralated to LostSectors mod, not to PlayerShipyards mod. Buggy code in the PlayerShipyards mod is never executed due to messy ELSEIF conditions...

Sorry for that...

Thank you for you great work.

Return to “X Rebirth - Scripts and Modding”