You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://code.google.com/archive/p/lslforge/issues/30
Posted on Mar 11, 2013 by Happy Hippo
What steps will reproduce the problem? 1. Create a function that uses the 'conditional' hack to change states, like this:
bugstate() { if (TRUE) state otherState; }
What is the expected output? What do you see instead? Expected output: a warning about changing states in global functions. Observed: The error "state changes not allowed from this context" - LSLForge Problem This prevents the .lsl script from being assembled.
What version of the product are you using? On what operating system? Linux Mint
Please provide any additional information below.
Comment 1
Posted on Apr 17, 2014 by Swift Horse
LSL wiki says: User-defined (global) functions cannot change a script's state. The compiler will throw the error 'ERROR: Global functions can't change state'. Note: Previously, global functions could change state in the body of a simple 'if' statement; this "workaround" no longer works. (from http://wiki.secondlife.com/wiki/State) So it's not a issue.
Comment 2
Posted on Apr 17, 2014 by Happy Hippo
That wiki remark was added on 6 june 2010. I appears to me that in practice the LL wiki is not correct on this.
At the moment, april 2014, this 'hack' still works. Disabling it would break a lot of existing code, so it's unlikely LL will change this in the near future without explicit reason.
Comment 3
Posted on Apr 18, 2014 by Swift Horse
I remember it didn't work in beta grid before, but it seemed my misunderstanding. It worked today in main grid. And I found for, while and do while statement allow this hack. Are there any other cases? It's very strange to inhibit state changing in function, it's not a technical problem, but this is not a place discussing it. There are 3 points to fix it.
How LSLForge should work
How to change LSLForge compiler
How to change LSLForge debugger
For 1., we need to research all cases to allow state change in global functions. (It's a troublesome task to implement such a buggy spec.) For 2., I made some patches for LSLForge compiler but I don't understand to show warnings yet. And 3., I haven't read around LSLForge debugger yet, need some time to learn it.
I'm not sure when I can finish it, but not impossible. Wait for a while...
The text was updated successfully, but these errors were encountered:
https://code.google.com/archive/p/lslforge/issues/30
Posted on Mar 11, 2013 by Happy Hippo
What steps will reproduce the problem? 1. Create a function that uses the 'conditional' hack to change states, like this:
bugstate() { if (TRUE) state otherState; }
What is the expected output? What do you see instead? Expected output: a warning about changing states in global functions. Observed: The error "state changes not allowed from this context" - LSLForge Problem This prevents the .lsl script from being assembled.
What version of the product are you using? On what operating system? Linux Mint
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: