Comparing picture + word?
by Gotland_0001 · in Torque Game Builder · 12/30/2007 (6:27 am) · 0 replies
I have been trying to solve this problem for a long time now and I don't know what to do anymore. I am trying to compare words I put in into a guitexteditctrl with a picture I've loaded into a SimSet.
I've made a random function to show the pictures from my SimSet to the scenegraph:
function word()
{
%i = getRandom(0, 2);
$spells.getObject(%i).addToScene($graph);
$spells.getObject(%i).visible = true;
}
when the picture such as 'blaze' shows up on the scenegraph you are suppose to enter the right word and in this case 'blaze' but my function won't work.
function matchBlaze()
{
if($Object.type $= "blaze"
&& $text $= "blaze")
{
echo("BLAZE: DING!");
blaze.removeFromScene();
word();
}
else
{
echo("BLAZE: WRONG WORD");
}
}
All I get is Wrong word. Can someone help me?
-Tsukiya
I've made a random function to show the pictures from my SimSet to the scenegraph:
function word()
{
%i = getRandom(0, 2);
$spells.getObject(%i).addToScene($graph);
$spells.getObject(%i).visible = true;
}
when the picture such as 'blaze' shows up on the scenegraph you are suppose to enter the right word and in this case 'blaze' but my function won't work.
function matchBlaze()
{
if($Object.type $= "blaze"
&& $text $= "blaze")
{
echo("BLAZE: DING!");
blaze.removeFromScene();
word();
}
else
{
echo("BLAZE: WRONG WORD");
}
}
All I get is Wrong word. Can someone help me?
-Tsukiya