This is a very confusing issue that I don't even know what is causing it so figured I would report it so it can be looked into, or explained.
Does the issue occur in the editor or during gameplay?
If it's a gameplay issue, please specify which movement system and camera type you're using (free movement vs. grid movement, third-person vs. first-person) or N/A if not applicable:
Briefly describe the issue you're experiencing:
I have a script (posted below) that is supposed to loop through an array and build a line seperated list.
However, it ONLY works if I print the list to the console as I loop through.
The moment I remove the print commands, it only shows the last entry.
Script:
global.property["arr"] = array["Bread", "Apples", "Cheese", "Wine", "Grapes", "Rope"];
$counter = global.property["arr"].size();
for $itm in global.property["arr"] do
$counter -= 1;
if $counter > 0 then // if not last entry in array, add a \n
widget["cont"].element["0001"].text = widget["cont"].element["0001"].text + $itm + "\n";
print(widget["cont"].element["0001"].text);
else
widget["cont"].element["0001"].text = widget["cont"].element["0001"].text + $itm;
print(widget["cont"].element["0001"].text);
end;
end;
List with printed widget text throughout the loop:
List with commented out printed widget text throughout the loop:
Are there any errors in the in-game debug console or external console window?
Provide the steps necessary to reproduce the issue:
- Create a widget with a text label.
- Put this code on Startup.
- Test first with the print commands...when showing the widget, it will be a formatted list.
- Test again by commenting out the print commands, and show the widget to see the last item only. (rope)
Provide a download link to the bare bones project (strongly recommended if it's an in-game issue, since this helps significantly when attempting to reproduce it; the report will also be given more priority in this case):