This is an average-length post covering the aspects of reading/writing variables by their name (as string) in each version of GameMaker.
Continue reading⚂ <!--
This is an average-length post covering the aspects of reading/writing variables by their name (as string) in each version of GameMaker.
Continue readingFor a little while now, I was working on a new thing - a program that would allow to test GameMaker code right in your browser. It is now complete, published, and is pretty cool.
You can either check it out right now or continue reading for development details and a bunch of demonstrations of it in action.
Continue readingI made a small GameMaker: Studio extension that provides a unified API for "mouselock" between desktop and web (HTML5).
The way this works is by utilizing built-in mouse snapping functions on desktop targets, and using Pointer Lock API on HTML5. It bridges between the two, and you get simple functions like mouse_lock(), mouse_unlock(), and mouse_delta_x & mouse_delta_y for getting the mouse movement offset while mouse is locked.
So, if you ever wanted to make some web-based first-person shooters (or just games with mouselook) with GameMaker: Studio, now you can.
The extension is free and can be downloaded from itch.io or GameMaker: Marketplace.
Game's title screen
This week a One Script Games jam was held on GameMaker forums. In short, the rules are that the entire game must be done inside a single script (function), which is then called once per frame, and must make use of built-in functions to store and process all needed information.
While potentially a little quirky, this seemed like an interesting challenge, so I made a game for it.
The result is a mini-FPS that is a mix of Doom, Quake, and a particular cue sport.
You can download it right now or read the full post for technical details.
Continue reading
A little too often I see confusion about what's the difference between different ways of storing global variables in GameMaker, such as global, globalvar, storing in objects, and macros.
So I wrote a small post to show the technical details and clean that up.
Continue readingIf you've spent some time working with JSON in GameMaker: Studio, you may have noticed that the built-in functions aren't exactly interested at making output laconic - they always write numbers with 6-digit precision, meaning that 3.5 always becomes 3.500000 even though the extra zeroes serve no purpose whatsoever.
The problem becomes more prominent when encoding data that is largely numbers - say, if writing down a shuffled sequence of numbers,
var map = ds_map_create(); // var list = ds_list_create(); for (var i = 0; i < 32; i++) ds_list_add(list, i); ds_list_shuffle(list); ds_map_add_list(map, "order", list); // var json = json_encode(map); ds_map_destroy(map); // destroys the list in the map as well show_debug_message(json);
The output is as following:
{ "order": [ 30.000000, 22.000000, 2.000000, 8.000000, 17.000000, 14.000000, 25.000000, 9.000000, 20.000000, 29.000000, 10.000000, 26.000000, 6.000000, 15.000000, 21.000000, 1.000000, 11.000000, 3.000000, 24.000000, 12.000000, 19.000000, 31.000000, 7.000000, 28.000000, 18.000000, 4.000000, 0.000000, 5.000000, 27.000000, 16.000000, 23.000000, 13.000000 ] }
Where, out of 357 bytes, 250 bytes are whitespace or unneeded "precision".
A little inconvenient, if you don't have a compression algorithm on hand.
But, of course, that can be helped with a script.
(post revised in 2018)
Continue reading
For quite a while now, Twitter has lists. Lists are nice - you can include people with them, and then view their posting on a separate page. Or view multiple of these at once if you are using TweetDeck.
The process of managing lists leaves some to be desired, though - if you want to do something like
You are apparently expected to do so by using the little context menu on each user, picking "Add or remove from lists...", and then ticking/unticking the checkbox for the according list.
That's no fun. But, of course, this can be helped with a bit of JavaScript.
Continue reading
I've released my online multiplayer mod for Nuclear Throne just a bit over two weeks ago. That was interesting. I had since received a plenty of feedback, bug reports, and feature requests. Today I've released what can be considered a major public update, and this is a small average-sized post about interesting things in it.
Perhaps you've already heard that I've been recently developing a mod for the current version of Nuclear Throne. And not "just" a mod, but quite an impressing one:
So it works, it's nice, and you can download it right now.
Or continue reading on process and potential questions.
Continue readingI've recently stumbled upon this little macro by Justo Delgado. It takes an "enum abstract" and sets the values of it's constant-fields incrementally. This brings up an interesting point.
See, in C, you can leave out the values and have them assigned automatically (0, 1, 2, ...), set the values manually, or mix the two, having the values continue "upwards" from the last specified value. So, for example, if I have this,
enum class Op { Add = 0x90, Sub, Mul = 0xA0, Div, Mod, };
Op::Div will be equal to 0xA1, which is convenient, and allows grouping enum constants together (in this case storing operator priority in the upper 4 bits).
Haxe doesn't have that "out of box", unfortunately - either you make an actual enum and have the values assigned automatically, or make an @:enum abstract and assign the values manually.
But, of course, that can be fixed with a macro.
Continue reading