[SCRIPT] XenoTec Shipyard V.1

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

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Mon, 30. Mar 09, 01:28

LiveAus wrote:Hi!
First congratulations on these great scripts. The backstory is very credible so it doesn't seem like cheating.
I have a question though, why did you leave out the "Unknown Object" Xenon ship from the Xenon SY? Is it possible for me to add it as a buyable ship?
If you don't want me to mess with your mod could you at least tell me how to insert ships in created SY? I know how to use the cheat menu to insert new products and resources to custom stations, but the menu lacks an "add ship" command.

Thank you!
open up the script editor and scroll down to my script (setup.amurph0.xenotecSY or something like that)

in it there's are series of three lines that repeat themselves, they should be like:

$ship = "J"
$SY -> add product to factory or dock: $ship
$amount = $SY -> add 1 units of $ship


those three lines repeat themselves for each ship.

e.g. the "J" changes to "K", "L", "M", "P", "LX" etc, for the other ships.

just copy and paste any three of those lines (press c to copy, and v to paste)

and change the "J" to anything you want, save it, and next time you load the game it will be at the shipyard.
Corsair 400c // Intel i7 8700k // H100i v2 // ASUS Maximus X Code // ASUS 1080ti Strix OC // 2x8GB Corsair Vengeance 3200MHz // Samsung 960 Evo 250GB // 960GB SanDisk Ultra II // Corsair RM850i

User avatar
LiveAus
Posts: 74
Joined: Wed, 21. Mar 07, 20:59

Post by LiveAus » Mon, 30. Mar 09, 01:43

Thanks for the quick reply!

I did what you said, copied those three lines and pasted them and changed the ship type to Unkown Object. Saved and reloaded the game. Unfortunately the SY in Black Hole Sun still doesn't sell the ship. Did i do anything wrong?

Here's how the code is now:

<?xml version="1.0" standalone="yes" ?>
<?xml-stylesheet href="x2script.xsl" type="text/xsl" ?>
<script>
<name>setup.amurph0.XenoTec</name>
<version>2</version>
<engineversion>42</engineversion>
<description>Adds XenoTec Shipyard</description>
<arguments>
</arguments>
<sourcetext>
<line linenr="001" indent=""><var>$find = </var><text> find station: sector=</text><var>Black Hole Sun</var><text> class or type=</text><var>Argon Federal Argon Shipyard</var><text> race=</text><var>Argon</var><text> flags=</text><var>1</var><text> refobj=</text><var>Argon Federal Argon Shipyard</var><text> maxdist=</text><var>0</var><text> maxnum=</text><var>1</var><text> refpos=</text><var>null</var></line>
<line linenr="002" indent=""></line>
<line linenr="003" indent=""><var>if not </var><var>$find -></var><text> exists</text></line>
<line linenr="004" indent=" "><var>$XenoSY = </var><text> create station: type=</text><var>Argon Federal Argon Shipyard</var><text> owner=</text><var>Argon</var><text> addto=</text><var>Black Hole Sun</var><text> x=</text><var>-15000</var><text> y=</text><var>-5000</var><text> z=</text><var>25000</var></line>
<line linenr="005" indent=" "></line>
<line linenr="006" indent=" "><var>$ship = </var><var>J</var></line>
<line linenr="007" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="008" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="009" indent=" "></line>
<line linenr="010" indent=" "><var>$ship = </var><var>K</var></line>
<line linenr="011" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="012" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="013" indent=" "></line>
<line linenr="014" indent=" "><var>$ship = </var><var>L</var></line>
<line linenr="015" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="016" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="017" indent=" "></line>
<line linenr="018" indent=" "><var>$ship = </var><var>LX </var></line>
<line linenr="019" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="020" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="021" indent=" "></line>
<line linenr="022" indent=" "><var>$ship = </var><var>M</var></line>
<line linenr="023" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="024" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="025" indent=" "></line>
<line linenr="026" indent=" "><var>$ship = </var><var>N</var></line>
<line linenr="027" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="028" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="029" indent=" "></line>
<line linenr="030" indent=" "><var>$ship = </var><var>P</var></line>
<line linenr="031" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="032" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="033" indent=" "></line>
<line linenr="034" indent=" "><var>$ship = </var><var>PX</var></line>
<line linenr="035" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="036" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="037" indent=" "></line>
<line linenr="038" indent=" "><var>$ship = </var><var>Q</var></line>
<line linenr="039" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="040" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="041" indent=" "></line>
<line linenr="042" indent=" "><var>$ship = </var><var>Unknown Object</var></line>
<line linenr="043" indent=" "><var>$XenoSY -></var><text> add product to factory or dock: </text><var>$ship</var></line>
<line linenr="044" indent=" "><var>$amount = </var><var>$XenoSY -></var><text> add </text><var>1</var><text> units of </text><var>$ship</var></line>
<line linenr="045" indent=" "></line>
<line linenr="046" indent=" "><var>$XenoSY -></var><text> set name to </text><var>'XenoTec Shipyard'</var></line>
<line linenr="047" indent=" "></line>
<line linenr="048" indent=" "><var>$shield = </var><var>$XenoSY -></var><text> install </text><var>20</var><text> units of </text><var>2 GJ Shield</var></line>
<line linenr="049" indent=""><text>end</text></line>
<line linenr="050" indent=""><text>return </text><var>null</var></line>
</sourcetext>
Argnu beef.. now with 30% less Boron!

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Mon, 30. Mar 09, 01:52

