Thread: Divinity Script Development Thread

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Divinity Script Development Thread 
    Community Veteran

    Songoty's Avatar
    Join Date
    Dec 2007
    Posts
    2,740
    Thanks given
    211
    Thanks received
    1,034
    Rep Power
    2455
    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.
    Reply With Quote  
     

  2. #2  
    Officially Retired

    Huey's Avatar
    Join Date
    Jan 2008
    Age
    22
    Posts
    16,478
    Thanks given
    3,385
    Thanks received
    7,727
    Rep Power
    5000
    Goodluck again ben
    Attached image
    Listen children don't become this guy.
    Quote Originally Posted by Owner Spikey View Post
    Why can I attack lower level npc's in a matter of a mouse hover but for a higher level npc the only choice to attack is by right clicking option attack?

    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Aug 2009
    Posts
    146
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    wth?, looks like c++ m8

    but gl
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Aug 2007
    Posts
    545
    Thanks given
    6
    Thanks received
    0
    Rep Power
    196
    This is a great idea, though I made my on lightweight script engine.
    The compiler parses my lightweight scripts and turns them into java code, its for my development team.

    eg of code:
    //Default imports is player and its nearest functions
    import combat <- loads the combat functions for usage
    int combatTimer getTime()
    lessThan combatTimer 1 <- if the combattimer is less than 1
    start
    playAnimation 1050 1
    hit getEnemy() random()
    end


    Thats just an example script of the current way it works.
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    good luck ben

    i still think Python is amazing, im sorry you didn't like it
    Attached image
    Reply With Quote  
     

  6. #6  
    Registered Member
    G0nzo's Avatar
    Join Date
    Feb 2009
    Posts
    4,960
    Thanks given
    514
    Thanks received
    546
    Rep Power
    1735
    yeah jythons also fully developed and there are plenty on tuts all u have to do is google jython
    Computer Science Graduate, Java Expert
    Need help with something? PM me
    Reply With Quote  
     

  7. #7  
    Fat Cookies
    Guest
    inb4 Speljohan_

    RSServer is the exact same concept.
    Reply With Quote  
     

  8. #8  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    Quote Originally Posted by 13th ranger View Post
    yeah jythons also fully developed and there are plenty on tuts all u have to do is google jython
    yeah but a script that compiles into java would be nice to tbh
    Attached image
    Reply With Quote  
     

  9. #9  
    Community Veteran

    Songoty's Avatar
    Join Date
    Dec 2007
    Posts
    2,740
    Thanks given
    211
    Thanks received
    1,034
    Rep Power
    2455
    Quote Originally Posted by 13th ranger View Post
    yeah jythons also fully developed and there are plenty on tuts all u have to do is google jython
    I dislike Python. I dislike using anybody elses work also, because if you do it yourself then you 100 % understand how it works.
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Good luck! However I'm a bit confused about what you said.
    Will the scripts be read from the packed files or the .dsf file?
    And i'm assuming which ever one will be parsed in byte data?
    Don't worry, Be happy.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •