l i v e c o d e

STS/MLXEditor 2.0
Revolution stack / Donationware

Minimum Requirements
Downloadable Items
What is STS/MLXEditor?
STS/MLXEditor is a collaboration between Sons of Thunder Software and MindLube Games to provide the ability to use an external text editing application for script editing instead of Revolution's built-in script editor.

The STS/MLXEditor provides the ability to use an external text editor for script eidting purposes, rather than using the internal Script Editor in Revolution. It does this by intercepting editScript messages in the IDE (see Editing Process below), and then sending it to the editor of your choice. When activated, the external editor will be launched by all of the usual script editing methods:

  • Command-Option keypress
  • contextual menu in the application overview
  • contextual menu in the property inspector
  • the "Object" menu's edit script items
  • typing "edit the script of <obj>" in the message box
How Do I Install STS/MLXEditor?
Simply put the stsMLXEditor.rev file into the Plugins folder of your Revolution folder structure, and relaunch Revolution. It should automatically load and display the main window:

Stsmlx1

How Do I Use STS/MLXEditor?
Before using STS/MLXEditor, you must first select a text editor to use, and have the appropriate Transcript commands defined for launching your selected text editor. If you select an editor from the popup menu, the commands for running that editor will automatically be inserted into the commands field. If you have some other editor you would like to use, select "Custom" from the popup menu and enter the Transcript commands to launch that editor. You can click the "Test" button to determine if your editor launches properly (you should see the script of the Test button itself displaying in your selected editor of choice).

Transcript Commands

The Transcript commands can be any valid command lines that work in Revolution, with the exception that you must include a %s placeholder to take the place of the temporary file that is used to pass the script off to the editor (see Editing Process, below); this placeholder will be replaced when the script is edited.

Minimizing

Once you have set everything the way you want, click the Minimize button and it will minimize to a small floating palette that lets you return to the larger window (click the button), and activate/deactivate STS/MLXEditor by clicking the checkbox. You can also choose to have it start up in a minimized state by clicking the "Start up in minimized state" checkbox.
Editing Process
  1. When an editScript message is sent, STS/MLXEditor intercepts it, and gets the control's id and script, and writes it out to a temporary file.
  2. It launches your text editor on the temp file, and keeps track of the object's id, the filename, and file's last modified time. This a "watched file".
  3. It periodically wakes up from idle and checks each of it's "watched file" to see if they have been edited (saved). If not, STS/MLXEditor goes back to sleep.
  4. When a modified file is found, it maps the filename back into a long control id and sets the script property of the object with the contents of the file.
  5. If any errors occur from setting the script property, the standard exception dialog used by the IDE will appear with the script error, just like when using the built-in editor. One difference between this and the built-in editor is that normally we can't jump to a specific line number and code chunk like the built-in editor can. Certain editors (like TextMate) provide a mechanism to allow this to happen, but at this point, anything like this would need to be hard-coded into STS/MLXEditor.
Interaction Between the External Editor and IDE Editor
  • The external editor will not open a script if the IDE script editor window is open. This is to avoid synchronization problems and accidental overwrites by having them both open at the same time. Please be aware of this and take caution not to edit the same script with both editors, at the same time.
  • However, you can temporarily disable the MLXEditor action by holding down the SHIFT key while issuing a script edit command (by mouse or keyboard). By holding down SHIFT, STS/MLXEditor will pass the scriptEdit command and normal IDE editing will occur. When the IDE script editor appears, let go of the SHIFT key.
Debugger Interaction
Of course you cannot use an external editor to debug a script (not enough interactivity), so the STS/MLXEditor will automatically use the built-in debugger for debugging and will NOT launch your selected text editor.

Of course, you can always set breakpoints in a script that is open in the text editor by using the "breakpoint" keyword; you just can't set them by clicking in the margins like you can in the built-in script editor.

Transcript Modules
Although you can use ANY text editor with STS/MLXEditor and Revolution, several editors include the ability to extend their support for other languages, allowing one to provide colorization rules, parsing of data, identifying function or handler names, etc. The modules below have been developed for supporting text editor applications:

Text Editor Module Created By Features
BBEdit
BBEdit
7.1.4 or higher
Macintosh
Trevor DeVore


Last updated:
2008-05-11
Populates the Function Popup with commands, functions, getProp and setProp handlers in the current document
Syntax coloring for all Revolution commands, functions, control statements, comment blocks
NOTE: This includes modules for both PowerPC and Intel Macs
SubEthaEdit
SubEthaEdit
2.2 or higher
Macintosh
Christian Langers


Last updated:
2007-08-09
Populates the Function Popup with commands, functions, getProp and setProp handlers in the current document
Syntax coloring for all Revolution commands, functions, control statements, comment blocks
Includes support for private commands and functions
Added hotkeys in Mode menu for often-used code snippets
TextMate
TextMate
1.5 or higher
Macintosh
Ken Ray


Last updated:
2006-08-11
Populates the Function Popup with commands, functions, getProp and setProp handlers in the current document
Syntax coloring for all Revolution commands, functions, control statements, comment blocks
Snippets for creating new handlers, functions, and control statements with tab triggers
Commands for commenting/uncommenting selected text
Code folding for handlers, functions, if/switch/repeat/try blocks
Automatic indentation for on/function/command/if/switch/repeat/try blocks
Support for private commands and functions, and the 'command' alternative to 'on'
TextMate
UltraEdit-32
Windows
Xavier Bury


Last updated:
2007-03-04
Syntax coloring for all Revolution commands, functions, control statements, comment blocks

If you create your own modules or improve on the ones here, please contact us so we can make them available.


News and Rumors Products Services Developer Resources Contact STS About STS