Adding wares with script editor, can you help me.

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
Vamisk
Posts: 9
Joined: Sun, 27. Apr 14, 22:06

Adding wares with script editor, can you help me.

Post by Vamisk » Sun, 27. Apr 14, 22:16

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?

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Sun, 27. Apr 14, 23:17

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
Last edited by Shimrod on Sun, 27. Apr 14, 23:21, edited 1 time in total.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 27. Apr 14, 23:21

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.
Last edited by DrBullwinkle on Sun, 27. Apr 14, 23:46, edited 1 time in total.

Vamisk
Posts: 9
Joined: Sun, 27. Apr 14, 22:06

Post by Vamisk » Sun, 27. Apr 14, 23:52

I found the command and it was successful, thanks for your help.
About this replicator mod. Can i use it without XRM and this plugin manager?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 27. Apr 14, 23:54

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).

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Mon, 28. Apr 14, 00:26

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.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 28. Apr 14, 00:34

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.
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.

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.

:thumb_up:

Vamisk
Posts: 9
Joined: Sun, 27. Apr 14, 22:06

Post by Vamisk » Mon, 28. Apr 14, 00:37

Alright. I'm going to use this replicator. One less tedious thing to worry about. It works for X3AP?
I don't suppose there's a command that would let me expand my cargo bay slightly?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 28. Apr 14, 00:40

Vamisk wrote:I don't suppose there's a command that would let me expand my cargo bay slightly?
Unfortunately, no. However, it is easy to change cargo bay size with X3 Editor 2.

Vamisk
Posts: 9
Joined: Sun, 27. Apr 14, 22:06

Post by Vamisk » Mon, 28. Apr 14, 00:44

Thanks.
Maybe i should just let things be.
Maybe #deca deaf doesn't need 6 prototype matter/anti matter launchers.
Sounds pretty overpowered but i like the concept of a glass cannon.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 28. Apr 14, 00:47

Isn't that what a Spitfyre is for?

Vamisk
Posts: 9
Joined: Sun, 27. Apr 14, 22:06

Post by Vamisk » Mon, 28. Apr 14, 00:52

Yeah but i mean....the Spitfyre isn't a dormant, man killing drone.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 28. Apr 14, 00:53

I see... you are making enemies? Then you will love X3Editor.

Vamisk
Posts: 9
Joined: Sun, 27. Apr 14, 22:06

Post by Vamisk » Mon, 28. Apr 14, 00:56

I'm downloading it now, thanks for the link by the way.

Vamisk
Posts: 9
Joined: Sun, 27. Apr 14, 22:06

Post by Vamisk » Mon, 28. Apr 14, 06:08

Sorry for double post, I've tried editing the cargo size with x3 editor but the changes won't "stick".
Is there something else i have to do?

EDIT:Nevermind i found out i was modifying TC files and not AP.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 28. Apr 14, 06:40

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.
  • (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. )

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 4. May 14, 04:56

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.

Post Reply

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