[TC] Make a created ship buyable in a shipjard

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Ge-Ge 96
Posts: 149
Joined: Wed, 17. Jun 09, 16:19
x3tc

[TC] Make a created ship buyable in a shipjard

Post by Ge-Ge 96 » Tue, 8. May 12, 18:04

I created a ship and I entered the game with the file TShips, x3_universe, etc. With XModelViewer I can see the ship for sale to Omicron Lyrie, but I can buy just starting a new game. How can I do to be able to buy it whit a loaded game?
Il mio canale YouTube: http://www.youtube.com/user/gekkofragger
Tantissimi gameplay vari.
Il mio eBay:
http://myworld.ebay.it/gekkokys

User avatar
EmperorJon
Posts: 7178
Joined: Mon, 29. Dec 08, 21:58
x3tc

Post by EmperorJon » Tue, 8. May 12, 18:07

As far as I know, adding a new model like that requires a new game start. It cannot be added to a current game. I think.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

dillpickle
Posts: 1154
Joined: Mon, 3. Nov 08, 15:25
x3tc

Post by dillpickle » Tue, 8. May 12, 18:40

It can be done with the Mission Director - it's how they add the Sirokos to the OTAS shipyard when you reach rank 10 with them...

Ge-Ge 96
Posts: 149
Joined: Wed, 17. Jun 09, 16:19
x3tc

Post by Ge-Ge 96 » Tue, 8. May 12, 18:42

how can I do this??
P.S. sorry for my bad english
Il mio canale YouTube: http://www.youtube.com/user/gekkofragger
Tantissimi gameplay vari.
Il mio eBay:
http://myworld.ebay.it/gekkokys

kurush
Posts: 3955
Joined: Mon, 7. Nov 05, 00:53
x3tc

Post by kurush » Tue, 8. May 12, 18:42

dillpickle wrote:It can be done with the Mission Director - it's how they add the Sirokos to the OTAS shipyard when you reach rank 10 with them...
I thought that for objects existing in the game you can also use the cheat package or just a simple script. In the cheat package there is a command to add ships / stations to a shipyard. Does the new ship show up if you use this command?

User avatar
EmperorJon
Posts: 7178
Joined: Mon, 29. Dec 08, 21:58
x3tc

Post by EmperorJon » Tue, 8. May 12, 18:51

dillpickle wrote:It can be done with the Mission Director - it's how they add the Sirokos to the OTAS shipyard when you reach rank 10 with them...
Yes, but that's a ship which already exists; you can use the MD or SE to easily add a ship to a shipyard, but AFAIK not a ship which didn't exist when the save was created.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

Ge-Ge 96
Posts: 149
Joined: Wed, 17. Jun 09, 16:19
x3tc

Post by Ge-Ge 96 » Tue, 8. May 12, 19:02

so, what i must to do?
Il mio canale YouTube: http://www.youtube.com/user/gekkofragger
Tantissimi gameplay vari.
Il mio eBay:
http://myworld.ebay.it/gekkokys

dillpickle
Posts: 1154
Joined: Mon, 3. Nov 08, 15:25
x3tc

Post by dillpickle » Tue, 8. May 12, 19:11

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="AddMyShip" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <cues>
    <cue name="AddMyShip">
      <condition>
        <check_value value="{player.age}" min="10s"/>
      </condition>
      <action>
        <do_all>
          <find_station race="argon" class="shipyard" name="OLShipyard">
            <sector x="13" y="6"/>
          </find_station>
          <add_products object="OLShipyard">
            <ware typename="SS_SH_OTAS_HCF" exact="1"/>
          </add_products>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
