Author Topic: Coding Help - Addon Not Working  (Read 1645 times)

« Last Edit: February 07, 2016, 04:01:28 PM by shawn6183 »


Link above was for another topic
« Last Edit: February 06, 2016, 09:28:58 PM by shawn6183 »

Explain what the code is supposed to do so we know how to help you fix it. As far as anyone here knows, this is exactly what the code was supposed to do. "Get a certain status" is kinda vague...

After looking over it again, I might know what's causing you trouble. In your if statements, you are checking to see if the variables (i.e. %member) are equal to the integer 1. However, since you read the line from a text file and used getWord(), the value of %member is a string, which means that if will never run. Changing "==" in all of those if statements to "$=" should fix it. I haven't done TorqueScript in a while, but I believe that's correct.

Simply from a management standpoint, consider closing your file once you're done reading it. Also, why are you setting %id to the client's BLID and then almost immediately setting it to a value from the text file?

i feel like you could considerably simplify this with just using global variables, but i guess you want an easily-readable txt list

Your function doesn't ever get called.
schedule(100, 0, RankCheck, %this);
function GameConnection::RankCheck(%this)


To schedule a method, you need to use
%this.schedule(100, RankCheck);

Or schedule(100, %this, RankCheck);

Or schedule(100, %this, RankCheck);

Tried this, it doesn't work.

Or schedule(100, %this, RankCheck);
Pretty sure that won't work.
I'm fairly certain this is how the second argument works:
In 100 MS, if %this still exists, then function rankCheck(); is called.

« Last Edit: February 07, 2016, 03:59:08 PM by shawn6183 »

So look at the console and see what went wrong while executing it.

« Last Edit: February 07, 2016, 03:59:19 PM by shawn6183 »

Close and delete are methods, so you need to add ()

« Last Edit: February 07, 2016, 03:59:30 PM by shawn6183 »

Are your files in a zip? You should use a folder while working on the add-on.

Blockland doesn't realize the file size changed inside the zip, you added 4 new characters so it missed the last 4 instead.