PRState is a GameMaker Studio 2 (GMS) module created by Prismatic Realms, Inc. It enables you to implement a simple and efficient finite state machine for your GMS objects. PRState is designed to compartmentalize your object's state implementation code so that they are segregated from each other and from the rest of your object's code. What this means is that, for example, your hero character's walk/run code lives in its own function or method. The same goes for his attack code, and his double-jump code, etc. This results in code that is more organized and easy to trace and debug, rather than having all that code lumped together into your Step event(s)
Note that PRState can be used for more than just keeping track of character states. Consider using PRState to track the different states of your UI objects (buttons, check boxes, etc.) or to track which magical energy a sword is currently imbued with. There are many uses for finite state machines. Any object with more than one behaviour can benefit from this module.
This package contains a parent object that implements PRState that your objects can derive from. The package also contains documentation on how to use the module and example code that you can learn from. The included examples feature artwork by Penusbmic (used with permission.)
Friendly support is just an email away and you can expect a quick turn-around to answer your questions and resolve issues. As always, comments and suggestions are welcome!
The included examples feature artwork by Penusbmic (used with permission.)
NEW FEATURES * None
IMPROVEMENTS * Verbose output log messaging improved. Now includes contents of Data1, Data2 and Data3 when changing states. * Added groups to segregate all assets in this extension from the rest of your GMS project. All future Prismatic Realms extensions and packages will use the same group naming conventions so that any assets imported from them will all be placed neatly and out of the way into these groups. * Added notes containing release notes history and documentation. * Renamed extension resource file to PRState.gml to keep inline with PR naming conventions. * Replaced the previous example assets demonstrating how to use this extension with much better ones. All code is now commented with useful information and directions.
BUG FIXES * None
NEW FEATURES * None
IMPROVEMENTS * None
BUG FIXES * Fixed bug in PRCanSetState() method that incorrectly returned false for states with no "valid from" states defined.
NOTES * None