1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Question - Code Will there ever be a built-in code-prettifier for GM2?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by sv3nxd, Feb 5, 2020.

  1. sv3nxd

    sv3nxd Member

    Joined:
    Feb 19, 2017
    Posts:
    68
    So far I've been working with the solution of sanboxrunners gml_fmt which is an amazing resource and really helpful. But I'm wondering if there is a plan to ever make it a build-in feature of GMS2.
     
  2. xDGameStudios

    xDGameStudios Member

    Joined:
    Sep 15, 2016
    Posts:
    609
    Cpaz and sv3nxd like this.
  3. gnysek

    gnysek Member

    Joined:
    Jun 20, 2016
    Posts:
    1,381
    If they would document API for IDE (which exists from 2.0), then we could do it on our own in fact, so they shouldn't consider some of features on roadmap in fact, but let community made them. However, that API is probably too buggy, so that's why it's still kept internal.
     
    TheMagician and xDGameStudios like this.
  4. sv3nxd

    sv3nxd Member

    Joined:
    Feb 19, 2017
    Posts:
    68
  5. xDGameStudios

    xDGameStudios Member

    Joined:
    Sep 15, 2016
    Posts:
    609
    You're probably right.. but that's a shame! plugin API would save Yoyo a lot of feature implementation
     
  6. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    441
    Cpaz likes this.
  7. JON213

    JON213 Member

    Joined:
    Apr 8, 2019
    Posts:
    29
    Would definitely be nice if it made code neat like visual studio.
     
  8. TheMagician

    TheMagician Member

    Joined:
    Jun 20, 2016
    Posts:
    66
    Don't make me sad by bringing up the Plugin API ... it's one of the biggest missed opportunities for GMS 2...
     
    Last edited: Feb 13, 2020 at 3:15 AM
    Cpaz and Ricardo like this.
  9. gnysek

    gnysek Member

    Joined:
    Jun 20, 2016
    Posts:
    1,381
    There's several people here on community, that cracks the possibilities of GMS so much, that it amazes me they still didn't found a way to hack and create sample IDE plugins. Must be not easy then, or it's somehow locked to not load files that aren't hardcoded on some list (as they don't publish API for IDE, it doesn't need to be open for any extensions in fact).
     
    Cpaz likes this.
  10. YellowAfterlife

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

    Joined:
    Apr 21, 2016
    Posts:
    2,502
    IDE extensions are all code-signed and you can't get around that without modifying the IDE files, which is insufficiently legal to do.
     
    TheMagician and Cpaz like this.
  11. xDGameStudios

    xDGameStudios Member

    Joined:
    Sep 15, 2016
    Posts:
    609
    Well if they ever allow for people to develop IDE plugins that will probably change, no?
    Maybe we will need to send the IDE extensions to the marketplace and then YYG will verify and sign them... to avoid misuse?!
     
  12. gnysek

    gnysek Member

    Joined:
    Jun 20, 2016
    Posts:
    1,381
    So yes, somebody already tried that, I knew! That's understandable that they only allow signed ones, to prevent "unofficial plugins" begin made after they mentioned that API exists. So this is still for future.
     
  13. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,870
    Releasing a code prettifier while a major syntax shuffle-up is imminent reeks of bad timing.

    It'll probably happen, but not now.
     
    Joe Ellis likes this.
  14. Joe Ellis

    Joe Ellis Member

    Joined:
    Aug 30, 2016
    Posts:
    1,106
    Something that lets you rename built-in functions would be good. Like the opposite of how extensions can replace them, something where you choose a function name and tell it the source function
     
  15. samspade

    samspade Member

    Joined:
    Feb 26, 2017
    Posts:
    2,231
    Not to get too off topic, but you can already do this with macros.
     
    Cpaz, Joe Ellis and sv3nxd like this.
  16. Joe Ellis

    Joe Ellis Member

    Joined:
    Aug 30, 2016
    Posts:
    1,106
    But there isn't a way to make them take arguments is there?
    This made me realize you can put variable names in the macro value, like: make_color_rgb(r, g, b) and it will use r g & b if they exist. Thanks for making me realize that :)
     
  17. xDGameStudios

    xDGameStudios Member

    Joined:
    Sep 15, 2016
    Posts:
    609
    as @samspade said you can do it with macros:
    Code:
    #macro string_size string_length
    
    var a = string_size("this is a test");
    show_debug_message(a); // prints "14"
    Not sure if this is something you want to be doing... but you can!
     
    Last edited: Feb 13, 2020 at 7:45 PM
    Joe Ellis likes this.
  18. Joe Ellis

    Joe Ellis Member

    Joined:
    Aug 30, 2016
    Posts:
    1,106
    Thanks, I didn't realize they'd made this change to macros in gms2
     
    Cpaz likes this.
  19. Cpaz

    Cpaz Member

    Joined:
    Jun 20, 2016
    Posts:
    347
    *rapidly translates everything to camel case*
     
  20. gnysek

    gnysek Member

    Joined:
    Jun 20, 2016
    Posts:
    1,381
    I wanted to write in camelCase in GMS too, but after using that for nearly year I decided to go back to snake_case. Just because two styles at once were worse :p I'm using camelCase in other languages of course.
     

Share This Page