Script editor

The script editor allows editing the various scripts in V-REP. It is opened by double-clicking a script in the script dialog, or by double-clicking a script icon in the scene hierarchy.

[Script editor]


The script editor has following features that make the code edition easier:

  • auto-completion
  • call tips
  • syntax highlighting
  • Highlighting of all occurrences of selected word
  • source folding/unfolding
  • simple word search via the <ctrl+f> key
  • no need for explicit saving
  • The API functions can easily be accessed by typing the first 3 letters (usually "sim"). Copy/paste and undo/redo functionality of the script editor is supported through a popup menu (right-click). When a script was modified, there is no need to explicitly save the changes: closing the script editor, saving the scene or starting a simulation will automatically apply the changes to the script. When a simulation is running, modifications to a given script will only have an effect once a new simulation run is started, except for customization scripts that will always apply changes once the editor was closed.

    If you have recurring functions you wish to access from a given script, you can add following line at the top of your script:

    require "myExternalLuaFile"
    

    In that case, make sure the file is named myExternalLuaFile.lua, and do not forget to distribute it together with your scene or model, since that code will not be part of a V-REP file anymore.

    If you wish to use a particular editor to edit V-REP's embedded scripts, then refer to the entry externalScriptEditor in the user settings file system/usrset.txt. For proper keyword highlighting, auto-completion and call tip display, use the data in file v-rep_notepad++.zip (in the installation directory).



    Recommended topics

  • Script properties