PHQ editing

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

Post Reply
ckx3009
Posts: 4
Joined: Mon, 30. Dec 13, 14:12

PHQ editing

Post by ckx3009 » Mon, 30. Dec 13, 14:23

Hi all,

I was trying to mod my PHQ in order to make it a bit more useful for me.
I need to add the various ship equipments (like softwares, jumpdrive and so on) and the ship upgrades (engine tuning, rudder optimization and cargo bay extension) in the same way they are distributed in an equipment dock owned by one of the other races.

I saw there are some mods that already do something similar but I was not able to find one that does exactly that.

So I was wandering if I can make the mod myself.
I was able to reduce the time taken by the ship building and RE, but now I need the rest.

I suppose that there is something like an XML which is used by the game to set the goods available at the equipment docks... but where are those XMLs? Which one do I need to use as example?


Thank you very much in advance!

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Mon, 30. Dec 13, 19:30

You can write a mod yourself. It takes time to figure out how to do everything, but once you figure it out then you should be good. To start with enable the in game script editor and then use it to look at some of the scripts in the game. Be careful not to change any of them, but if after looking at the scripting language if it doesn't scare you away from modding then download a copy of X-Studio and start writing scripts.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Mon, 30. Dec 13, 20:33

A joy of modding : killing marines and transporting them to distant black holes.

ckx3009
Posts: 4
Joined: Mon, 30. Dec 13, 14:12

Post by ckx3009 » Mon, 30. Dec 13, 21:59

I suppose it is not needed to write a script in order to add some goods to a station...
What I need is an example (XML or PCK) of an already functioning station, then I will take the data from that!

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Mon, 30. Dec 13, 22:16

You know that .xml and .pck are scripts ?

For example, in one line and the library from Cycrow "lib.cycrow.addware" (and the command "call script"), you can add any ware you want in any station you want.

Code: Select all

= [THIS] -> call script 'lib.cycrow.addware': StationType={StationType} Race=[Race] Ware={Ware} 

ckx3009
Posts: 4
Joined: Mon, 30. Dec 13, 14:12

Post by ckx3009 » Tue, 31. Dec 13, 00:03

ok...
but if I want simply to copy the goods from, for example, the terracorp HQ, where should I find the terracorp HQ files?
there should be "something" that says that the terracorp HQ will sell some goods in particular, right?

User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 » Tue, 31. Dec 13, 05:35

The wares that are used in factories are in a file called waretemplate.xml.
However it seems that you want to be able to get equipment from your PHQ. However you cannot add equipment for sale on any player owned station. The best that you could do is to spawn an allied station next to your PHQ and hen adding the needed equipment to that. The easiest way to do that would be to use Cycrows cheat script, but it can also be done manually using the script editor.

The scripts that you have seen that let you purchase equipment from player owned stations have all been using station commands and are not actually integrated into the trading menu.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

ckx3009
Posts: 4
Joined: Mon, 30. Dec 13, 14:12

Post by ckx3009 » Tue, 31. Dec 13, 22:13

Yes, I tried that solution and it looks the best one of easy implementation.

Not exactly what I was asking but the target is almost the same.

Thank you!

Raider480
Posts: 190
Joined: Fri, 30. Jul 10, 05:32
x4

Post by Raider480 » Thu, 2. Jan 14, 02:43

Try using Equipment Research and Development, it lets you add equipment pretty easily. Edit a couple of the scripts and you can reduce the time/costs. It doesn't use credits even by default, which is nice.
http://forum.egosoft.com/viewtopic.php?t=248959

Ware Blueprint Manager is good for producing random wares as needed.
http://forum.egosoft.com/viewtopic.php?t=276107

Player Workshops seems to be able to install tunings, and could be modified to do so for free.
http://forum.egosoft.com/viewtopic.php?t=244052

You would need to merge the changes between Ware Blueprint Manager's hq.xml and the updated hq.xml distributed with AP (which mainly features the new Terran PHQ) but that is fairly easy. Combine that with a massively increased cargo bay for the PHQ and you have versatility to be reckoned with! :wink:
ckx3009 wrote:What I need is an example (XML or PCK) of an already functioning station, then I will take the data from that!
If you were wanting a basic, working script for creating/adding products to a station:

Code: Select all

* Raider480
* 16 December 2013
$YBPPCSB1 = create station: type={Paranid Image Recognition Production Complex} owner=[Yaki] addto=[Senator's Badlands] x=47500 y=-6500 z=5000
$YBPPCSB1-> set name to 'Yaki Boarding Pod Production Complex alpha'
= $YBPPCSB1-> install 9 units of {1 GJ Shield}
* Products
$YBPPCSB1-> add product to factory or dock: {Boarding Pod}
* Primary Resources
= $YBPPCSB1-> uses ware {Energy Cells} as primary resource
$YBPPCSB1-> add primary resource to factory: {Energy Cells}
= $YBPPCSB1-> uses ware {Space Fuel} as primary resource
$YBPPCSB1-> add primary resource to factory: {Space Fuel}
= $YBPPCSB1-> uses ware {Ore} as primary resource
$YBPPCSB1-> add primary resource to factory: {Ore}
* Secondary Resources
$Secondary01 = $YBPPCSB1-> uses ware {Cloth Rimes} as secondary resource
$YBPPCSB1-> add second resource to factory: {Cloth Rimes}
$Secondary02 = $YBPPCSB1-> uses ware {Warheads} as secondary resource
$YBPPCSB1-> add second resource to factory: {Warheads}
* Finish
$YBPPCSB1-> station trade and production tasks: on=[TRUE]
$YBPPCSB1-> add money: 50000000
set global variable: name='YBPPCSB1.Exist' value=$YBPPCSB1
return null
I could post the XML version, but it's really messy. This was made with the exscriptor and the in-game editor.

Post Reply

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