Creating Wares to Use In Scripts

 

There are 3 methods to creating wares.

  1. Using standard built in wares
  2. Using the EMP mod to add new wares to use
  3. Using the Plugin Manager Custom Wares Feature.

Using wares in scripts

Add Ware Libaray Script

Keep Stock Libarary Script

 

Picking which method to use

Each method has its avtanges and disadvantages.

Standard Wares

The standard built in wares have a limited number so can cause conflicts with other scripts, they also have fixed price and notority which cant be changed. But they dont required any extra mod or program to install so all you need is a script, they also show up in the Ships Extensions list unlike the other methods. They can also be used in signed scripts as they dont require anything extra. Like other ship extensions, ships can only install 1 of each type, and the stations are always kept stocked up as they dont have a volumn.

EMP

EMP is a mod that adds more wares to the game, to use it you need to have the mod installed, and any users of your script also needs the mod installed. Like the standard wares, you can also not edit the price and notority but there is alot more selection available so less chance of conflicts with other scripts, however it is still limited as you cant select the exact price. All EMP wares are displayed as normal wares with a volumn of 1. Unlike Standard wares, you can have multiple wares in the same ship but can still be used like ship extensions if you wish. You also have to manually keep the stock levels up as they act like wares in factories.

Custom Wares

Custom wares is a new feature available in the plugin manager to add new wares into the game, scripts must be created by the plugin manager for the custom wares to work. Unlike the other methods you can set the price, size, volum, cargo class and notority to what ever you want, allowing you to customise wares how you like them. You can aslo create wares of different types, the other 2 methods only create "tech" wares. Like EMP, scripts using custom wares cant be used as signed scripts and show in the frieight bay as wares and not ship extensions and also has to be stocked up in the stations. However, you have to access the wares differently in scripts than in the other methods, you use the supplied scripts to get the ware object isntead of using it directly.

 

Method 1. Using standard built in wares

There are several built in wares for scripters to use, these wares are used for ship extensions only and are displayed in the extensions section of your freight list.

The main problems with using the built in wares is that there is a limited number so can cause conflicts with other scripts that use the same ware slot. Also you are limited to the price of the ware as you cant change it.

These are the available slots:

28;0;0;0;0;59;5753;0;35714;1;1;0;35714;-100000;0;0;SS_WARE_SW_NEW1; 1,002,677 credits
28;0;0;0;0;60;5763;0;17;1;1;0;17;-100000;0;0;SS_WARE_SW_NEW2; 477 credits
28;0;0;0;0;61;5773;0;14;1;1;0;14;-100000;0;0;SS_WARE_SW_NEW3; 393 credits
28;0;0;0;0;62;5783;0;56;1;1;0;56;-100000;0;0;SS_WARE_SW_NEW4; 1572 credits
28;0;0;0;0;63;5793;0;88;1;1;0;88;-100000;0;0;SS_WARE_SW_NEW5; 2470 credits
28;0;0;0;0;64;5803;0;283;1;1;0;283;-100000;0;0;SS_WARE_SW_NEW6; 7945 credits
28;0;0;0;0;65;5813;0;383;1;1;0;383;-100000;0;0;SS_WARE_SW_NEW7; 10752 credits
28;0;0;0;0;66;5823;0;1389;1;1;0;1389;-100000;1043;0;SS_WARE_SW_NEW8; 38,996 credits
28;0;0;0;0;67;5833;0;3396;1;1;0;3396;-100000;0;0;SS_WARE_SW_NEW9; 95,343 credits
28;0;0;0;0;68;5843;0;4215;1;1;0;4215;-100000;0;0;SS_WARE_SW_NEW10; 118,336 credits
28;0;0;0;0;69;5853;0;5635;1;1;0;5635;-100000;0;0;SS_WARE_SW_NEW11; 158,203 credits
28;0;0;0;0;70;5863;0;65735;1;1;0;65735;-100000;0;0;SS_WARE_SW_NEW12; 1,845,522 credits
28;0;0;0;0;71;5873;0;17857;1;1;0;17857;333;1043;0;SS_WARE_SW_NEW13; 501,338 credits
28;0;0;0;0;72;5883;0;21428;1;1;0;21428;0;0;0;SS_WARE_SW_NEW14; 601,595 credits
28;0;0;0;0;73;5893;0;324515;1;1;0;324515;-100000;0;0;SS_WARE_SW_NEW15; 9,110,822 credits
28;0;0;0;0;74;5903;0;638508;1;1;0;638508;-100000;0;0;SS_WARE_SW_NEW16; 17,926,236 credits
28;0;0;0;0;75;5913;0;225755;1;1;0;225755;-100000;0;0;SS_WARE_SW_NEW17; 6,338,115 credits
28;0;0;0;0;76;5923;0;1931535;1;1;0;1931535;1000;0;0;SS_WARE_SW_NEW18; 54,228,222 credits
28;0;0;0;0;77;5933;0;2209150;1;1;0;2209150;-100000;0;0;SS_WARE_SW_NEW19; 62,022,317 credits
28;0;0;0;0;78;5943;0;6727565;1;1;0;6727565;-100000;0;0;SS_WARE_SW_NEW20; 188,877,701 credits

You need to pick one which is closest the the price you wish to use, the price is listed at the end of each line. To check the availability of the wares goto the Community Scripts Sticky on the Egosoft forums, in the second post you will find the list of wares and which scripts currently use them.

If you look at the line you choose you can get various information for the ware you plan to use.

28;0;0;0;0;59;5753;0;35714;1;1;0;35714;-100000;0;0;SS_WARE_SW_NEW1; 1,002,677 credits

For this ware, the price is 1,002,677 credits, you can also find out the price roughtly by multiplying the first and ninth entries together, 28 and 35714.

The Seventh entry is the Text ID, 5753, you will need this when adding the ware. And finally the 14th entry, -100000, is the notority required to buy the ware.

 

Once you've chosen the ware to use you then need to create the text entry for the ware, The id you found previously, ie 5753 is the one to use to create this. Create a text file in the language you wish and create page 17. You then need to entries, the first is the ware name, the second is the wares description, the description ID is the next id from the ware, wares usually end in 3, and descriptions end in 4.

<?xml version="1.0" encoding="UTF-8" ?>
<language id="44">
<page id="17" title="wares" descr="0">
<t id="5753">My Ware</t>
<t id="5754">My Wares Description</t>
</page>
</language>

Method 2. Using the EMP mod to add new wares to use.

EMP is a community developed mod that adds new wares to use in the game, this was made because of the limit of the standard wares. Like the standard wares however, you cant change the price or anything, so you have to pick the closest to what you want.

First you need to get EMP from either the Main Forum Page, or downloading the SPK Version.

With the mod package, there is a text file which list all the wares, ignore the first entries till you get to the groups that end with SS_WARE_SW_CUSTOM. All of these are the custom wares. They are seperated into groups, each group is simlar to the standard wares with different notority values, and the Ware id, the last entry on each line, has 2 numbers at the end, ie SS_WARE_SW_CUSTOM1_1, the first is the ware in the group, which is equivilent to the standard ware and the 2nd is the group number.

28;0;0;0;0;81;10053;0;35714;1;1;0;35714;-10000;0;0;SS_WARE_SW_CUSTOM1_1;

To find the price, you can multiple the first value, 28, by 9th value. 35714. The 14th entry, -10000 is the notoriety, each group usually has the same notority. So to find the ware you wish to use, first pick which notority group to use, then pick the entry in the group to match what price you wish to use.

You can check if other scripts use it by viewing the EMP Forum page, on the second page is a list of wares that are currently used, the sixth entry in the ware is the ware id number, 81, this is what is displayed on the EMP page to check if its being used. The next entry is the text id, 10053, you use this to create the text entry.

Once you've chosen the ware to use you then need to create the text entry for the ware, The id you found previously, ie 10053 is the one to use to create this. Create a text file in the language you wish and create page 17. You then need to entries, the first is the ware name, the second is the wares description, the description ID is the next id from the ware, wares usually end in 3, and descriptions end in 4.

<?xml version="1.0" encoding="UTF-8" ?>
<language id="44">
<page id="17" title="wares" descr="0">
<t id="10053">My Ware</t>
<t id="10054">My Wares Description</t>
</page>
</language>

Method 3. Using the Plugin Manager Custom Wares Feature.

To create a custom ware, you need to use the Script Packager and goto the Wares tab.

Custom Ware

Right click in the first list to get the menu and goto "Add Ware".

Add Ware

The Ware ID is needed in scripts to get access to the ware you need to use, for more information, view the help page.

You also need to add the text for the language(s) you wish to use, this is how it will be displayed in game.

To use these ares in the game, you must use the getware script that comes with the Plugin Manager, its called plugin.scriptmanager.getware, it takes 1 argument, which is the Ware ID you used in the Script Packager, ie SS_WARE_CY_MYWARE.

