Glitch with : character in script editor

Started by TmanDaCool1, January 16, 2015, 12:03:30 PM

Previous topic - Next topic

TmanDaCool1

Help? Whenever I put in the character ":" in the script editor and run the script, it only runs up to that point, then stops. Upon further inspection, I see that it creates a new script, called whatever was below the : and with the contents of the rest of the script. Here's a recreation:

Script list:
foo

Script contents:
reply(3)
Hi!
This is a test script:
I sure hope this works!

delay(30)

sad

reply(1)
...this isn't going to work, is it?


Run the script, and it only runs
"Hi!
This is a test script:"
and stops. Go back into the script editor...

New script list:
I sure hope this works!
foo

Script contents:
reply(3)
Hi!
This is a test script:


New script contents:


delay(30)

sad

reply(1)
...this isn't going to work, is it?


What's with this random separation?  :victoria:

Dav999

That is because anything with ":" at the end of a line is seen as the name of the next script, that is how the scripts are stored in the level file.

You could try adding a space after the colon or moving the words around in such a way that a colon is not at the end of a line, but in general it's not recommended to use colons in scripts. (I don't know how stable it is to include colons anywhere on a line but as the last character.)

allison

Quote from: Dav999 on January 16, 2015, 01:20:06 PM
That is because anything with ":" at the end of a line is seen as the name of the next script, that is how the scripts are stored in the level file.

You could try adding a space after the colon or moving the words around in such a way that a colon is not at the end of a line, but in general it's not recommended to use colons in scripts. (I don't know how stable it is to include colons anywhere on a line but as the last character.)
Putting colons anywhere on a line but the last character is perfectly stable.

This bug almost certainly won't be fixed, since it's caused by the way the scripts are stored in the level file; changing it would break compatibility.