Game Development Community

Pass variables messing up.

by Austin Reynolds · in Torque Game Builder · 10/05/2008 (10:11 am) · 5 replies

Here is what im doing

commandToServer('InitClient','Austin');

on the server

function serverCmdInitClient(%lien, %name)
{
echo("in Init client - " @ %name @ " - " @ %client);
}

output from that is messed up some how....

"in Init client - 6 Austin - 1305"


where the heck is it getting the "6 " from couldn't figure out why my simple if statement wasn't working and its because that "6 " is getting passed with it. Its not always 6 either it can be 7 or 8 so far from what Ive seen.

Any thoughts?

#1
10/05/2008 (10:12 am)
Whats the different between ' and " and when you should use them.

If I do commandToServer('InitClient',"Austin");

it works fine, if I do

commandToServer("InitClient","Austin");

wont run because it must be a "tag".
#2
10/05/2008 (12:44 pm)
A tagged string is a string in single quotes, Torque does some network optimization for tagged strings, it sends the whole string once but then assigns it an id, then future sends of that string only send an id. commandToServer/commandToClient takes a tagged string as the first parameter, but thats really the only place tagged strings are used that I'm aware of.
#3
10/05/2008 (1:58 pm)
Ahh ok that makes sense. James your on top of your stuff huh? I think you have been the one to answer every question I have had so far.
#4
10/05/2008 (2:03 pm)
That's because GG sends me a check each month with $1 for each question answered.
Ok not really, but maybe that's not a bad idea... *wink* @ GG
#5
10/05/2008 (2:04 pm)
Haha. youd be making more then some of there employees with the rate you have answered mine.