DracScript 1.06 Released! LGPL Scripting Language
Posted: Fri Mar 10, 2006 7:26 pm
** If the LGPL license prevents you from using DracScript in your game or application please contact me so we can work something out. **
If someone would like to volunteer to be the official pb4 converter thats fine. Its not like its very hard
[Note]
Just a quick note:
For those unfamiliar witht he LGPL. If you use this code in any way you must release the modifications to JUST THIS CODE AND ITS INCLUDES (but not the other way around) and within your programs documentation or credits must make available a way for the source code to be obtained at no cost. Thats it in a nutshell but the full text can be found on www.gnu.org
Enjoy!
[/Note]
Hey folks I'm proud to present the release of DracScript. It has a Pb-like syntax and is written in PB. Thanks to Trond, Srod, and Xombie for the mathematical expression evaluators, optimizations and hard work!
You can download the source and sample scripts from here:
http://www.dracsoft.com/zips/dracscript.zip
You will always be able to find the latest official version here. If you have changes you've made with optimizations, etc, post them and I will include them into the official version here!
To use, just include the file DracScript.pb, and set #DS_TEST_BUILD to 0
Register your functions and register then default functions using DS_RegisterDefault()
Strings in the script are denoted by single quotes like so: 'Hi!'
Mathematical expressions must be done in the form: "var1=var2+var3-(8+9.9)", etc. At the moment there is no pb-like shortcut like "var1 + 1". You can do just about any kind of mathematical expression in the While conditions or in the variable assignment. DracScript is sort of like a small subset of PB for scripting.
To do a For-Next loop, just use While/Wend and increment the variable yourself. I left out For-Next purposefully to make the code simpler and increase the speed a bit.
Its possible to strip out the default functions if you dont need or want them by setting #DS_INCLUDE_DEFAULT to 0
Enjoy and be sure to let me know what you use it for!
[Update]
1.0 Beta is released. Now you can load multiple scripts. A few changes to procedures can be seen in the Readme.txt.
[Update]
1.01 Beta is up. Xombies IsNumeric() rewrite is used for speed.
[Update]
1.02 is up. Seems stable enough. Fixed the bug where commands wouldnt be executed in conditionals.
[Update]
1.03 is up. Small bugfix in Constant processing.
[Update]
1.04 is up. Major bugfix. In fixing the constant processing, I discovered that DS_FreeScript did not work correctly and wasn't resetting certain things. This affects when you try loading a script over another script and can cause very strange behavior and even infinite loops when using if/else/while/wend.
[Update]
1.05 is up. Significant bugfix that caused no script to work correctly after an error occurred in a 'scripting command'. This version is still 3.94 compatible.
[Update]
1.06. Another big bugfix that caused a script to crash the engine if it tried to concatenate a string with a '+' sign in them. Also, a constant has been added so its possible to change the character that is used to mark strings. By default this is now the double-quote or char(34)
If someone would like to volunteer to be the official pb4 converter thats fine. Its not like its very hard

[Note]
Just a quick note:
For those unfamiliar witht he LGPL. If you use this code in any way you must release the modifications to JUST THIS CODE AND ITS INCLUDES (but not the other way around) and within your programs documentation or credits must make available a way for the source code to be obtained at no cost. Thats it in a nutshell but the full text can be found on www.gnu.org
Enjoy!
[/Note]
Hey folks I'm proud to present the release of DracScript. It has a Pb-like syntax and is written in PB. Thanks to Trond, Srod, and Xombie for the mathematical expression evaluators, optimizations and hard work!
You can download the source and sample scripts from here:
http://www.dracsoft.com/zips/dracscript.zip
You will always be able to find the latest official version here. If you have changes you've made with optimizations, etc, post them and I will include them into the official version here!
To use, just include the file DracScript.pb, and set #DS_TEST_BUILD to 0
Register your functions and register then default functions using DS_RegisterDefault()
Strings in the script are denoted by single quotes like so: 'Hi!'
Mathematical expressions must be done in the form: "var1=var2+var3-(8+9.9)", etc. At the moment there is no pb-like shortcut like "var1 + 1". You can do just about any kind of mathematical expression in the While conditions or in the variable assignment. DracScript is sort of like a small subset of PB for scripting.
To do a For-Next loop, just use While/Wend and increment the variable yourself. I left out For-Next purposefully to make the code simpler and increase the speed a bit.
Its possible to strip out the default functions if you dont need or want them by setting #DS_INCLUDE_DEFAULT to 0
Enjoy and be sure to let me know what you use it for!
[Update]
1.0 Beta is released. Now you can load multiple scripts. A few changes to procedures can be seen in the Readme.txt.
[Update]
1.01 Beta is up. Xombies IsNumeric() rewrite is used for speed.
[Update]
1.02 is up. Seems stable enough. Fixed the bug where commands wouldnt be executed in conditionals.
[Update]
1.03 is up. Small bugfix in Constant processing.
[Update]
1.04 is up. Major bugfix. In fixing the constant processing, I discovered that DS_FreeScript did not work correctly and wasn't resetting certain things. This affects when you try loading a script over another script and can cause very strange behavior and even infinite loops when using if/else/while/wend.
[Update]
1.05 is up. Significant bugfix that caused no script to work correctly after an error occurred in a 'scripting command'. This version is still 3.94 compatible.
[Update]
1.06. Another big bugfix that caused a script to crash the engine if it tried to concatenate a string with a '+' sign in them. Also, a constant has been added so its possible to change the character that is used to mark strings. By default this is now the double-quote or char(34)