If a condition is checked out of synch it can miss it and get stuck.
A good example is how while loops get stuck if you don't add a wait at the end of it and if you warp time the wait may not be enough.
Having a conditional block at the end of a loop can cause multiple executions of the condition at once.
View |
10 Comments
- Log in to leave a comment
-
Dev AndrewGarrison
I'm fairly certain I've found what's causing this issue. It appears to happen when an if, else if, or else is the last instruction in a repeat or while block. The fix will be in the next update. Thanks again, @pedro16797!
-
Dev AndrewGarrison
@Nethereal Can you upload a bug report with the craft demonstrating the issue?
-
7,237 Nethereal
I've noticed some weird behaviour as well. Seems to correlate with tick rate / part count.
I've had tick rates work @ 1ms, but output of of some variables shows 0 in display, eventhough the display node is AFTER the variable value set... -
-
Dev AndrewGarrison
@pedro16797 That's interesting. The next time you see that happen, can you upload a bug report so I can take a look at the sandbox and examine the craft in flight while its in this state?
-
Dev Pedro
@AndrewGarrison I think I've tried all, even "while true". If the skipped tick happens to be right when the loop goes from the end to the start the protram freezes there
-
Dev AndrewGarrison
Thanks for the additional info. Stage activation cannot happen during time warp. I will change the Activate Stage instruction to force the time mode to Normal before executing.
What breaks with loops exactly? What condition are you checking for that doesn't work?
-
Dev Pedro
@AndrewGarrison a lot of programs break, even with wait 1 they break under time warp. I'm now using kind of a trick slowing time before executing important things like loops or stage activations (those can activate all stages at once it you stage during a skipped tick)
-
Dev AndrewGarrison
Which part of your program is having this problem? I do recommend having at least a Wait 0 seconds at the end of a while loop.
@AndrewGarrison I was about to share you the craft and that was my guess after testing it today (sorry, yesterday I forgot to make it). I'm glad that's fixed :)