I keep getting the error:
EC line 506: Invalid expression at char 27, expected OPERATOR or CLOSE_PARENTHESIS, was: STRING [“1”]
I’ve looked at line 506 which is the one that says *elseif (bandithos = “alive”) and (lol = “2”). Don’t see a problem…
Looks like your text has the quotes formatted as curly quotes – if you change them to plain quotes “” does it affect the problem?
Edit: nvm, looks like that’s just forum formatting.
Also, it looks like lol is a numeric variable, so you can check it without using quotes at all – just *if lol = 1, not *if lol = "1".
If you post your code as “preformatted text” (an option in the forum post settings) it’ll keep the indents and other features that let us pick up on bugs more easily…
Hmm. Nonobvious to me! Usually that error comes from a missing + or =, or a parentheses mistake, but all that is looking fine.
Just to check, how did you create lol in your startup.txt? As a numeric variable (*create lol 0) or a string (*create lol "0" or *create lol "" or similar)?
This might be barking up the wrong tree, but the first thing I’d try would be making it consistently numeric: *create lol 0, and take out all the quotes when you’re checking the value of lol (not just on that one line). That removes the possibility that a confusion between numeric and string variables is behind the error.
Edit: take the specific line called (506 in this case) with a grain of salt – I find that it often gets me to the right ballpark but that the actual error is slightly before or after whatever line it’s calling. And if I’ve made any bugfixes earlier in the testing session, that will often have shifted the line numbering a little one way or the other. The fact that it’s saying it ran into a string [“1”] when it wasn’t expecting to suggests that the first line to tinker with might be
Last question from me: are you sure the file you’re running tests on and the one you’re sending excerpts to us from are identical?
Sometimes errors like these can arise when e.g. you’re QTing in CSIDE while making bugfixes using another program, – so the scene file CSIDE is testing doesn’t have all the edits you’ve made in your code editor.
Yes I am sure, I make this merely for fun, so I’m not using any programs, and I test it all myself. I seem to run into quite a few “glitches” so I suppose I just have to work around, for instance in another file, it says “increasing indent not allowed on line 2014, expect 0 was 2” problem is I got rid of line 2014, and it does not even exist.
It does sound like it’s testing an older saved version of your file – seems like that’s two examples of the test finding an error you’ve already fixed. But if that’s not what’s going on, I’m afraid I don’t know what to tell you.