Accessing & working with structure child variables through number comparison

Hi everyone, first post on here. I tried looking up similar threads to address my problem myself, but I am a complete GDevelop noob and haven’t used my barebones JS knowledge in a good while either so I’m not sure how to tweak the given solutions to suit my particular case.

Using Pandako’s Simple Scrollable List Extension (https://www.youtube.com/watch?v=E4Z9KlIYqrQ), I set up a “social media timeline” scene that is meant to add new posts (all of which are stored in one structure variable) to the top of the list every time a counter hits specific numbers. For my prototype, +1 is added to the counter on every mouse click. After a bit of trial and error, Screenshot 1 is how I got it to work the way I intended and Screenshot 2 are the variables I’m using:

As you can see, I currently add each individual “post” to the list through its own event.

What I’d like to do instead is a one-size-fits-all solution that checks the value of each “ChildVariable” against “clickCount” until it finds a ChildVariable that has a value higher than clickCount, then counts the number of “posts” with a ChildVariable below clickCount and creates a new array from the original List array based on those numbers.

Currently, I’m stuck trying to compare the two variables at all. I tried using “Trigger once while true” and toggling booleans to stop it from counting up rapidly by adding +1 to postCount on every frame, but even then it just adds +1 on every click anyway. Removing the ChildVariable of a “post” after it gets added to the list seemed like a good workaround, but it doesn’t really do anything. (Screenshot 3)

There’s probably something really obvious I’m missing, but I just can’t seem to figure it out. Any help would be much appreciated

I’m not familiar with the extension. It seems to take an array as a Json text. You seem to be splicing a larger array.

To simplify this

You could replace the 0 and/or 1 with variables like
0,End or Start,End or Count, Count+9

You would only then need the 1 event instead of 1 event for each value.

If you want to build an array based on the children of an array of structures then you could use for each child

I don’t know your goal. So, this might not apply.

This uses these variables. The variable Child needs to have the same children as the structures in the array.

For testing I used a button and a text object to display the title of the structures in List2 The 1st for each child builds the 2nd array and the 2nd for each child displays the names.

IDK your goal or knowledge. So, IDK how helpful this is.

https://wiki.gdevelop.io/gdevelop5/events/foreach-child-variable/