did you make the changes in game with the script editor or with a text editor? your much better off using the in-game editor.

And are you sure what you picked was a ship and that it was the right unknown object, because there's loads of unknown objects.
Corsair 400c // Intel i7 8700k // H100i v2 // ASUS Maximus X Code // ASUS 1080ti Strix OC // 2x8GB Corsair Vengeance 3200MHz // Samsung 960 Evo 250GB // 960GB SanDisk Ultra II // Corsair RM850i

User avatar
LiveAus
Posts: 74
Joined: Wed, 21. Mar 07, 20:59

Post by LiveAus » Mon, 30. Mar 09, 01:57

I used the in-game script editor, selectec the "J" and in the next menu selected "Select ship type". Then a menu with "Race", "Class" and "Ship" appeared, i selected the Xenon Race and the Unknown Object on the bottom of the list.
Saved it, reloaded the game and still no change. I've tried to leave the sector, save and then reload, but still nothing. I've also tried to change from "Unknown Object" to "Centaur", but still no difference.

Could you try to do it yourself, if you have the time? And if it works could you upload the file?

Thanks a lot, sorry to be bothering you. I've already installed your other SY scripts and been flying around in a Fenrir thanks to you.
Congratulations one more time!
Argnu beef.. now with 30% less Boron!

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Mon, 30. Mar 09, 02:04

oh, that's right....... i forgot..................

blow up the shipyard :lol:

then save your game and reload it, use the cheat script to blow it up.

When it respawns the ship should be there :D
Corsair 400c // Intel i7 8700k // H100i v2 // ASUS Maximus X Code // ASUS 1080ti Strix OC // 2x8GB Corsair Vengeance 3200MHz // Samsung 960 Evo 250GB // 960GB SanDisk Ultra II // Corsair RM850i

User avatar
LiveAus
Posts: 74
Joined: Wed, 21. Mar 07, 20:59

Post by LiveAus » Mon, 30. Mar 09, 02:21

Got it!
I blew it up and reloaded and there they are, some nice Unkown Objects for sale!!

Thanks a lot, for the great mod and for all the fast help!!!
Looking forward for your future scripts/mods!!

EDIT: hmm, the Unknown Object lasers don't recharge... maybe i'm just not supposed to be using this ship!
Argnu beef.. now with 30% less Boron!

User avatar
Nividium
Posts: 800
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Mon, 30. Mar 09, 07:18

