Author Topic: What does this error message actually mean?  (Read 1303 times)

I have been wondering for the longest time what the deal is with the
"<input> (#) unable to find object: ' ' attempting to call function 'yourfunctionhere' "
error message, why is it that alot of times no matter what you do, a method that should be perfectly valid gives this error? what does it mean - object ' ' , does this mean there is information missing? like for instance:
Code: [Select]
%client.player.setInvincibleMode( 1.0 , 0.2 );I know this is supposed to be a valid method, but in blockland you get that god awful message telling you that you are an idiot. :/

if(%answer == serious)
{
loveforever();
cherishforever();
}
else
{
F***off();
}

It means:
unable to find object
IE, the object doesn't exist.

In your example, perhaps the player died and hasn't yet respawned.
To avoid this, you could do something like this:
Code: [Select]
if(isObject(%client.player))
    %client.player.setInvincibleMode(1.0,0.2);
« Last Edit: September 11, 2011, 05:52:14 PM by Headcrab Zombie »

ok, but what about when player has not died, and IS spawned I.E. the situation I performed that method in?

You probably didn't define %client.
Post the script that is giving the error.

Code: [Select]
function ServerCmdTestinvc() //I am pretty sure %client is optional in here, but I tested with and without.
{
%client.player.setInvincibleMode(1.0,0.2);
}

No, %client is not optional

Code: [Select]
function serverCmdTestinvc(%client)
{
    %client.player.setInvincibleMode(1.0,0.2);
}

You may get an error with this still, but a different error. setInvincibleMode is not a default function, so if that's not defined somewhere it won't work

Code: [Select]
//I am pretty sure %client is optional in here, but I tested with and without.
No, %client is not optional
because if you're going to use a function that includes %client and it's never defined then it won't know what it's doing.

No, %client is not optional

Code: [Select]
function serverCmdTestinvc(%client)
{
    %client.player.setInvincibleMode(1.0,0.2);
}

You may get an error with this still, but a different error. setInvincibleMode is not a default function, so if that's not defined somewhere it won't work
nope, I get the same error I described above, trust me, either way, I heard that setInvincibleMode was default, but even if I was wrong about that, dump(); is default isn't it?
why is it that
Code: [Select]
function ServerCmddumperoo(%client)
{
%client.dump();
}
gives me
unable to find object: ' ' attempting to call function 'dump'
with serverCmds the firstvar is the client calling it right? its been a while since I have done any coding, but I don't think I remembered THAT wrong...

You're doing something wrong then, because their is nothing wrong with either of those functions.
The only thing I can think of is that you're trying to call the function by typing 'serverCmdTestinvc();' on the console

You're doing something wrong then, because their is nothing wrong with either of those functions.
The only thing I can think of is that you're trying to call the function by typing 'serverCmdTestinvc();' on the console
nope, I did both
commandtoserver(Testinvc());
AND typed /Testinvc into chat
neither works.
Have you tried them on your copy of Blockland? Maybe they were locked? Should I redownload or something?

Ok, not necessarily fixed, because I stilldont get what the problem was, but I did it the overcomplicated way, and I got dump(); at least working-

Code: [Select]
==>function ServerCmdasdf(%client) { echo(%client);}
5998
==>function test(%client) { %client.dump(); }
==>test(5998);
//craploads of dumped info
so I did find a way around the situation, but I see NO REASON WHATSOEVER FOR WHY I HAD TO DO THIS! I should be able to just
function ServerCmdasdf(%client) { %client.dump();}
right?

servercmdTestInvc(findClientByName(wizzle));
commandToServer('testInvc');
(in chat:) /testInvc


All of these accomplish the same thing, and in fact the last two are functionally identical.

I know... but whats with that darned error???

In exactly what way are you calling servercmdDumperoo?

function servercmdDump(%me)   //the first argument of a server command is ALWAYS the client.
{
   %me.dump();
}

[in chat:] /dump

xalos... did you read the first few posts? that particular question is answered, AND i state hatthe first argument in a server command is the client/caller.