#8XLib
1 messages · Page 1 of 1 (latest)
I am fairly proud of this so far and its the first big software thing I have ever done lol
Can animation_speed be defined by the sprite's speed by default?
for that you can use
sprite_get_speed()
cause it returns the fps or speed you specify in the sprite editor
what I mean is : perhaps it could be an optional argument that, by default, returns the sprite's speed. I can imagine myself just using whatever speed is in my sprite's already
It's an interesting system to solve some of GMs limitations with sprites but I'm a bit confused about some things. Why do you need to specify the scope? wouldn't it be most if times being executed in the object you want to draw it?
The scope has to be specified cause of GML's lack of pass-by for functions
and I intended for the tick and draw functions to be things you can just drop in and it will work
When GML gets pass-by, I plan on updating the module to support that so it will probably be less confusing
I hope this makes sense though
I'll also definitely implement this, though it would be greatly appreciated if you could open an issue on the github for me so I can keep everything orderly.
yeah of course 👍 Im just reading the code and trying to understand how it is working.
maybe Im missing something but wouldn't it work with passing id or self?
Unfortunately not because you can't modify variables passed into functions, only return them and then modify after
angle = 0;
rotate( angle, 90 ) // Would not work
angle = rotate( angle, 90 ) // works
Only if you do this, yeah:```gml
function func(_scope, _var_name, _value) {
_scope[$ _var_name] = _value;
}
We might get references at some point in the future.
if we dont get references I'll cry
Hopefully I can get the map functions done fairly soon. I use a version of Animo for my own game and they are immensely useful for storing animations
The whole idea is basically this:
You have a character called Bob. Bob has a massive folder of sprites and all of his assets are tagged as ‘Bob’. Then all of those sprites are initialized as animations at your game preload and you can call ‘animo_retrieve( “Bob”, “walk_cycle” )
Or some form of that
Especially since it is all strings it feels much more user friendly
Agreed. Having an abstracted "state enter" function that parses the sprite based on the current state is great.
Will also be including naming rules so you can specify snake, camel or pascal case in your sprite asset names
Do these function names seem comfortable to use?
// Populates the animo map with all sprites with an inputted tag
animo_map_init_from_tag();
// Retrieves an animo animation from the map with an inputted tag key
animo_map_retrieve();
// Manually adds an entry to the map with an inputted tag key
animo_map_add_entry();
hrmm ok I am running into an interesting design problem
So the different cases are prefixed by their tag, which means if you have a sprite named 'spr_bob'
That would technically not be a valid animation name, however if you do
'spr_bob_walk'
then the animation is just named 'walk'
I have no idea how I am going to handle the different ways people prefix their assets, if that is even worth it
animo_map_retrieve( "guy", "doingstuff" );
This is the kind of thing I imagine people will be doing to retrieve animations
Everything should be working fine, my tests showed everything fine
Wiki is updated
etc etc, hopefully this is still a useful tool!