Holy shit, this was god awful. his was 3 years and 20 days ago. I am not going to delete this, just want to show how far a person can come in 3 years
Note: This is in this section because it is a project that will be able to be implemented into RSPS's. And because it is a continued work in progress, it does not need to be in the show off, or download section. Also, don't go on about how Jython/Pyton is better.[/CENTER]
This is the development thread for a scripting language I am developing called 'Divinity Script'.
What is Divinity Script?
Divinity Script is a lightweight, function based Scripting language.
Scripts are created in a custom editor. The editor also acts as the compiler, and the packer.
The scripts exist in three forms.
#1: .wdsf - (Working Divinity Script File) This is a script file that is editable by the editor.
#2: .dsf - (Compiled Divinity Script File) This is a script file which has been compiled (Everything is correct, comments & empty lines removed. Everything has been spaced out so the parser can read it with ease.
#3: Packed Data Files - The editor allows you to pack every saved compiled script into two files - scripts.dat & scripts.idx. The data file contains the byte data for every script, while the index file contains names & lengths.
What is the basic syntax of Divinity Script?
Here's the layout of a 'hello world' script.
Code:
#helloworld.wdsf
#Prints 'hello world!' to the console
#Author: Ben
#Main function, access point of the parser
function main() {
print_line("hello world!");
}
The syntax is similar to Javascript.
Here's another example that could be used in a RSPS.
Code:
#helloworld.wdsf
#Prints 'hello world!' to the console
#Author: Ben
#Main function, access point of the parser
function main() {
call other();
}
#Another function
function other() {
if(return_rights(3)) {
send_message("Hello!");
}
}
How are scripts managed from the application?
There are three files involved with the loading & parsing of scripts.
ScriptManager - Loads & Reloads scripts
ScriptParser - Parses a single script
Script - Repersents a single script
Scripts are loading into a map with their name as the key. Then, it can be called as such.
Code:
ScriptManager.getParser().parseScript(ScriptManager.getScript("obj19000"));
When will it be released?
I will set up the SVN and get all the files into there in a bit. It will also be constantly updated.
Thanks for reading.