As it becomes increasingly more apparent that many people are completely unware of GameMaker Studio 2 having a light skin and fail to recognize it as being GameMaker as such, I have decided to stop using it for screenshots in my assets/blog posts.
However, the default dark skin is a little boring, so I decided to make a custom one with a familiar yellow tone for accents. This also doubles as a general explanation on how to make skins.
On this fine day, we're proud to announce that we're bringing back everyone's favourite GameMaker 8.x function!
That's right, we're bringing back sprite_add_sprite! 🎉
Now, you might be thinking either "this is not what I've expected" or "this is exactly what I expected [after reading the title] and I only have more questions now". You see, there's not always justification for things happening, sometimes they just do.
Should you actually need this function or if this introduction got you curious, take a seat and let me tell you a story (and some code),
This is a small post about a replica of the strftime function seen in PHP, C standard library, and a handful of other APIs. Such a function takes a date-time and prints it according to the given format string.
The script supports the common formats and those that mapped reasonably to GML functions.
After seeing series of increasingly strange uses of "user events" in GameMaker games for object-bound actions, it came to my attention that most people are only vaguely aware of other ways of doing things, so I decided to write a small blog post on the matter.
There are many uses for these - for example, you might want to have a "take X damage" method on your enemy objects so that it can be varied depending on requirements - some enemies might just take damage, some should retaliate on being hit, some might have a fancy damage reduction formula. Being able to comfortably define/redefine methods on per-object-type basis can help a lot.
Sometimes you might want to pass an instance variable by reference rather than by value - to have a script modify instance variable(s) passed to it without having to return them, or have an instance save a reference to variable(s) that it should change on other instance, or doing anything else that would usually imply using pointers.
But it might seem like GameMaker does not support such things... or does it? Well, we'll make it.
(click to interact)(mouseover/click to play GIF)(spaceship graphic by Kenney)
Nowadays, most development tools provide ways of setting pivot/center point for imagery - that is, the relative point around which the image will rotate and usually be positioned relative to.
However, ability to define multiple pivot points per image remains relatively uncommon, despite being something that you want to have projectiles fire from a correct point of a sprite, display weapons/attachements at right relative points, or do anything else that demands relative offsets.