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