GameMaker: Escaping URL parameters


Illustrating why you should escape your URL parameters

If you are using HTTP requests in your GameMaker projects, you may need to encode parameters in URLs accordingly to prevent your requests from becoming accidentally (or less accidentally, if user input is involved) malformed.

With some luck you may have already found the script on YYG helpdesk, but there's a minor caveat - as of writing this post, it does not support Unicode, so any non-Latin glyphs will be lost in process. Also it's not as fast as it could be, coming from pre-GM:S days and all.

I have at one point implemented URL encoding for sfgml and have now made a cleaner-looking, single-script version of the function. This post is about that.

Continue reading

A summary of my GameMaker assets

Featured

This post serves as a collection of descriptions and links to various GameMaker-related assets and extensions that I have published over time.

Back when publishing it in 2017, I thought it was longer than expected, but it had since grown about twice in size. At least the blog has that "navigation" sidebar now.

Also should answer the "how do I support your work" question that some readers have.

Continue reading

A small guide on writing interpreters, part 2

label hello: select dialog("Hello! What would you like to do?") {
    option "Count to 5":
        for (var i = 1; i <= 5; i = i + 1) {
            wait(1);
            trace(i + "!");
        }
        return 1;
    option "Nothing": jump yousure;
}
label yousure: select dialog("You sure?") {
    option "Yes": trace("Well then,"); return 0;
    option "No": jump hello;
}

Example of supported syntax

As some might remember, earlier this year I have published a small guide on writing interpreters, which went over the process of implementing a basic interpreter capable of evaluating expressions consisting of numbers, operators, and variables.

This continuation of the guide further expands upon concept, outlining how to support calls, statements, and branching - enough for a small scripting language.

Continue reading