Beginners scripting tutorial (Page 5 of 5)

Written by Roguey,

Beginners Scripting tutorial, written by Roguey


Adding default wares

Okies, we are nearly done now. We just want to add some equiptment to our ship. The create ship command will summon a Titan however it will have nothing installed in it. I dont know about you, but id like some shields and weapons installed on it - looking for them might take awhile.

So in our script scroll down to <New Line> once again and press enter to get the command list up once more.

The command list inside the script editor

This time we want Trade commands, then inside there we want for ships (it will be the first one). We are then shown a list of trade commands for ships. We want add default items to ship (just over half way), shown below:

<RefObj> add default items to ship

What this command does is add shields, lasers, missiles and upgrades to a ship. Sounds good eh? Well add it to our code by pressing enter. Another select input list will come up, this time select (under available variables) ship. We should be back at our 3 lines of script. It should look something like this:

Our finished create ship script

The script is now complete. The first line finds out which sector we are in the universe, the second creates a Titan in the same sector which is owned by us and the third equips the ship. We now need to save our ship, so press escape. A box should come up asking us if we want to save our script. If you press no by accident there is no undo or recover. So make sure you select yes.

Running our new script

Once we have saved our script, it will appear in the script list. You will need to scroll down to it and have it select like so:

Myship script

Our script wont do anything without being ran. I dont know about you, but I want my Titan! So to run the script (make sure its selected) press r. We will be asked for input, like so:

Running my script

We dont need to worry about this, so just press enter once again. We will be given a summary of how this script will be ran. Which should look like this:

The run summary

Again we dont need to worry about this, so just press enter once more. We should now return back to the script list. We should now have a new Argon Titan waiting for us in the same sector. So keep pressing escape and get back to the game. Now check your sector map and you should find yourself with a brand new, fully equipped Argon Titan. Not bad eh?

Our new Argon Titan

I know this wasnt the simplest script to start with, however its probably the most useful script. If you start to make mods, then this script will be very useful for testing out new ships. Anyway I hope that as helped you get started with scripting in X3 and/or Terran Conflict.

Next: End of guide
<< Previous Page