[SCRIPT] Orbital Weapon Platform Transport Service 1.1

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

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

Mycu
Posts: 412
Joined: Fri, 28. Sep 12, 08:30
x4

[SCRIPT] Orbital Weapon Platform Transport Service 1.1

Post by Mycu »

Description
This script adds new command "OWP Transport" which can be found in Orbital Weapon Platform's special command menu.
It allows to place owned Orbital Weapon Platform in any friendly sector.
But not for free.

Price calculation is based on distance between current location and destination.
Different sized Orbital Weapon Platforms have different base transport rates.
There also is minimum and maximum transport fee, so moving OWP just 1m is not cheap :)

Orbital Weapon Platforms (Small, Medium and Large) are added to two Argon shipyards:
- Argon Prime
- Light of Heart

LU Compatible

[ external image ]

Technical
Uses Text File and Page File 2095
Uses Special Command Slot 552
X3 AP 3.1 + XRM
X3 AP 3.1 + LU
Mycu
Posts: 412
Joined: Fri, 28. Sep 12, 08:30
x4

Post by Mycu »

Version 1.1:
* OWP's can not be placed in near distance to enemy ships or stations
X3 AP 3.1 + XRM
X3 AP 3.1 + LU
User avatar
ltdan81
Posts: 117
Joined: Thu, 23. Feb 12, 16:35
x3ap

Setup error

Post by ltdan81 »

I wasn't able to buy the OWP's when I first installed... They were there but "out of stock". I ended up rewriting the setup script to ensure the new products are stocked. Also it 'shouldn't' try to add the new wares with every reload this way..

Code: Select all

$pageId = 2095
load text: id=$pageId
set global variable: name='mycu.owp.service.var.pageId' value=$pageId

set script command upgrade: command=[COMMAND_TYPE_SPECIAL_52]  upgrade=[TRUE]
global script map: set: key=[COMMAND_TYPE_SPECIAL_52], class=[M1], race=[Player], script='mycu.owp.service', prio=0

*================================
*added global variable when installed - Lt Dan
*================================
$installed=get global variable: name='owp.services.installed'
skip if not $installed
return null

* *******************************
* ** add OWP to Argon Prime and Light of Heart shipyards
* *******************************
*================================
*assigned variable to OWP's  - Lt Dan
*================================
$total.new=3
$new.products.array =array alloc: size =$total.new
$new.products.array [1]={Neutral Race Small Orbital Weapons Platform}
$new.products.array [2]={Neutral Race Medium Orbital Weapons Platform}
$new.products.array [3]={Neutral Race Large Orbital Weapons Platform}
*================================
*made variable same for both shipyards to allow sub  - Lt Dan
*================================
$owp.add = find station: sector=[Argon Prime] class or type={Argon Federal Argon Shipyard (FAC_A_SHIP)} race=[Argon] flags=null refobj=null maxdist=null maxnum=null refpos=null
gosub AddProducts:

$owp.add = find station: sector=[Light of Heart] class or type={Argon Federal Argon Shipyard (FAC_A_SHIP)} race=[Argon] flags=null refobj=null maxdist=null maxnum=null refpos=null
gosub AddProducts:
set global variable: name='owp.services.installed' value= 1

*================================
*Sub added - Lt Dan
*================================
AddProducts:
$i=$total.new
$product=$new.products.array [$i]
while $i>0
$owp.add-> add product to factory or dock: $product
$c = $dock-> get amount of ware $product in cargo bay
skip if $c > 0
= $dock-> add 1 units of $product
dec $i
=wait 10 ms
end
endsub
*================================
return null
Yukari
Posts: 2
Joined: Tue, 10. Aug 21, 16:38
x3fl

Re: [SCRIPT] Orbital Weapon Platform Transport Service 1.1

Post by Yukari »

Sorry to necro this but, does anyone still have the files?
User avatar
alexalsp
Posts: 1896
Joined: Fri, 18. Jul 14, 05:28
x4

Re: [SCRIPT] Orbital Weapon Platform Transport Service 1.1

Post by alexalsp »

Yukari
Posts: 2
Joined: Tue, 10. Aug 21, 16:38
x3fl

Re: [SCRIPT] Orbital Weapon Platform Transport Service 1.1

Post by Yukari »

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