[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
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”