Amusement with tags
by Ian Omroth Hardingham · in Torque Game Engine · 04/29/2007 (7:23 am) · 1 replies
Hey guys.
I want a clientCmd to be able to take a tag from the server (thus lowering bandwidth usage) and then display it in a gui. I also want it to deal with cases when it's been sent a string rather than a tag. With the help of James Urquart, this is the best way I found to do it:
Is this really the best way? Well, we found it amusing anyway.
Ian
I want a clientCmd to be able to take a tag from the server (thus lowering bandwidth usage) and then display it in a gui. I also want it to deal with cases when it's been sent a string rather than a tag. With the help of James Urquart, this is the best way I found to do it:
function unTag(%str)
{
%tag = getTag(%str);
// if they're equal, it's not a tag it's a string
if (%tag $= %str)
return %str;
else
return detag(getTaggedString(%tag));
}Is this really the best way? Well, we found it amusing anyway.
Ian
Associate Orion Elenzil
Real Life Plus
note that tagging strings only saves you bandwidth if you're sending the same string to the same client multiple times.