Author Topic: Error - Adding variables to a message. More errors!  (Read 2546 times)

The reason it was syntaxing before was because it was a read-only file, for me atleast.

Found it within 5 seconds.
Code: [Select]
^^%parent = parent::onClientEnterGame(%client)
You forgot the ; at the end of the line. Always look at the first few lines above were the console says there's an error.

d'oh

adp: Well, this was the final reason why the .cs didn't load. Thanks.

adp2: New error.

Code: [Select]
Executing Add-Ons/Server_setName/server.cs.
Add-Ons/Server_setName/server.cs Line: 60 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^^messageClient(%client,'',"\c6This is currently a work in progress.");
^}
^function serverCmdmessagesent(%client,%message,%name)
^{
^^%parent2 = parent::serverCmdmessagesent(%client,%message,%name);
^^if(isFile("config/server/names/"@%blid@".txt"));##
##
^^{
^^^%file = new FileObject();
^^^%file.openForRead("config/server/names/"@%blid@".txt");
^^^%name = %file.readLine();
^^^%file.close();
^^^%file.delete();
^^^messageAll('',"\c4"@%name@"\c6: "@%message);
^^}
^^else
^^{
^^^messageClient(%client,'',"\c6You cannot chat. Type \c4/setname [name]\c6 to set your name.");
>>> Error report complete.

Apparently I'm not allowed to type enter. :/
« Last Edit: May 09, 2013, 07:15:20 PM by Achoo »

Syntax errors are usually before where it indicates, that's just when it stops making sense to the compiler.

So when ever you get a syntax error, try to look above the error.

Wordpad
Don't use Wordpad for coding. That is for making documents and is like a stripped-down version of MS-Word. It adds formatting stuff to the files that can cause problems.

You should use either Notepad, Notepad++, Sublime Text, or TorqueDev. (or some other editor that isn't WYSIWYG)


Don't use Wordpad for coding. That is for making documents and is like a stripped-down version of MS-Word. It adds formatting stuff to the files that can cause problems.

You should use either Notepad, Notepad++, Sublime Text, or TorqueDev. (or some other editor that isn't WYSIWYG)

I don't. I use notepad and notepad++.

That doesn't answer my question.

By re-boot do you mean restarting BL? if so then yes.




In that code, you put a ; after the if

Don't use Wordpad for coding. That is for making documents and is like a stripped-down version of MS-Word. It adds formatting stuff to the files that can cause problems.

You should use either Notepad, Notepad++, Sublime Text, or TorqueDev. (or some other editor that isn't WYSIWYG)
Wordpad can be useful for showing forgeted up symbols that are invisible in other editors

Wordpad can be useful for showing forgeted up symbols that are invisible in other editors
But the symbols wouldn't even be there if you used a different editor in the first place :)

But the symbols wouldn't even be there if you used a different editor in the first place :)
I don't know, for me invisible symbols appear for no reason somethimes if i open a zipped .cs file with sublime if it was created with notepad and I have to use wordpad to delete them (because no other editor except wordpad and the torquescript compiler see them)

It's not a hidden symbol there's a ; there that shouldn't be..?

I don't know, for me invisible symbols appear for no reason somethimes if i open a zipped .cs file with sublime if it was created with notepad and I have to use wordpad to delete them (because no other editor except wordpad and the torquescript compiler see them)

.. what? Wordpad is what creates them. That's the least likely editor able to see them. They show up just fine in Notepad and Sublime Text 2.
« Last Edit: May 11, 2013, 06:55:30 AM by Port »

It's not a hidden symbol there's a ; there that shouldn't be..?
That's the new error, there were hidden symbols before

I don't know, for me invisible symbols appear for no reason somethimes if i open a zipped .cs file with sublime if it was created with notepad and I have to use wordpad to delete them (because no other editor except wordpad and the torquescript compiler see them)

.. what? Wordpad is what creates them. That's the least likely editor able to see them. They show up just fine in Notepaf and Sublime Text 2.
Well, for me there were tons of crazy symbols (such as ý and â) in the file and they only showed up in the console, and in wordpad.

I've been scripting things in TorqueScript for over 6 years and I've never had a problem with odd characters like this

But the symbols wouldn't even be there if you used a different editor in the first place :)

Here's the problem:

Random symbols. We know that.

How it started:

For me, Notepad was blocked accidentally. I told my parents and they did nothing. I already had the code on Google drive and downloaded it as a .txt. I changed the type to .cs, created a .zip folder for it and put it into Blockland. Then this happened.

Hope this explains somewhat of how it happened.

Here's the problem:

Random symbols. We know that.

How it started:

For me, Notepad was blocked accidentally. I told my parents and they did nothing. I already had the code on Google drive and downloaded it as a .txt. I changed the type to .cs, created a .zip folder for it and put it into Blockland. Then this happened.

Hope this explains somewhat of how it happened.
Here's how you get a quality editor:

Step 1:
Download sublime text 2
Step 2:
Install it
Step 3:
Download TorqueScript package for sublime
Step 4:
Extract zip to AppData/Roaming/Sublime Text 2/Packages
Step 5:
Right click a blockland .cs file and make windows always open .cs files with sublime
Step 6:
Click the C# at the bottom right corner
Step 7:
Click "Open all with current extension as..." at the top of the menu
Step 8:
Select "TorqueScript"