Author Topic: Having issues with RageQuit code.  (Read 1798 times)

Is 'MsgError' actually a function?

also what are you returning when you do?:
Code: [Select]
return;
Maybe that's confusing it?
return; ends the function lol.

MsgError is a string which plays a sound lol.
Learn about this stuff before trying to help please.

call setModpaths(getModpaths()); or discoverFile("add-ons/script_ragequit.zip"); before executing it if you modify files in a zip. Otherwise it will only read the file to the old length and cut off the rest.
Yeah, I had it in a folder because I thought I was done coding it then I went to test it, so didn't do setModPaths(getModPaths));

Thanks zeb, also nexus, I normally don't put them in .zips, for wip code I put in base/whatever.cs so yeah.

Yeah, I had it in a folder because I thought I was done coding it then I went to test it, so didn't do setModPaths(getModPaths));
That's weird. Files not in a zip should work without calling that.

That's weird. Files not in a zip should work without calling that.
No no, I didn't mean it like that, I had it in a zip, my bad.

Anyway I finished it, thanks I guess, I haven't coded since like june so I forgot a lot of things.

It's a string. Stop trying to help.
It's actually a tagged string.

The problem is that you have activatePackage("Ragequit"); instead of activatePackage(Ragequit);

Please tell me how you think that could possibly break anything.

Please tell me how you think that could possibly break anything.
Calm down, he just thinks that's a problem because he's always seen activatePackage called without quotes because that's a fairly standard thing in add-ons despite the fact that it's technically incorrect since packages aren't objects. When you see something done in all cases then see a case where that isn't done and the script doesn't work, you assume that's the problem.

AFAIK, strings work without quotation marks if they are only one word. ActivatePackage can only accept one word, so it doesn't matter if you have them or not.

AFAIK, strings work without quotation marks if they are only one word. ActivatePackage can only accept one word, so it doesn't matter if you have them or not.

It does matter though, because if you have an object with the same name as the package, there's a chance it will pass the object's ID rather than the name to the function.

Strings work without quotation marks if they're valid identifiers. The main problem with doing that though is that it's case-insensitive (the first seen occurrence's casing will be used, IIRC).

It does matter though, because if you have an object with the same name as the package, there's a chance it will pass the object's ID rather than the name to the function.

Nope, not at all. Object names are not converted into IDs unless you actually call a function on them.

Nope, not at all. Object names are not converted into IDs unless you actually call a function on them.

I guess Torque is less dumb than I'd thought!

It is, regardless, poor practice to leave strings naked. Just because it "works" doesn't mean you should do it or depend on it.


Keep in mind that the whole conversion process is dumb.

https://github.com/bam-org/meta/blob/master/TorqueScript%20quirks.md#very-allowing-string---number-casting

You should allow line comments in those repos.
edit: Apparently github only allows that in commits, not in the actual source.
« Last Edit: February 15, 2014, 02:18:31 PM by Greek2me »