After seeing the code used for your Xenotech Shipyard, I felt compelled to give you a few pointers that you can use or not, your choice:

- What if a Player has a station or complex at x= 15000 y= 5000 z= 25000 . You should have a separate "check safe" script that proposes a random positon ie: within range of say, x=-30000 to x=30000 and then compare that random value to "existing" stations, gates and asteroids within that coordinate with a buffer of say 5000-10000 spacing range. Have the script while loop until it finds a safe random location. If nothing is there, then it is "safe" to plunk your Shipyard there, so create a Global Variable to store that coordinate, so your make.shipyard script can then retrieve the safe coordinate for creating the Shipyard.

- Instead of adding ships one by one to your Shipyard, get the array (as shown below) and add them all at once.

- You added shields to the Shipyard, but forgot to set them to max power from the get go.

Code: Select all

Script a.temp.add.xenon.ships
Version: 0
for Script Engine Version: 42

Description
Creates a Shipyard and populates with Xenon Ships

Arguments
Source Text

001   * Determine safe place to create Shipyard
002 @ = [THIS] -> call script 'xenon.shipyard.get.safe.position' : pass variable named $sector=$sector
003   $safe.position.array = get global variable: name='xenon.shipyard.get.safe.position'
004   $x = $safe.position.array[0]
005   $y = $safe.position.array[1]
006   $z = $safe.position.array[2]
007   
008   * Create Shipyard
009   $shipyard =  create station: type=Argon Federal Argon Shipyard owner=Argon addto=Black Hole Sun x=$x y=$y z=$z
010   $shield.type = $shipyard -> get max. shield type that can be installed
011   = $shipyard -> install 200 units of $shield.type
012   $max.shield.strength = $shipyard -> get maximum shield strength
013   $shipyard -> set current shield strength to $max.shield.strength
014   
015   * Get ship array and populate the Shipyard
016   $ship.array =  get ship array: of race Xenon class/type=Moveable Ship
017   $ship.array.size =  size of array $ship.array
018   while $ship.array.size > 0
019   |dec $ship.array.size = 
020   |$ship = $ship.array[$ship.array.size]
021   |$wtc = $ship -> get ware type code of object
022   |$shipyard -> add product to factory or dock: $wtc
023   |= $shipyard -> add 10 units of $wtc
024 @ |= wait randomly from 2 to 10 ms
025   end
026   return null

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Mon, 30. Mar 09, 17:45

Thanks for the tips nividium, but if i got the ship array of a race wouldn't that add all the stuff like unknown objects, etc that is in the ship list of that race?

Like if i did that for an argon shipyard would it have like all the satellites, mines and lasertowers and stuff like that in it?

I didn't think it much mattered about the shields, they just charge up after a little while anyway.

EDIT: Oh wait yeah, "class movable ship", but wouldn't that still add undesirable ships like unknown objects?
Corsair 400c // Intel i7 8700k // H100i v2 // ASUS Maximus X Code // ASUS 1080ti Strix OC // 2x8GB Corsair Vengeance 3200MHz // Samsung 960 Evo 250GB // 960GB SanDisk Ultra II // Corsair RM850i

User avatar
Nividium
Posts: 800
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Mon, 30. Mar 09, 18:53

No, it won't add any undesired ships, only the main ones that you really want.

Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Thu, 2. Apr 09, 00:57

Another problem is since there are no Kyon Emitter factories it'll be very hard to equip the ships.

Any ideas???
You'll need to assign a specific fab: like a npc Split Heavy Weapons Complex, or somesuch, that produces 3 wares. Then set products to A, B, G kyon (I believe), and resources..to whatever you want. However, sale price in Cr.'s for any kyon weapon (in 3R anyway) is set ridiculously low...Pity, really. Seriously screw with gamebalance.

DDRS mod for 3R had a single npc Split Kyon Forge that produced for the few DDRS ships that carried kyons. DDRS mod for XTC--called "DD-TC"--will feature same.

Post Reply

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