Thread: Open-Sourced CS2Script editor

Results 1 to 7 of 7
  1. #1 Open-Sourced CS2Script editor 
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    690
    Thanks given
    191
    Thanks received
    169
    Rep Power
    216
    The following will be a progress thread for my open sourced clientscripts editor.

    The aim will be for this editor to be used across revisions, though will be initially built for 727 and expanded upon from there.

    I urge anyone trying to learn how CS2 works to use this project. I will try and keep everything very simple and easy to understand.
    I will begin extensively commenting everything once I am near completion, so everyone can understand the reasoning behind everything.

    Another huge help for me during all of this has been the channel LowLevelJavaScript on Youtube: [Only registered and activated users can see links. ]
    And particularly their series on building a VM in javascript: [Only registered and activated users can see links. ]

    There will be 3 main components to this editor.

    A [Only registered and activated users can see links. ] to parse the scripts from plain text
    A [Only registered and activated users can see links. ] to decompile the scripts to plain text
    and finally, an editor to load scripts, edit them using a basic IDE, and recompile them (optional, the two above projects can be used on their own with some work)

    Alright, onto the progress:

    Spoiler for parser:


    The language parser. Created in javascript, the parser uses a library called arcsecond to parse the language. The results are then encoded into the data to be packed into the cache and returned.
    Currently, most everything is supported, with only a couple features not yet added because I have decided not to yet. That said, I'm 100% certain there are small things that I have forgotten, and will be added later.

    Parser will be added to npm soon for people to use should they desire without having to download from git.

    Variable Creation
    Variable Assignation
    Creation and Assignation on same line
    Basic instructions (send_message, to_string, others to be added, when needed)
    Calling other scripts with parameters
    If statements
    Else if statements
    Multiple statements with ||
    Bracketed expressions with statements
    Multiple statements with &&
    Switch statements
    Packing into cache right from parser (Not sure if I'll add)




    Spoiler for decompiler:

    The decompiler has been started and can be found at: [Only registered and activated users can see links. ]
    So far it can print out basic scripts, adding more statements/expressions isn't very hard, so I don't see it taking too long.
    After that it's really all about just making sure each instruction is added.

    TODO:
    Variable creation
    Variable assignation
    if statements (with 'else' statements, no 'else if' statements yet tho)
    while statements
    calc function calls
    Basic function calls
    Return statements (with values)

    Switch Statements
    Else if statements
    Multiple expressions in statement with || or && (|| should work already with how I made statements, but haven't tested so leaving red)

    Hooks

    Cleanup:
    Else if statements on same line
    variable creation/assignation on same line if possible




    Spoiler for editor:

    Not yet started


    Spoiler for Cross-Revision:

    An end goal of this project is to allow multiple revisions to use it.

    Unfortunately, the opcodes for instructions change every revision. It's quite a tedious task to find each one for a revision, almost like identifying every packet, except theres a lot more of them.
    As far as I know, there is no easy way to identify these, but if anyone knows how, I would love to learn so we can try and make this available to everyone.

    Once I am finished though, I will slowly try and identify some instructions for other revisions, and will at least get them started so others can continue to identify them for the revision that they would like.


    Spoiler for Media:

    Not a lot of media yet, but here's a picture of the package structure for the parser.
    Fairly small, no huge files either so quite proud of.



    Spoiler for Github Updates:

    Updated using [Only registered and activated users can see links. ]

    cs2-decompiler: [Only registered and activated users can see links. ]
    cs2-decompiler: [Only registered and activated users can see links. ]
    cs2-decompiler: [Only registered and activated users can see links. ]
    cs2-decompiler: [Only registered and activated users can see links. ]
    cs2-decompiler: [Only registered and activated users can see links. ]
    cs2-decompiler: [Only registered and activated users can see links. ]
    cs2-decompiler: [Only registered and activated users can see links. ]


    Reply With Quote  
     

  2. #2  
    Registered Member Stugger's Avatar
    Join Date
    Apr 2016
    Posts
    86
    Thanks given
    48
    Thanks received
    73
    Rep Power
    67
    neat as far as locating instructions go, I would recommend doing something like [Only registered and activated users can see links. ] which allows testing any opcode on the fly with immediate results. I don't know how other revisions handle their client scripts but I would have to assume the system is generally the same.
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Jul 2013
    Posts
    118
    Thanks given
    12
    Thanks received
    50
    Rep Power
    83
    Opcodes will always be an issue, and trying to support them all would most likely delay release or require constant maintenance.

    When developing my tool, I found it was a lot easier to allow clients to specify a plugin for their specific read values. That way the opcodes for reading could be updated by a third party, rather than you (or the client). The plugin would specify the proper read values (and write values, if needed).

    Your app could have in-app support for opcodes which are supported by common revisions, so average users won't have to worry about defining their own read values for common revisions. You could define the common read values as your own plugin, which comes bundled with the app.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Tamatea's Avatar
    Join Date
    Aug 2010
    Posts
    1,223
    Thanks given
    360
    Thanks received
    283
    Rep Power
    897
    Good luck with this, I'm sure [Only registered and activated users can see links. ] could be a massive help



    Reply With Quote  
     

  5. #5  
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    690
    Thanks given
    191
    Thanks received
    169
    Rep Power
    216
    Decompiler has been started. Thread has been updated.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    May 2015
    Posts
    121
    Thanks given
    67
    Thanks received
    29
    Rep Power
    75
    Good luck. Maybe it could support 414 one day? Looks good so far. - Snow. =)
    Reply With Quote  
     

  7. #7  
    Respected Member

    Corey's Avatar
    Join Date
    Feb 2012
    Posts
    1,313
    Thanks given
    962
    Thanks received
    1,278
    Rep Power
    5000
    Quote Originally Posted by SnowEssence View Post
    Good luck. Maybe it could support 414 one day? Looks good so far. - Snow. =)
    Shouldn't be too difficult if you supply mapped instructions for 414.
    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Spoiler for .:


    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Interface Editor (Open-source)
    By Greg in forum Projects
    Replies: 64
    Last Post: 11-01-2018, 11:18 PM
  2. Map Viewer / or / Editor Open source
    By Lmctruck30 in forum Requests
    Replies: 2
    Last Post: 12-30-2013, 04:23 AM
  3. Open Source Interface Editor
    By peterbjornx in forum Projects
    Replies: 10
    Last Post: 12-22-2008, 11:02 AM
  4. Replies: 3
    Last Post: 09-10-2007, 07:07 AM
  5. need open source web-client
    By disturbed 1 in forum Downloads
    Replies: 9
    Last Post: 07-05-2007, 07:33 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •