Gekko [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=24887 I can't set a variable in a for all loop :( <p>Hi devs,</p> <p>I'm tryin' to code a <a href="https://www.youtube.com/watch?v=X4aOHQxbJ9o">Magical Drop</a> demake, and currently i'm doing the pull mechanic, but in the for loop where i get all the drops with the same color i can't set them to blank (value = 5, the blank sprite slot). It's like it doesn't read that line at all :/</p> <p>Here is the snippet, in case someone comes up with something.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> function drps_by_v(c,v) local ds={} for d in all(c) do if d==v then add(ds,d); d=5; -- here i set them to blank elseif d~=5 and d~=v then return ds; end end return ds; end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>where &quot;c&quot; is for column of the player board and &quot;v&quot; the first drop value of the column (to get all consecutive same drops).</p> <p>Lots of thank in advance! :D</p> https://www.lexaloffle.com/bbs/?tid=31423 https://www.lexaloffle.com/bbs/?tid=31423 Sat, 16 Jun 2018 17:38:34 UTC