Closed KarmaPenny closed 8 years ago
Do you have the specific script you were encountering this issue in? There should be no issues with it, but you are using a const
on the ScriptName
value, which I don't actually know the use of at the moment.
Maybe const means immutable script instance? Then it's not weird as test = 5
attempts to modify it, but I doubt that the code should be compile-able
I'll create an example mod for you when I get a chance. On Feb 25, 2016 8:24 PM, "SilverIce" notifications@github.com wrote:
Maybe const means immutable script instance? Then it's not weird as test = 5 attempts to modify it, but I doubt if the code should be compile-able
— Reply to this email directly or view it on GitHub https://github.com/Orvid/Caprica/issues/4#issuecomment-189070361.
Going to be out of town this weekend so probably won't be until next week On Feb 25, 2016 9:33 PM, "Cole Robinette" robinette.31@gmail.com wrote:
I'll create an example mod for you when I get a chance. On Feb 25, 2016 8:24 PM, "SilverIce" notifications@github.com wrote:
Maybe const means immutable script instance? Then it's not weird as test = 5 attempts to modify it, but I doubt if the code should be compile-able
— Reply to this email directly or view it on GitHub https://github.com/Orvid/Caprica/issues/4#issuecomment-189070361.
Hmm actually I just tried things without that const flag and it appears to be working. Sorry about that. The const flag came from one of the vanilla scripts I copied and I didn't notice it at all. On Feb 25, 2016 9:43 PM, "Cole Robinette" robinette.31@gmail.com wrote:
Going to be out of town this weekend so probably won't be until next week On Feb 25, 2016 9:33 PM, "Cole Robinette" robinette.31@gmail.com wrote:
I'll create an example mod for you when I get a chance. On Feb 25, 2016 8:24 PM, "SilverIce" notifications@github.com wrote:
Maybe const means immutable script instance? Then it's not weird as test = 5 attempts to modify it, but I doubt if the code should be compile-able
— Reply to this email directly or view it on GitHub https://github.com/Orvid/Caprica/issues/4#issuecomment-189070361.
Well, if I was letting you compile without errors then that's an issue, I'll check and see what adding that as an error does.
Trying to do this will now produce an error when you try to assign to a value on a const script.
It appears that using script wide variables causes the script to not function. It compiles without error but when called in game will not perform any action.
You can actually de-compile a working vanilla script that contains a script wide variable then recompile it without making any changes and it will no longer function.
Here is an example that compiles but does not function
Remove the script wide variable and suddenly it does work