The format or name for the ID doesn't really matter, however i would suggest putting you name or initial somewhere in the id, which will prevent someone else from using the same id. IE if 2 scripts make an afterburner script, they might both use SS_WARE_AFTERBURN, which will cause a conflict, so if you put your name in there, then both scripters will have a different id, SS_WARE_CY_AFTERBURN.

 

Using wares in scripts.

Once you've created the wares to use previously, they will already be in the game ready to use. But usually, you would want to make the buyable in the universe, you do this by adding them to stations like Equipment docks or Trading Stations.

To add the ware for sale, there is a single command to use, it runs on the station object to add to, its found in the General Object Commands menu.

Add Product

The first entry is the object for the station, you will need to find this object first before you can add the product.

You can do this in several ways, to keep it simple, this will just use an argument.

Station Argument

The final value is the product/ware to add.

If you're using either Standard Wares or EMP, then you just select it from the ware list, first goto the bottom and choose "Select Ware" to bring up the wares list. (For Custom Wares, Skip to here)

Select Ware

Then select the ware that you added, the name will be what you put in your text file. NOTE, you have to make sure u've loaded the text file first otherwise it wont display correctly.

Ware List

Now the command is done, you can run the script and select the station and you want to add too.

Ware Added

 

To use custom wares, you have to do it slightly differently, you need to use the getware script before the command you added, you will need to insert a new line above, just press the insert key on the current command to insert a new line above.

New Line

Now you need to add the call script command, its found in the General Command menu, under the sub menu for Script Calls.

Script Call

Then select the script to call, you need to use the get ware script, plugin.scriptmanager.getware.

Select Script

This will add the call script command, the first argument is the return value from the script, for the getware script, this returns the ware object.

Call Script

Set this to a varible for the ware object, ie ware

Return Value

The next argument is the object to run the script on, this script doesn't need to be run on an object, this [THIS] is fine. The final argument is the name of the Ware, this is the Ware ID you added in the Script Packager. You need to select a String value.

String

Then enter the Ware ID for your ware, ie SS_WARE_CY_MYWARE.

Ware String

Ware String

Finally you need to use the ware varible to add to a product, change the add product command to use the varible instead of the ware directly.

Finished

 

An extra check you can add in, and i strongly advice that you do, is to make sure the ware is valid, If you run the script and the ware hasn't been installed by the Plugin Manager, it will return "null" so you can check for this, if its null, then you need to skip the command. You can use an if statement block or the skip command on the ware object

Skip If

This will make the script skip the add command if $ware is not valid.

 

Add Ware Library Script

I have created some library scripts which you might find useful, one is called lib.cycrow.add.ware. There is also once called lib.cy.add.ware which is available in the bonus pack, its the same as the other just a signed version. These scripts are used to add a ware to a set of stations. IE you can add your ware to all Argon Equipment Docks in the universe.

To use the script you first need to Download it From Here then unpack it to the scripts directory in X3.

Then you use the "Call Script" command for that script.

Add Ware

There doesn't need any return varible and doesn't matter what object its run on so you jsut have to set the arguments.

Add Ware Script

The first Argument is the station type, this is the type of stations you wish to add it to.

Equipment Docks

Select Race

The Next Argument is the race of the station, Setting it to Argon will cause it to add the equipment to all Argon stations that match the station type.

Product

The final argument is the ware itself, choose the ware from the list.

Product

 

Keepstock Libarary Script

This script is used to keep the stock of a ware topped up, so you can make sure the stations allways have stock for your wares. This is not required for the standard wares as they never run out But for EMP or custom wares you might want the stock always available.

Just download from here and unpack it to the scripts directory in X3.

There are 4 scripts in the package.

lib.cycrow.keepstock This script does the actual stocking up of the scripts
lib.cycrow.keepstock.add This adds a ware to the list of wares to keep stocked
lib.cycrow.keepstock.remove This removes the ware from the list
lib.cycrow.keepstock.perm This is the script that runs permanantly, to keep all wares stocked up

The only 2 you need to use is the lib.cycrow.keepstock.add and lib.cycrow.keepstock.remove. The other 2 are used in the other scripts.

Use the add script to add your ware to the list, once added the scripts will take care of the rest.

Keep Stock

The first argument is the Ware Itself.

Station Type

Next is the station type, this should be the same type that you add the wares to the in first place.

Race

Next is the race who owns the station, this should be the same race you added the ware too.

Amount

Finally is the amount you wish to be in the station, ie setting it to 1 will make sure theres always 1 item in the station available to buy.

 


<< Prev (using Arguments)
Next (Creating Hotkeys) >>