Game Development Community

CommandToServer help

by Howard Dortch · in Torque Game Engine · 07/26/2008 (7:06 am) · 2 replies

For the basic function :

commandToServer('DoSomething');

DoSomething is in single quotes as a tag. I need to make this a variable. So far can't get it to work.


%tag = 'MyFunc';

commandToServer(%tag); doesn't work



%func = "MyFunc";

commandToServer("'"@%func@"'"); doesn't work


anyone know a way to make this call a variable ?

#1
07/26/2008 (9:23 am)
That would be messy. Why not directly use an if or switch statement instead? (Quick ref., just in case)

Here it is some info that may be useful to you anyway: TS Functions - Networking

Try:
%tag = addTaggedString("MyFunc");
#2
07/26/2008 (10:55 am)
I thought it would be easier to do one line of code versus 255.

addTaggedString worked, thanks..