Adding wares with script editor, can you help me.
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Adding wares with script editor, can you help me.
Sorry, the editor isn't my thing but I'm trying to learn the game still.
I was trying to create a script that put ammunition in my cargo bay because I like hanging around Argon Prime and Aldrin is the only place to get M/AM warheads.
I made a script like this
=[PLAYERSHIP] -> Load 1 units of Matter/Anti Matter Warheads
return null
Trying to run the script, however, did absolutely nothing. I checked my freight for the items and they were not there.
Is the script wrong?
I was trying to create a script that put ammunition in my cargo bay because I like hanging around Argon Prime and Aldrin is the only place to get M/AM warheads.
I made a script like this
=[PLAYERSHIP] -> Load 1 units of Matter/Anti Matter Warheads
return null
Trying to run the script, however, did absolutely nothing. I checked my freight for the items and they were not there.
Is the script wrong?
Try Add units of ware instead of Load. Load is normally for moving wares from homebase into a trading ship before going off to sell them.
Add - spawn wares in the cargobay
Install - spawn wares in cargobay and install them. Handy for equipping spawned ships with shields and lasers.
Load - move wares from station into ship
Unload - move wares from ship to station
Buy - move wares from station to ship, subtract money from homebase or player, add money to station
Sell - move wares from ship to station, add money to homebase or player, subtract money from station
Add - spawn wares in the cargobay
Install - spawn wares in cargobay and install them. Handy for equipping spawned ships with shields and lasers.
Load - move wares from station into ship
Unload - move wares from ship to station
Buy - move wares from station to ship, subtract money from homebase or player, add money to station
Sell - move wares from ship to station, add money to homebase or player, subtract money from station
Last edited by Shimrod on Sun, 27. Apr 14, 23:21, edited 1 time in total.
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
The command you are looking for is "add <n> units of <ware> into cargo bay".
The MSCI Programmer's Handbook is very easy to read, for a technical manual.
That said, Shimrod's Replication script does what you want, and more.
The MSCI Programmer's Handbook is very easy to read, for a technical manual.
That said, Shimrod's Replication script does what you want, and more.
Last edited by DrBullwinkle on Sun, 27. Apr 14, 23:46, edited 1 time in total.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Technically it can be done. However, the process is prone to trouble.
Better to use the Plugin Manager. It has the most reliable implementation of EMP currently available. (Other than maybe XRM's built-in EMP).
Better to use the Plugin Manager. It has the most reliable implementation of EMP currently available. (Other than maybe XRM's built-in EMP).
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
It needs either plugin manager or XRM which install the EMP-X mod that adds custom ware slots scripters can easily override.
Unfortunately I found XTC only implements EMP not EMP-X so it doesn't work on that. I've got local changes to make it fall back to overriding a terran high tech goods ware if the primary ware isn't found. Not ideal stats but it at least allows the script to work with vanilla and XTC. Not sure whether to upload that, probably will.
Unfortunately I found XTC only implements EMP not EMP-X so it doesn't work on that. I've got local changes to make it fall back to overriding a terran high tech goods ware if the primary ware isn't found. Not ideal stats but it at least allows the script to work with vanilla and XTC. Not sure whether to upload that, probably will.
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Yeah, that is what I have been doing with EMP-related scripts: test the name of the installed ware; if it fails then use a vanilla ware. I see that you already have the test for the name, so it would be a cinch to add the fallback ware.Shimrod wrote:I've got local changes to make it fall back to overriding a terran high tech goods ware if the primary ware isn't found.
As you say, it is not perfect. But the technique works for players who do not use the PM or XRM for whatever reason (including Mac and linux players). And it does not detract from the intended ware for players who do have a proper EMP environment.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Unfortunately, no. However, it is easy to change cargo bay size with X3 Editor 2.Vamisk wrote:I don't suppose there's a command that would let me expand my cargo bay slightly?
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Isn't that what a Spitfyre is for?
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
I see... you are making enemies? Then you will love X3Editor.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
To handle all possible conditions:
1) Close X3Editor and Plugin Manager.
2) Back up your entire X3 folder. Just in case you ever need to revert to previous files.
3) Open the Plugin Manager (to remove its merged files).
4) Open X3Editor. Make sure that your X3Editor profile is set up correctly, including which game you play.
5) Open from VFS to get the correct file that the game will use.
6) Double-check the path to the file in the X3Editor title bar.
7) Obviously, save when done editing.
8 ) Close the Plugin Manager (to allow it to rebuild its merged files.)
There are some videos demonstrating the above (and more) in the Ship Tricks tutorials in my sig. The tutorial about File Precedence will explain why there are multiple versions of files and which one is used by the game.
1) Close X3Editor and Plugin Manager.
2) Back up your entire X3 folder. Just in case you ever need to revert to previous files.
3) Open the Plugin Manager (to remove its merged files).
4) Open X3Editor. Make sure that your X3Editor profile is set up correctly, including which game you play.
5) Open from VFS to get the correct file that the game will use.
6) Double-check the path to the file in the X3Editor title bar.
7) Obviously, save when done editing.
8 ) Close the Plugin Manager (to allow it to rebuild its merged files.)
There are some videos demonstrating the above (and more) in the Ship Tricks tutorials in my sig. The tutorial about File Precedence will explain why there are multiple versions of files and which one is used by the game.
- (The steps with the Plugin Manager (PM) are only necessary if you merge anything. Examples are .xsp ships, or EMP if you are editing TWareT. If you are only editing TShips (and have no .xsp ships installed), then you can safely skip the PM steps. )
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
You are looking at the TCockpits file, which includes all cockpits, for all ships, in the left-hand panel.
Compatible lasers for the default cockpit (which are the main guns) are shown in the "Compatible guns" tab of the TShips entry for the Carrack.
For other turrets, you will want to reference the Turrets tab of the TShips entry, which shows that the Carrack turrets use the following cockpits:
SS_COCKPIT_T_REAR_M7 (Rear)
SS_COCKPIT_A_RILE_M7 (Sides)
SS_COCKPIT_A_UPDO_M7 (Top and Bottom)
So you will only edit the above three cockpits in TCockpits.
Compatible lasers for the default cockpit (which are the main guns) are shown in the "Compatible guns" tab of the TShips entry for the Carrack.
For other turrets, you will want to reference the Turrets tab of the TShips entry, which shows that the Carrack turrets use the following cockpits:
SS_COCKPIT_T_REAR_M7 (Rear)
SS_COCKPIT_A_RILE_M7 (Sides)
SS_COCKPIT_A_UPDO_M7 (Top and Bottom)
So you will only edit the above three cockpits in TCockpits.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)