How do I check a for specific text in a field?
by Nicolai Dutka · in Torque Game Engine · 09/13/2007 (7:41 pm) · 4 replies
I think just by reading the following code in my console.log file, you should be able to see what I am trying to do. None of this works though... does anyone know why?
$leader is referring to the currently controlled player character and ALL of the players have a ".className" added to them on creation.
Thanks!
==>if( $leader.className == "warlock" ) echo("word");
word
==>if( $leader.className == "warlock" ) echo("word");
word
==>if( $leader.className == "Warloc" ) echo("word");
word
==>if( $leader.className == "Wizard" ) echo("word");
word
==>if( $leader.className $= "Wizard" ) echo("word");
==>if( $leader.className $= "warlock" ) echo("word");
==>if( $leader.className $= "warlock" ) echo("word");
==>if( $leader.className %= "warlock" ) echo("word");$leader is referring to the currently controlled player character and ALL of the players have a ".className" added to them on creation.
Thanks!
#2
09/14/2007 (1:15 pm)
As you can plainly see by the 3rd to last and 2nd to last lines in that code, I already tried that. It isn't working.
#3
$= is the operator you want to use, not == or %= (%= is not an operator).
09/14/2007 (1:27 pm)
Then echo out the values of $leader.className yourself (or use Torsion and put them on a watch), and find out what values are actually being compared.$= is the operator you want to use, not == or %= (%= is not an operator).
#4
So I am doing it right... I guess I'll have to just mess with it some more...
09/14/2007 (2:58 pm)
I actually am trying these on my own with the console. I only copy/pasted from the console.log because it was faster. :PSo I am doing it right... I guess I'll have to just mess with it some more...
Torque Owner Stefan Lundmark
That's correct. If it doesn't return true then there's something wrong with your className.