GM please give this man a raise-- his content is the best out there in terms of quality & concision. I appreciate these intermediate level tutorials and think we need more content directed at this level.
@_bubblezzzzzz_ Жыл бұрын
Was trying to use array_find_index using the manual and couldn't figure it. Got the index I needed to delete, thanks so much!
@tomitsolov3386Ай бұрын
Would have been nice if someone explains how to use array_find_index with more complex objects like objects or structs. This seems to be way more complicated than one would think when it comes to simple functions for getting indexes. I am not the only person with the same problem judging by the other comments.
@indieklem Жыл бұрын
Thanks for this video. It was, for me, a bit difficult to use "array_find_index" the way I wanted to - with struct in my array.
@GameMakerEngine Жыл бұрын
Then they're just gonna get hit with rocks and die, and die again 🙃. Post in the forum with a screenshot of your code and some hereo may rescue them. forum.gamemaker.io/index.php
@aggelandro Жыл бұрын
I have latest version and it seems like these new array functions doesnt exist/show in my IDE (If I write "array_map", it is shown as a new variable), do you know what possibly be the issue and how could I solve it? Thanks!
@stefanimal5257 Жыл бұрын
Thanks for all the updates, you kids are kool!
@ollie_r8162 Жыл бұрын
I have a hard time wrapping my head around array_find_index() - How would you use it to find an a specific item you are looking for? In the example, "sword" is hard-coded into the predicate function. How do you find the index if what you are looking for is decided during runtime, not compile time?
@alvin_row Жыл бұрын
Maybe there's a way to pass additional values to callback functions? Such as the item you're looking for
@GameMakerEngine Жыл бұрын
You can use method() to bind the callback method to a struct, that struct would hold the value you are looking for. Then you read that value in the function and use it as a predicate. Example function: function array_get_index(_array, _value) { static genericCallback = function(value, index) { return value == valueToSearch; } var specificCallback = method({ valueToSearch: _value}, genericCallback); return array_find_index(_array, specificCallback); }
@ollie_r8162 Жыл бұрын
@@GameMakerEngine That's so cool, thank you so much!
@neoDarkSquall Жыл бұрын
Finally! I'm mainly a Javascript developer and I am really glad GMS2 introduced the equivalents of filter, map, foreach and such.
@AnnaDevid Жыл бұрын
Хорошее и полезное видео, спасибо за него. Однако что будет с array_find_index() если в массиве два подходящих значения.
@alvin_row Жыл бұрын
It probably returns the position of the first matching value. I'm sure it's in the documentation though
@AnnaDevid Жыл бұрын
@@alvin_row okay, thank you for your answer
@shadowind30 Жыл бұрын
Now I can put my JS knowledge to use...
@fullym5484 Жыл бұрын
Can you guys make a tutorial how to use the coding language
@alvin_row Жыл бұрын
There's plenty online!
@StallionTG Жыл бұрын
Are you all going to convert gml to just be javascript one day? Cause I'm fine with that.
@alvin_row Жыл бұрын
Please give us GUI tools so godot users stop laughing at us