Skip to content

Setting Up a New Project

JasXSL edited this page Nov 29, 2017 · 9 revisions
  1. Create a subfolder under your includes on disk. Ex: C:\LSL\MyFirstProject
  2. Create a file in that folder and name it _core.lsl
  3. In the first line of _core.lsl enter #include "xobj_core/_ROOT.lsl" and hit enter. It's important that all preprocessor files end with a blank line.
  4. Save your file.
  5. Create a new script in SL and name it #ROOT. #ROOT is the XOBJ standard input manager. You can find a template #ROOT file to copy and paste into your script here. Don't forget to replace #include "xobj_core/_ROOT.lsl" with #include "MyFirstProject/_core.lsl" to implement your own project. For more information about the purpose of #ROOT, see #ROOT

_core.lsl

_core.lsl is an autoloader and global config for your project. The file should have content structured as such (starting from the top of the script):

  1. Config definitions, such as #define PC_SALT 1337.
  2. #include "xobj_core/_ROOT.lsl" which includes the XOBJ framework.
  3. Additional includes for header files (located in /classes of a project or XOBJ official modules).
  4. Any project-wide functions, constants, macros etc that you want to use.