Save as 'something'.xml and place it in the director folder (create one if you haven't got one) in the X3TC root folder or addon folder for AP.

You will need to change the typename - SS_SH_OTAS_HCF - for the typename of your ship.

This will put it for sale in the shipyard in Omicron Lyrae. If you want it on more tan one shipyard you can duplicate the code between the <do_all> tags for each station, you will need to give each shipyard a 'unique name' and change the sector co-ordinates.

Alternatively, something like:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="AddMyShip" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <cues>
    <cue name="AddMyShip">
      <condition>
        <check_value value="{player.age}" min="10s"/>
      </condition>
      <action>
        <do_all>
          <find_station race="argon" typename="SS_FAC_A_SHIP" group="ArgonShipyards" multiple="1">
            <sector x="13" y="6"/>
            <jumps max="75"/>
          </find_station>
          <do_all exact="{group.object.count@ArgonShipyards}" counter="count">
            <add_products object="{group.object.{counter@count}@ArgonShipyards}">
              <ware typename="SS_SH_OTAS_HCF" exact="1"/>
            </add_products>
          </do_all>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
Should put it for sale in every 'normal' Argon shipyard (so not the Super shipyards in CBSE or Legend's Home, or the OTAS shipyard).
kurush wrote:I thought that for objects existing in the game you can also use the cheat package or just a simple script. In the cheat package there is a command to add ships / stations to a shipyard. Does the new ship show up if you use this command?
Don't know anything about the cheats - It's quicker for me to do it with MD...
EmperorJon wrote:Yes, but that's a ship which already exists; you can use the MD or SE to easily add a ship to a shipyard, but AFAIK not a ship which didn't exist when the save was created.
As long as there is a unique typename for the ship and it's in the tShips file there shouldn't be a problem.

Ge-Ge 96
Posts: 149
Joined: Wed, 17. Jun 09, 16:19
x3tc

Post by Ge-Ge 96 » Tue, 8. May 12, 19:19

thank you guys for the replys. tomorrow i'll try :)
Il mio canale YouTube: http://www.youtube.com/user/gekkofragger
Tantissimi gameplay vari.
Il mio eBay:
http://myworld.ebay.it/gekkokys

User avatar
DrBullwinkle
Posts: 5704
Joined: Sat, 17. Dec 11, 02:44
x3tc

Post by DrBullwinkle » Tue, 8. May 12, 21:14

Dillpickle's MD scripts should work.

Alternatively, Add your ship to the game.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 20601
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Wed, 9. May 12, 00:24

you can add any ship to the shipyards, new or old via scripts

what you cant do is add them via the galaxy unless u use the MD to merge the new map into the game as map changes only take effect at the start of the game

User avatar
apricotslice
Posts: 13734
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Wed, 9. May 12, 02:56

Adding a ship to a shipyard is a couple of line script.

If you download the one on my download site to add the HQ and MO to a shipyard, you can copy that and then just change the HQ to your new ship, and change the race to where you want it.

Anything added to the game can be referenced in a script or MD immediately, only maps have the limitation of game start.

adriancos
Posts: 26
Joined: Tue, 24. Apr 12, 11:43
x3tc

Post by adriancos » Wed, 11. Feb 15, 13:03

hello

i have a question: how can i remove a ship that i previously added to a shipyard using this script?

User avatar
apricotslice
Posts: 13734
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Wed, 11. Feb 15, 13:19

If its a setup.??? script, remove it from the scripts folder. The ship wont get added next time the game starts.

adriancos
Posts: 26
Joined: Tue, 24. Apr 12, 11:43
x3tc

Post by adriancos » Wed, 11. Feb 15, 18:24

apricotslice wrote:If its a setup.??? script, remove it from the scripts folder. The ship wont get added next time the game starts.
i tried that :wink:
but the ship is still there (i added the OTAS Maintenance pod to Goner shipyard in Lightseeker, i use XRM)

In fact, here is the complete issue:
- if i use the script to add a ship to any shipyard, ship will be there available for sale
- if i do not save the game, remove the script from Director folder, ship will not be available for sale at the shipyard anymore
- if i save the game while script is in Director folder, exit, delete the script, load saved game - the ship is not removed from shipyard

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”