[Tutorial]Add ware to station

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

User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

[Tutorial]Add ware to station

Post by LV »

This tutorial will allow you to add any ship/station/ware to any station you define.

There are two template scripts

setup.add.to.station.template

This script will run every time the game is loaded and calls plugin.add.ship.ware.to.station where the ware you want to add is handled


[ external image ]

Cycrow Installer Version


[ external image ]

----------------------------------------------------------------------------------
All you need to do to use these templates is put them in your script dir and go into the SE when you scroll through the list and come to either of these script simply press 'c' to copy and a pop up will come up to copy the script and rename it to your own definitions.





setup.add.to.station.template explained

there are two variables needed in this script

switch -> this is a numerical value that is passed to the other script, If you set it to 1 it will install the ware to the defined station. If you set it to 2 it removes the defined ware

race although you can handle the race you want to install to via the called script you can also do it via the setup

examples

Code: Select all

011 @ = [THIS] -> call script 'plugin.add.ship.ware.to.station' :  switch=1  race=Argon
012   
013   = [THIS] -> call script plugin.add.ship.ware.to.station :  switch=1  race=Boron
This will add to both the argon and boron

Code: Select all

011 @ = [THIS] -> call script 'plugin.add.ship.ware.to.station' :  switch=2  race=Argon
012   
013   = [THIS] -> call script plugin.add.ship.ware.to.station :  switch=2  race=Boron
this removes from both races

simple press 'c' to copy the script call and 'v' to paste to add more races.


----------------------------------------------------------------------

plugin.add.ship.ware.to.station explained

this is the called script which handles where the ware is going

the most important part is this: -

Code: Select all

030   $stations =  get station array: of race $race class/type=Big Shipyard
this will return to an array all shipyards of the defined race, you can toggle the class/type to individual station type or docks (trade &EQD) etc.

once you have set the class of station to install to the array in the script will handle the rest.


---------------------

I've also added at the bottom of the script code to loop through races if you want to add it to more than one (although you can simply add to more races via the setup script instructions above.

the code for looping is commented out by default.

---------------------------------------------

view the script code

http://www.arcl07.dsl.pipex.com/x3tc/pl ... mplate.xml

http://www.arcl07.dsl.pipex.com/x3tc/pl ... tation.xml
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
baroni
Posts: 12
Joined: Sat, 19. Apr 08, 18:37

Post by baroni »

LV, thank you very much for this tutorial. I was looking for it all this weekend. Before I found info adding ships but only for experienced modders (for me it was "black magic" :) ). Now i know what to do :)
mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren »

LV

Nice Script :)

MarCon
Last edited by mark_a_condren on Sun, 14. Mar 10, 18:19, edited 1 time in total.
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

:roll:

fixed, redownload
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
baroni
Posts: 12
Joined: Sat, 19. Apr 08, 18:37

Post by baroni »

I have got next problem: Sometimes my ship is added to shipyard in 1 wariant and sometimes in 3 wariants.
For example, I added new M7 (Deimos Raider) to Paranid Shipyard and it works fine.
But when I added (using copy of the same script) new M3+ (Eclipse Sentinel) to Argon Shipyard, I noticed that I can buy 3 wariants : "Eclipse Sentinel S", "Eclipse Sentinel M", "Eclipse Sentinel L"

What thing is responsible for showing ships in 1 (or 3) wariants?
baroni
Posts: 12
Joined: Sat, 19. Apr 08, 18:37

Post by baroni »

Could you tell me how to add new Ware to new Blueprints?

For example:
1. I created my new laser - Tachyon Accelerated Gun (TAG)
2. Then I created my new factory to produce it - Tachyon Accelerated Gun Forge (TAG-F)
3. Then I added my new factory (TAG-F) to Otas Shipyard (it is visible as buyable blueprint)
4. Then I wanted to add my new gun (TAG) as product of TAG-F - it only works with exiting factory (via LV script) - It does not want to affect to Blueprints at shipyard (before building).

Hereby my question: How to add new product to blueprints?
Alan Phipps
Moderator (English)
Moderator (English)
Posts: 31646
Joined: Fri, 16. Apr 04, 19:21
x4

Post by Alan Phipps »

@ baroni: Regarding your last but one post, that is because in vanilla M3 and below (and TS etc) sell at shipyards in different buyable formats with varying shields and guns (S, M, L) while M6 and above do not. The variations are just in how the baseline ship is equipped when sold and are not true ship variants.
lordofpie7000
Posts: 117
Joined: Fri, 5. Jun 09, 05:45
x4

Post by lordofpie7000 »

so in theory you could add a shipyard to a shipyard correct?
User avatar
BlueBerry SheWolf
Posts: 65
Joined: Tue, 19. Jan 10, 14:07
x3tc

Add ware

Post by BlueBerry SheWolf »

Hi
First I would like to apologize for my English.

I created the new factory plantation of the hop, new goods the hop . I created the new factory produce beer and new goods the beer. The factory and goods they are exist in the game only that I have readtext and in factories I have wheat and energy cells. Why ? what did I do wrong ? Should be hop and Beer as well.
How add the goods the hop to the plantation of the hop ? how at add goods to the game. I will be grateful for any help.

Best Regards
Jagoda
cascadestar
Posts: 3
Joined: Tue, 21. Jun 11, 06:27

Post by cascadestar »

Sorry to put this but I am a noob and I need help. Where it say [THIS]->jnkjnfakjnfw and its the script that it is linked too. How do you change the jnkjnfakjnfw part so it matches the file that you created from the template?
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

if you mean the edited template script you copied and pasted to make your own then just click enter in the script part of that code and it will bring up the entire list of scripts ingame that can be run, yours will be in that list unless you have cocked something up
cascadestar
Posts: 3
Joined: Tue, 21. Jun 11, 06:27

Post by cascadestar »

ok, I know how to change it to the script i want but I dont know how to do the script and exactly what I need to change.

I want to add say a camo device to the Boron Equipment dock in Lucky Planets. And also want to add a ship.

How do I do that... I have changed what you have said to change but then I get into the details and I mess up some where... Could you show me exactly which things I would need to change.
cascadestar
Posts: 3
Joined: Tue, 21. Jun 11, 06:27

Post by cascadestar »

So what I am saying is where do you replace to tell the script what you want and defined Number of what you want without messing up the script. That is what is confsing me.

I dont know what to change to make it go to placing wares instead of ships and then if it does have that done, where to make it have the set number of wares.

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