lslforge
lslforge copied to clipboard
LSLForge - Eclipse plugin to assist with LSL scripting for Second Life. This repository is used for development, pull requests and bug reports.
LSLForge
An LSL Script Editor/compiler for Second Life's Scripting Language.
LSLForge is a fork of the popular LSLPlus editing environment, to provide Linden Scripting Language (LSL) support in Eclipse.
Description
LSLForge is a plugin for the Eclipse platform. The plugin allows editing, "compiling" (gathering code included in modules), executing, and unit testing your Second Life® Linden Scripting Language (LSL) code.
Because it is an Eclipse plugin, when you use LSLForge you can take advantage of many of the useful features of Eclipse. Integrated support of a source code control system such as Git, CVS and Subversion comes for "free", and there are many other features — task list management, integration with bug tracking tools, etc. You will of course need to make sure you get the appropriate plugins to use these features.
Forks Purposes
raysilent: This is a fork where the most activity is happening, which is maintaining the latest LSL definitions for functions and constants ofLSLaccording to the recent Release Notes, also bug fixes, and keeping the Eclipse Plugin Update Site up-to-date.elnewfie: After all the tests are accomplished, the repo is merged into theelnewfie's original repo, to avoid confusion.
Changelog
-
0.1.9.8
- Update to
ghc-8.6.5(Thanks @PellSmit) - Fixed bugs (Thanks @PellSmit)
- Simulator up to 2021-08-27.563375:
- [x]
llOrd - [x]
llChar - [x]
llHash - [x]
llGetEnv()constants:"whisper_range","chat_range"&"shout_range"(in comments) - [x]
llGetInventoryAcquireTime - [x]
llOpenFloater- [ ] (Postponed) Return error codes seem to be missing in the viewer.
- [x]
CLICK_ACTION_DISABLED - [ ] (Postponed)
TARGETED_EMAIL_ROOT_CREATORis eliminated (exists in the viewer for backward compatibility most likely). It should be safer to remove it completely from the IntelliSense for early error discovery rather than keep it here. - [x] Mark
llXorBase64StringsCorrectas deprecated in comments.
- [x]
- Update to
-
0.1.9.7
- Fixed bugs (Thanks @PellSmit)
- New functions and constants:
llGetDayLengthllGetDayOffsetllGetMoonDirectionllGetMoonRotationllGetRegionDayLengthllGetRegionDayOffsetllGetRegionMoonDirectionllGetRegionMoonRotationllGetRegionSunDirectionllGetRegionSunRotationllGetSunRotationllReplaceAgentEnvironmentllSetAgentEnvironmentllTargetedEmailand its constants:TARGETED_EMAIL_ROOT_CREATORTARGETED_EMAIL_OBJECT_OWNER
ENV_NOT_EXPERIENCEENV_NO_EXPERIENCE_PERMISSIONENV_NO_ENVIRONMENTENV_INVALID_AGENTENV_NO_EXPERIENCE_LANDENV_VALIDATION_FAILENV_NO_EXPERIENCE_LANDENV_THROTTLEENVIRONMENT_DAYINFOINVENTORY_SETTINGSKY_CLOUD_TEXTURESKY_MOON_TEXTURESKY_SUN_TEXTUREWATER_NORMAL_TEXTURE- (Bakes on Mesh related):
IMG_USE_BAKED_HEADIMG_USE_BAKED_UPPERIMG_USE_BAKED_LOWERIMG_USE_BAKED_EYESIMG_USE_BAKED_SKIRTIMG_USE_BAKED_HAIRIMG_USE_BAKED_LEFTARMIMG_USE_BAKED_LEFTLEGIMG_USE_BAKED_AUX1IMG_USE_BAKED_AUX2IMG_USE_BAKED_AUX3
-
2018-09-16 LSLForge 0.1.9.6 (Windows, Linux (Thanks @Trapez), macOS (Thanks @PellSmit))
- Animesh Functions and Constants:
llStartObjectAnimation(string anim)llStopObjectAnimation(string anim)list llGetObjectAnimationNames()integer OBJECT_CREATION_TIME = 36integer OBJECT_SELECT_COUNT = 37integer OBJECT_SIT_COUNT = 38
- Animesh Functions and Constants:
-
2018-09-14 LSLForge 0.1.9.5 (Windows, Linux (Thanks @Trapez), macOS (Thanks @PellSmit))
- Experimental hot deploy of the newly selected native executable
- "Generated" comment at the end of
*.lslfile (easier to check what was copy-pasted) (Windows only)
-
2018-09-10 LSLForge 0.1.9.4 (Windows, macOS Only)
- Fixed
Tuple*.javadisappearance (Thanks @PellSmit) - Upgraded Haskell (Thanks @simon-nicholls)
HTTP_USER_AGENTOBJECT_RENDER_WEIGHTkey llName2Key(string name)key llRequestUserKey(string name)
- Fixed
-
2017-02-10 LSLForge 0.1.9.3 (Windows, Linux (Thanks @Trapez), macOS (Thanks @PellSmit))
ATTACH_FACE_TONGUEmisspelled
-
2017-01-07 LSLForge 0.1.9.2 (Windows, Linux (Thanks @Trapez), macOS (Thanks @PellSmit))
OBJECT_ATTACHED_SLOTS_AVAILABLEllGetEnv("region_object_bonus")(in comments)
-
2016-11-13 LSLForge 0.1.9.1 (Windows, Linux (Thanks @Trapez), macOS (Thanks @PellSmit))
-
2016-11-08 LSLForge 0.1.9 (Windows, Linux, macOS)
JSON_APPEND,CLICK_ACTION_ZOOM(seems to be absent in the SL viewer, use7instead) added
-
2016-10-22 LSLForge 0.1.8 (Windows only)
XP_ERROR_REQUEST_PERM_TIMEOUTmissing added
-
2016-10-20 LSLForge 0.1.7 (Windows only)
Second Life® Group
The official group for LSLForge Editor tool is LSLForge Users. General announcements, questions and answers.
Installing
- Java 8 JDK is currently used for generating the plugin. You may find that you need to update to Java 8 or later in order to use the plugin.
Eclipse Plugin
Incompatible Versions
- WARNING Doesn't seem to work in:
- Eclipse IDE
2021-09R (4.21.0)
- Eclipse IDE
Compatible Versions
The following Eclipse Distributions were found working:
- Eclipse IDE
2020-12(4.18.0) - Eclipse IDE
2019-12(4.14.0) - Eclipse IDE
2019‑06(4.12.0) - Eclipse Photon (
4.8.0) - Eclipse Oxygen
NOTE: Oomph seems to restore LSLForge native setting despite attempts to overwrite the field. The only workaround for now is to check
[X] Skip automatic task execution at startup timeunder Oomph > Setup Tasks in Preferences.
Platforms that used to work but not tested recently:
- Eclipse Neon (4.6.0)
- Eclipse Mars.2 (4.5.2)
- Eclipse Mars.1 (4.5.1)
- Eclipse Luna (4.4.0)
- Eclipse Juno RC2 (4.2.2)
How to Install
To install a plugin into Eclipse, choose Help > Install New Software. Click Add... and enter the link for location:
-
For the tested and reported to be working releases use
elnewfie's master repo:https://raw.githubusercontent.com/elnewfie/lslforge/master/eclipse/
-
For releases that are currently being tested use
raysilent's master repo:https://raw.githubusercontent.com/raysilent/lslforge/master/eclipse/
(In case of bugs please report right to the https://github.com/raysilent/lslforge/ repo.)
-
Alternatively you may switch to a development fork and try a specific version since
0.1.8(including work in progress branches):https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.8/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.7/eclipse/(Reinstall if you already have the version)https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.6/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.5/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.4/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.3/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.2/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.9.1/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.9/eclipse/https://raw.githubusercontent.com/raysilent/lslforge/0.1.8/eclipse/
-
For even older version, clone the whole repo and link your Eclipse to a particular folder under
eclipse\archive.
If you don't see any items for installing, try to uncheck "Group items by category"
Run
eclipse -cleanto force it to forget cached downloads
Checkbox 2 items:
- "LSLForge"
- One of the native parts according to your environment.
Install, accept and restart Eclipse
Switch to LSLForge Perspective and create a new LSLForge Project
Known Issues
-
*.lslpfiles compilation issues although everything is correct. It may happen when a lot of$importkeywords are used and at some point the compiler gets stuck. What may help is:- Adding a fake
*.lslmmodule along the project, it could be calledFake.lslm. Opening it and adding a space, then removing it and hitting Save will force the project to be recompiled - Forcing recompilation of a module that is referenced by
*.lslpfile by opening it, doing some fake change, and hitting Save
- Adding a fake
Tips & Tricks
Importing Modules
This demonstrates:
- How to use folders when importing modules (dot notation)
- How to import a module with a paramater
Modules/Debug.lslm :
$module (integer DEBUG)
// pragma inline
bug(string place, string message) {
if (DEBUG) llOwnerSay("["+llGetScriptName()+"."+place+"]: "+message);
}
Script.lslp :
integer DEBUG=TRUE; // has to be a variable
$import Modules.Debug.lslm(DEBUG=DEBUG) de;
do() {
debug("do()", "This is a call of 'bug' function from 'de' module");
}
Referencing Modules From Other Projects
Imagine you move Modules folder to a separate project called ModulesProject to use it from different other projects.
In the main project that uses ModulesProject, place a checkbox along its name under Project settings > Project References.
ModulesProject directory tree becomes part of the project's tree. It will still be imported as $import Modules.Debug.lslm without any additions.
Native Executable Compilation
If LSLForge is behind from the newest LSL definitions of functions and constants, you may compile an executable for yourself, by git cloning the source and digging into lslforge\haskell\src\Language\Lsl\Internal\FuncSigs.hs and/or lslforge\haskell\src\Language\Lsl\Internal\Constants.hs and following the already existing examples. You will need to compile the code now with Haskell compiler and specify newly built file in Eclipse LSLForge Preferences. This should be enough for a while. Continue reading for details.
Requirements
To compile the native LSLForge binary, you must have the cross-platform Haskell Stack tool installed.
- Since LSLForge
0.1.9.7Stack >=1.11is required.
Stack can then ensure that the correct compiler and dependencies for the project will be automatically downloaded and installed for you.
To install Stack, please visit the Stack Homepage and follow the instructions. It is likely that you can find a package available at many package managers e.g. chocolatey, homebrew and pacman, but check before installing that their stack version is up-to-date.
Configure Stack if desired:
STACK_ROOTenvironment variable if you do not want stack files appear underC:\sr(Windows).- To configure downloaded programs location, open
Stack's rootconfig.yamland add a linelocal-programs-path: <path>with the path desired, after that commands likestack ghciwill download files right into that folder - To configure where
stack installwill place the files, add the following line toconfig.yaml:local-bin-path: <path>with the path desired. This folder may be added to thePATHenvironment variable. (The reminder will be given afterstack installcopies the file there).
Compiling Haskell native LSLForge binary
In a terminal, change directory to the project's lslforge/haskell subdirectory.
Run stack upgrade to upgrade to the latest version.
You will need to enter stack setup if you have a freshly installed Stack, or don't have the relevant compiler already set up. (Stack will tell you if you need to run this additional step.)
Now run with admin terminal stack install in lslforge/haskell folder to build and install the LSLForge binary in one step. (Weird access denied errors are due to Antivirus.)
Post-compilation
If your stack install is successful, an executable will appear at %APPDATA%\local\bin folder for Windows, or $HOME/.local/bin for other platforms (look at the message after install) - unless you changed the local-bin-path parameter in config.yaml to override default location.
To test the newly built file, you can specify it in the existing LSLForge Eclipse installation under Preferences > LSLForge settings. This will not make any new definitions show immediately, but they will after restarting Eclipse.
If you enable Eclipse Error Log View, it will print out current version of the executable in use, as well as its actual location.
Building for Publishing
Running Tests
cdtolslforge/haskell- Windows
set LSLFORGE_TEST_DATA=../testing/data- enough to be set just for the terminal session.stack test
- Linux / macOS
LSLFORGE_TEST_DATA=../testing/data; stack test
Version Number Change
-
TODO: Automate this task
-
lslforge\haskell\LSLForge.cabal -
lslforge\eclipse\lslforge-feature\feature.xml(all instances) -
lslforge\eclipse\update-site\site.xml(all instances) -
All instances in every
feature.xmlandMANIFEST.MFfiles underlslforge/eclipse.
Compile Haskell Executable & Move to Eclipse Plugin Source Location
Switch to lslforge subfolder.
- Windows
- Run
all_compile_haskell_win32_as_admin.bat eclipse\update-site\clean.bat
- Run
- Linux
stack install --executable-strippingcodegen.shcopy_linux.sheclipse/update-site/clean.sh
- macOS
stack install --executable-strippingcodegen_mac.shcopy_mac.sheclipse/update-site/clean.sh
Eclipse Plug-in Compilation
-
Move existing plugin files from
eclipse\toeclipse\archive\x.x.x\(keepindex.html). -
Eclipse for RCP and RAP Developers - Using
Luna SR2- Use empty workspace
- Import projects from
lslforge\eclipse\(without copying) - If you see artifacts in the
update-site's project folder (features,plugins,artifacts.jar,content.jar), runclean.batorclean.shto delete them. - Double-click
update-site\site.xmland selectBuild All-
Generated files are:
featurespluginsartifacts.jarcontent.jar
-
Move generated files to
eclipse\ -
Copy
index.html(static file) toeclipse\if it is missing.
-
-
Test generated update site with a fresh installation of Eclipse using Local path for plugin:
- If you don't want fresh Eclipse, uninstall existing LSLForge plug-in and carefully remove every folder from the Eclipse cache.
Run
eclipse -cleanto force it to forget cached downloads. - Start with a fresh workspace.
- Help > Install New Software
- Add.. update site, providing Local location of
eclipsefolder as a source. - Install newly made LSLForge plugin.
- Add.. update site, providing Local location of
- Restart Eclipse.
- Switch Perspective to LSLForge.
- Create new LSLForge Project.
- Create
*.lslpfiles and see Error Log View.
- If you don't want fresh Eclipse, uninstall existing LSLForge plug-in and carefully remove every folder from the Eclipse cache.