GML [Tool] GMEdit - a code editor for GM! (now with plugins!)

Discussion in 'Game Design, Development And Publishing' started by YellowAfterlife, Dec 25, 2017.

  1. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    You should be able to use
    Code:
    file:///C:/.../<GM doc path>/$1
    
    (also note that API changes only take effect after restarting GMEdit)
    GMLive has approximately nothing to do with the docs so I'm not sure why you'd be using it's server for this.

    Thank you!
     
  2. CameronScottCreations

    CameronScottCreations Member

    Joined:
    Dec 1, 2018
    Posts:
    70
    @YellowAfterlife Hey I ended up downloading this and it's even better than I could have imagined. It's so lightweight and elegant! :)
    I do have a question though in regards to the backups. I'm working on project for a company on GMS1 and I push changes to a master using source control and would rather not have to push my backup folder. Is there a way to change the storage of the backup folder to my desktop or something? If not, is it that necessary to maintain the backups? I noticed in the settings I can reduce the number of backups from 2 to 0 and may do just that. However, there were a couple of times working on the project where the IDE noticed a conflict between an older version of a file and a newer version. Each time I chose the newer version of the file, but these conflicts gave me pause in reducing the backup count from 2 to 0. Thanks!

    Edit: So it seems this is necessary protection when working with GMS1. Still, if you have a way of moving this folder away from the repository folder that would be great!
    If not, I can always just take the folder out manually before adding and committing my changes although that would be a slight hassle.
     
    Last edited: Dec 12, 2018
  3. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    Thank you!

    Just add
    Code:
    /#backups/
    (or /project/#backups/ if it's in a subdirectory)
    to your .gitignore file.

    If you are using a git GUI client, you should have an option to add file(s) to gitignore to the right-click menu when picking them for a commit, and there's usually a "ignore the directory" option to make things easier (but in the end this still just adds a line to .gitignore)
     
    CameronScottCreations likes this.
  4. CameronScottCreations

    CameronScottCreations Member

    Joined:
    Dec 1, 2018
    Posts:
    70
    @YellowAfterlife One of the projects I'm working in is constantly indexing.

    indexing.png

    Is this something I should be worried about and/or something that has a known solution?
     
  5. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    Press Ctrl+Shift+I and copy me the error message from console tab, that's usually the only cause of that
     
  6. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,217
    When is YoYo going to hire you as an official developer of GM? Have you ever looked into that? I think with your level of expertise, you'd be surprised.
     
    immortalx likes this.
  7. CameronScottCreations

    CameronScottCreations Member

    Joined:
    Dec 1, 2018
    Posts:
    70
    Code:
    app.js:288 hello!
    app.js:15272 Uncaught TypeError: Cannot read property 'startsWith' of null
        at Function.parsers_GmlSeeker.runSyncImpl (app.js:15272)
        at Function.parsers_GmlSeeker.runGmxObject (app.js:15504)
        at Function.parsers_GmlSeeker.runSync (app.js:15523)
        at next (app.js:14648)
        at tryToString (fs.js:449)
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436)
    64ace.js:3999 misspelled option "foldStyle"
    warn @ ace.js:3999
    app.js:15272 Uncaught TypeError: Cannot read property 'startsWith' of null
        at Function.parsers_GmlSeeker.runSyncImpl (app.js:15272)
        at Function.parsers_GmlSeeker.runGmxObject (app.js:15504)
        at Function.parsers_GmlSeeker.runSync (app.js:15523)
        at next (app.js:14648)
        at tryToString (fs.js:449)
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436)
    app.js:15272 Uncaught TypeError: Cannot read property 'startsWith' of null
        at Function.parsers_GmlSeeker.runSyncImpl (app.js:15272)
        at Function.parsers_GmlSeeker.runGmxObject (app.js:15504)
        at Function.parsers_GmlSeeker.runSync (app.js:15523)
        at next (app.js:14648)
        at tryToString (fs.js:449)
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436)
    app.js:15272 Uncaught TypeError: Cannot read property 'startsWith' of null
        at Function.parsers_GmlSeeker.runSyncImpl (app.js:15272)
        at Function.parsers_GmlSeeker.runGmxObject (app.js:15504)
        at Function.parsers_GmlSeeker.runSync (app.js:15523)
        at next (app.js:14648)
        at tryToString (fs.js:449)
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436)
    36ace.js:3999 misspelled option "foldStyle"
    warn @ ace.js:3999
    
     
  8. lolslayer

    lolslayer Member

    Joined:
    Jun 23, 2016
    Posts:
    679
    This looks really good! I also love that you extended GML in this editor.

    I don't know if anybody has suggested it yet, but maybe, just maybe, you can add in the support for multi-threading the same way as Mishmash does it:
    https://forum.yoyogames.com/index.p...eading-in-gamemaker-no-dlls-networking.44268/

    I'm not certain if you can make this compatible with GMEdit,and maybe there are legal problems with this you want to avoid, I don't know, but I would go nuts if there's decent support for multi-threading in GameMaker :)
     
  9. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    Thanks! That did happen for a bit.

    Hm, ideally I'd need a sample of the project where this happens.
    If you open dev tools prior to loading the project, you can switch to Sources tab, tick "pause on exceptions" button on the right, and then check what file this happens in when it pauses on an error (so that you know what you need to isolate).

    I am working on a thing like that actually - and it's not just multi-threading.
    In fact, oftentimes you don't even need multi-threading because it's possible to squeeze far more performance out of algorithmic code (which is what my tool allows to do).
    The tool also offers easy-to-use C++ injection and makes it easy to debug/profile YYC projects in Visual Studio - from automated setup to matching up GML/C++ files for ease of navigation to making VS debugger display GML-specific values in a coherent way (not just as "{...}" mystery values):
    upload_2018-12-25_23-35-45.png
    So a pretty big deal for those concerned.

    But... yeah. This doesn't have very much to do with GMEdit - sure, you can now specify C++ types via type magic or use #import syntax to write code that doesn't just look object-oriented, but is object-oriented, but an editor has no part in the actual process.
     
  10. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,217
    Oh yeah, idk how I forgot that. lol

    *leaves so everyone can focus on the topic at hand*
     
  11. lolslayer

    lolslayer Member

    Joined:
    Jun 23, 2016
    Posts:
    679
    Whoa whoa whoa, that looks amazing!

    Can't wait to get my hands on that :)
     
  12. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    New version is now out! This is a big one
    spite-view.gif
    Bigger additions:
    • Code editor now has a context menu
      • It has a pretty dumb "show references" thing
    • There are now tooltips for mouseovering functions, macros, variables, and so on
    • You can now import GMS1/GMS2 code editor colors as themes (see wiki)
    • There is now a sprite viewer for both GMS1 and GMS2
    • There is now regular expression search
    • Most code tabs are now restored when reopening a project
    Smaller additions:
    • `///prefix ...` now gets a `ace_startswith_prefix` CSS class
    • You can now view GMS2 extension functions/macros via context menu.
    • Local variables inside #lambda functions now get a separate color
    • Global search can now show search results in #lambdas inline
    • Added a preference to control how GMS2 events are ordered for display
    • <html> now gets a hasFocus attribute in case you want your themes to change depending on window focus
    • You can now do `#import func in Name:method` or `#import prefix_* in Name:`
      (without turning every func into Name.method - only the ones for var v:Name)
    • Added a preference to open resource tree items with one click
    • GMEdit now has a taskbar icon thanks to JustFredrik
    Improvements:
    • Thumbnails are now generated on-demand and perform much better in very large projects
    • NTT projects now have thumbnails for images
    • The item in resource tree now flashes a few times when you pick "show in resource tree"
    • Themes are now detected in the data directory so that you can remove the program directory and lose nothing
    • Auto-completion for namespaces now pops up when you type `var v:`
    Breaking changes for themes:
    • Code editor rules now use `#main .ace-tm` (the editor) instead of `#main .gml` (the whole right side) so you'll need to find-replace that in your themes to be `#main .ace-tm`
    • Numbers are now just .ace_numeric instead of .ace_constant.ace_numeric to avoid requiring CSS priority
    Changes:
    • You can now add a "//!usevars" line to your gmedit_lambda.gml after creating it to auto-workaround this bug (GMS <= 2.2.2).
    • Recent project list is now saved into the data directory rather than localStorage.
    • Newly created scripts now open automatically for editing
    Fixes:
    • Fixed local variables sometimes not immediately highlighting in newly added GMS2 object events.
    • Fixed replace.gml being too greedy, thus causing xstart/ystart to go missing from highlighting
    • Fixed "use tabs instead of spaces" setting not getting saved.
    • Fixed projects opened via command-line argument adding duplicate entries to recent projects list
    • Fixed GMEdit using uppercase GUIDs while GMS2 uses lowercase (causing GMS2 to lowercase them when it changes that file)
    • Fixed "#event name|desc" (no-space comment) not setting starting line to 2
    • Fixed it being possible to corrupt code with conflicting #import declarations (#import a in v + #import b in v)
    • Fixed "invisible characters" being light gray in dark theme
    • Fixed code indexing being able to get stuck due to errors
     
    fireday2, Cpaz, Ludorverr and 5 others like this.
  13. Ludorverr

    Ludorverr Member

    Joined:
    Jun 20, 2016
    Posts:
    33
    love the progress

    here's a theme
     
    Last edited: Jan 13, 2019
  14. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    296
    What an update! @YellowAfterlife is there a way to save the code editor setting "Keyboard Handler"? When I set it to emacs, it does remember it for the current session but everytime I re-launch GMEdit it resets to ace.
    I noticed these settings are stored in aceOptions.json, but there's no entry for keyboardHandler. Tried to add it myself with no success.
     
  15. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    Thank you! I added a link to your itch page to the theme list on wiki

    Ah! Was it you that asked about this? I was trying to find what was off about keyboard handlers but couldn't find who asked and what. I think the deal with that is that it's not actually a variable at all, thus you can't get/set it like that. I'll take a look at it for a smaller update soon
     
  16. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    296
    Well, it wasn't me who asked but I'm glad it's not just me with weird requests :D
     
  17. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    New update!
    gmedit-split-r2.png
    Bigger additions:
    • Plugin support! That's right,
    • Outline view! Makes it far more manageable to work with huge scripts/objects
    • Split view! Show a linked version of one of the tabs on the right for quick editing/reference (right-click on code > Show aside)
    • You can now manage GMS2 objects and shaders from GMEdit, as well as reordering/regrouping (but not creating/deleting) most other resources
    Smaller additions:
    • Opening an image from included files now shows it inside GMEdit
    • GMEdit now supports basic INI and Markdown highlighting
      Markdown supports GML highlighting inside ```gml ...``` blocks, making it more convenient to write documentation for GM extensions right inside the project editor.
    • You can now see/edit general properties of GMS2 objects in a special "properties" event
    • GMEdit can now auto-detect whether to use spaces or tabs on per-file basis
    • There is now a command palette (Ctrl+Shift+T or Ctrl+T,>) for accessing semi-common features and plugin commands
    • You can now edit "notes" in GMS2 projects.
    • You can now sort resources in GMS2 projects (via right-click menu).
    Improvements:
    • You can "view API" for GMS1 extensions as well
    • Opening a non-project file now consistently shows a file tab and a recent project list on the side
    • Code highlighting inside gml_pragma now works better.
    • If a script has no JSDoc, GMEdit will guess basic argument info from code.
    Fixes:
    • Fixed an occasional little seam on tab UI
    • Fixed "/*" in search results breaking highlighting for the subsequent matches
    • Fixed GMEdit using / in new script paths while GMS2 prefers \ (causing GMS2 to later update them)
    • Fixed status bar showing wrong active argument for code with 2d array accessors among arguments
    • Fixed GMLive.gml icons flipping on/off when re-saving the same file with limited changes.
     
  18. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    296
    I haven't tried this one yet, but what can I say, you're a true master.
     
  19. Posho

    Posho Member

    Joined:
    Jul 23, 2016
    Posts:
    222
    Amazing! Will finally be able to trick my classmates into thinking that I'm doing something important when I'm actually making games. :cool:
    I'm assuming this doesn't work with 3D?
     
  20. Posho

    Posho Member

    Joined:
    Jul 23, 2016
    Posts:
    222
    My GOD, just tried it out and it is amazing! This is exactly what I've been wanting for a long time now. A true full-text GML experience! Is there anything you'll make that won't impress me? Hahah.

    I'm curious about how to run/test the project. I didn't play with it for much, but I didn't find a Run button. As of now are we supposed to keep the GMS window open just to test?
     
  21. SnortySnoopy

    SnortySnoopy Member

    Joined:
    Apr 25, 2018
    Posts:
    186
    I wish something like this exist for use on mobile device; doesn't have to be able to do test run or anything sophisticated. Just the GML coding and adding sprite alone would be nice to allow working while on the go and then sync it back to the pc (GMS) to transfer, test run, and build the project.
     
  22. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    296
    There has been a plugin released which doesn't even need GMS2 to be running! It's fantastic and you can even view debug messages. Check it out:
    https://github.com/nommiin/builder

    The older method was using a script that redirected the F5 shortcut to GM's window, but with this new plugin it's redundant.
     
    Posho and Nommiin like this.
  23. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,351
    Is this about the GMLive.js build included? You'll need to switch mode from "2d" to "GL" if so

    There's a macro on wiki, and the aforementioned plugin if you are using GMS2.

    GMLive.js is very barely usable on mobile, but you need an external keyboard and a big enough screen (screenshot is from an iphone 6s, which is evidently too small)

    There are of course, some mystery problems, like
    • The page can be scrolled past the bounds vertically
    • Tapping tabs doesn't switch them
    • Can't drag-resize the splitter
    • Not really optimized for portrait view
    Of course, GMEdit is free and open-source, so anyone could fix this and submit a pull request, but that's too much of a perfect-world scenario.

    And to use GMEdit itself on mobile you'd have to do some additional work to sync files through a third-party service or something.
     

    Attached Files:

  24. Mick

    Mick Member

    Joined:
    Jun 30, 2016
    Posts:
    719
    That plugin sounds great! However, I can't get the plugin to work (no Run project in menu), do I need to do something else than these mentioned steps? (I use the latest version of GMEdit on Windows 7)

    EDIT: Disregard my problem above, I was apparently not using the latest version!

    Code:
    1. create a folder named "builder" inside of `%appdata%/AceGM/GMEdit/plugins/` on Windows, `/Users/<username>/Library/Application Support/AceGM/GMEdit/plugins` on macOS
    2. extract `main.js`, `build.js`, and `config.json` into aforementioned folder
    3. launch GMEdit and open a project
    4. open the main menu and select "Run Project"
    5. optional: adjust what runtime to use in the "Preferences" menu
     
    Last edited: Mar 26, 2019
  25. Posho

    Posho Member

    Joined:
    Jul 23, 2016
    Posts:
    222
    I tried using it and I got the same error message as if it weren't installed.
    Code:
    Compile Started: 12:21:32
    Using Runtime:
    Using Temporary Directory: C:\Users\green\AppData\Local/GameMakerStudio2/GMS2TEMP
    !!! Could not find "GMAssetCompiler.exe" in C:\ProgramData/GameMakerStudio2/Cache/runtimes//bin/
    I think this might be because I'm running Studio 2 from Steam, but despite that a file called "GMAssetCompiler.exe" is nowhere in the Steamapps folder, so I can't really find a way to redirect it.

    Worked like a charm, thank you! Now I gotta make a quick executable that launches GMEdit, Studio 2 and the AutoIt script all at once.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice