Problems With The Strategy Article on TDN
by Chip Lambert · in Torque Game Builder · 06/21/2006 (7:52 pm) · 4 replies
Hey guys, I've been playing around with TGB for the past couple weeks and I'm loving it. Great work GG guys! I recently started trying the Strategy Genre tutorial on TDN, and I'm having trouble with mouse events. I've checked the code several times and it matches the article, however when I attempt the following:
Selections.getCount() always returns 0. Am I missing something that should be set in the testSprite's properties (I set its name, and dynamic field isSelectable = TRUE).
Any help guys would be appreciated!
Chip
Quote:
Try doing a drag selection of our object
Simply click your mouse in the top left corner (just above and to the left) of the crate, like this (note: hold your mouse down after one click).
...
Now we should do two things to test if this worked. First lets get the count of objects within the Selections object to see if it matches the one valid object we tried to select. Then we will get the name of that object in the Selections object to ensure it is our "testSprite".
...
To do this bring up the console and type this command.
echo(Selections.getCount());
Selections.getCount() always returns 0. Am I missing something that should be set in the testSprite's properties (I set its name, and dynamic field isSelectable = TRUE).
Any help guys would be appreciated!
Chip
#2
06/24/2006 (8:47 am)
Looks like you are trying to pass an invalid number of parameters to the pickLine function on line 199 of the selection.cs file. What is on that line?
#3
I don't think the pickLine function was in selection.cs. This is line 199 from that file.
I copied it straight from the TDN article.
06/24/2006 (10:39 am)
Thanks Ben.I don't think the pickLine function was in selection.cs. This is line 199 from that file.
SelectionMenu.clearItems();
I copied it straight from the TDN article.
#4
06/25/2006 (1:15 am)
Well, something is up because that code doesn't match the output from the console. At any rate, if it is claiming an invalid number of parameters then one of your inputs could quite possibly be an empty string. Try outputting each input to the pickLine function before you call it and verify that you are getting what you think you're getting.
Associate Chip Lambert
Crusader Games
I looked over it but can't find where the error is coming from. You guys have any ideas?
Thanks!