Could someone explain to me how using "Wait 0.0" to force an action into the next tick is supposed to help (work)?
I've encountered another issue that is probably the same issue as above... I am populating a list from JSON, and while it populates, gets created and appears on screen just fine, the list items are not "available" to the system actions.
I populate the "roomList" list from a "roomList.json" file early on.
Then I am iterating over another JSON file, "strands.json," which contains details for cable strands containing a reference to a "locationA" that is in the roomList.
Inside that second loop, I am attempting to create an instance of "roomList" for each item and pre-selecting the appropriate "room" in that "roomList" from the "locationA" field in the "strands.json" file.
In a sub-event of the block that "creates roomList object" I am trying to make the selection... The logic to compare the list is not the issue as if I hard-code "roomList.selectItem(5)" I still get nothing selected.
If I attempt to run a for-loop over the list (for 0 to 10: Log "roomList.ItemTextAt(loopindex))" I will get zero 11 times.
If, however, I add a Wait 0.0 after the "create roomList object" block, I WILL get a selected item. (and my 0-10 loop will log each item in the list) but no other parts of my script will run after that.
It is my understanding that adding a "Wait 0.0" forces the next action to execute on the next tick, but I really can't understand the flow and why it seems to "break" the loop that I put it in.
I suppose I have 2 objectives: One is to really understand what is happening so I can, generally speaking, properly script in Construct. The other, of course, is to achieve my objective of creating, populating and pre-selecting an item from a list. It seems like I am jumping through way too many hoops to do something so simple - I've gotta be going about things the wrong way.
Thank you!