[Extension] Arrays

Hello you search arrays in GD5?
You can test this extension, it’s experimental, if you wish code it with me you are welcome!

Description:

This extension use the variables structures, that mean you can see the values in the debugger!
For now arrays are only on Objects.

You can:

  • Add value at the end of the array (Push)
  • Remove the first value in array (Shift)
  • Remove the last value at the end of the array (Pop)
  • Get length of the array
  • Reverse the array (Reverse)

I will add:

  • Add value at start of the array
  • Other suggestions ?

Download:

array_extension_0.0.1b.json - Download

5 Likes

I only did a quick poke through this, but it looks really great.

Biggest suggestions:

  • Global Arrays
  • Scene Arrays
  • “For Each Entry in Array” style of event.
1 Like

+1 to @Silver-Streak suggestions.

My suggestion :

  1. action to sort array (ASC/DESC)
  2. Expressions to :
  • return the index of the higher value
  • return the index of the lower value
  • return the average
  • return the weighted average
  • dump the (whole) array as text (usefull for debugging/testing)

Here is my santa list :slight_smile:

Indeed great idea with this extension, i’ll test it in the evenning :slight_smile:

2 Likes

This work like this ?

Yes i will add this one too!

I try to make functions before, and after i can extend the extension with global and scene variables.

No idea how to implement this one if someone want give a try…

Ready for next version

I’m not sure @Bouh, here is a french explanation : Leçon Statistiques - moyenne simple et moyenne pondérée - moyenne simple et moyenne pondérée

It’s a bit specific and i am not sure yet of how i would use it in game devlopment, but it’s really useful in statistics.

Thats same operation.
See the code in action with values from your article:
https://repl.it/repls/CriticalAmbitiousYottabyte

1 Like

That isn’t possible as event functions haven’t access to the IDE and cannot declare events. Events can’t be declared through extensions for the time being anyways.

1 Like