Script Editor

From Argonopedia
Jump to: navigation, search

The Script Editor is a programme built into the X games from X2 onwards, which allows one to create and edit scripts. To activate it, change your pilot name to Thereshallbewings and a new Script Editor option will appear in your ship's command console.

For information: Please note that the script editor is a very powerful tool with the ability to change necessary files of the game. The game's own scripts (so the ones which haven't been added afterwards by downloading a script or creating them on your own) have a '!' at the beginning. It is not recommended to edit them, especially if you are not an experienced scripter. Editing them can make your game better - but it can also end up in a whole mess if your editing goes wrong. So better create your own scripts for testing instead of using necessary ones of the game.

Basic controls and actions

After opening the script editor from your ship's command console, you will see a window with several options in it. Most of them are meant for the more experienced users, so we won't go into detail with them.
However, the most interesting option for getting started is the one called 'Script Editor'.
This will open up the script list. Please note that the most imporant scripts of the game are not visible in this list. For editing them, use an external editor.
A good script to start is the script called galaxy.example.init.playership. It has some commands in it and should be quite easy to understand. Most important is, that it is not necessary for the game and it resets everytime you close the game.
Use the up and down keys to select it, then press the 'enter'-key to open the code.
You will notice that the code has several different colors. Their meanings are listed below:

  • grey: Comment, this line is ignored by the script engine. This is meant for explaining passages, which will be necessary in more complex scripts
  • white: Hard-Code of the script commands. You can not edit this.
  • green: The parameters of the script code. These are the things you can edit.
  • yellow: Marks the hard-code of the line you currently selected
  • red: Marks the parameter you have currently selected. By pressing 'enter' you can edit the parameter.

Use left, right, up and down keys to select the line and parameter you want to edit. By pressing ',' and '.' you can change script code into a comment or - if possible - change a comment into script code.

If you have finished editing, use 'ESC' to get back to the script list. There will be a message popping up asking you if you want to save the script. If you did something wrong, the internal debugger will step in and tell you if you e.g. left a parameter undefined.

To finally run your script, select it in the script list, press 'r' and then hit 'enter' twice.

Personal tools
Namespaces
Variants
Actions
Navigation
Games
Toolbox
Partners