Game Development Community

onTouchDown doesn't have object id in %this ?

by Nic Biondi · in iTorque 2D · 02/15/2012 (9:44 pm) · 7 replies

Hello, I have the following code. All the parameters passed in are empty when I click on it so I can't access the object that was clicked. Is this a known error, or am I just a bone-head? I've used similar things in onmousedown and never had issues.
thanks!
-nic


function loadLevelObject::onTouchDown(%this, %touchID, %worldPos)
{
schedule("200",0,"startGame",%this.levelName);
}

#1
02/15/2012 (11:32 pm)
Have you made an object called loadLevelObject ?

%this should hold the id for that.

eg:

$LOADLEVELOBJECT = new ScriptObject( loadLevelObject ){
// any dynamic variables here
};

then called using $LOADLEVELOBJECT.onTouchDown(%touchID, %worldPos);

something must exist for it to have a value for it.
#2
02/20/2012 (8:34 pm)
I am experienceing the same issues on numerous functions everywhere in iTorque 1.5. Not just touchdown, I have been using Torsion and see either empty ID's or weird characters when trying to "see" what my variables are for debugging. I have given up at the moment because I just can't use the product.

I have even inserted statements like this on many calls:

if (%this $= "")
return;

This has actually helped me, if the offending call is repeated the ID for %this is "sometimes" now magically there!

On iTorque 1,4 and TGB 1.7.6 I never had any debugging issues. Not sure if the latest load level optimizations in 1.5 are the cause. I am hoping somebody figures out what is going in.

I have submitted another example repro case using the Rainy Day tutorial.

See Torque Game Engine >> Bug Submissions <Torsion Debugging in iTorque2D_1.5 >
#3
02/22/2012 (11:47 pm)
iT2D 1.5 removed networking and from what I recall also aspects of the Telnet integration, so I am not too surprised that it no longer works with Torsion which 100% relies on the Telnet support, it has no other capabilities of Debugging and Verifying stuff at all actually.
#4
02/24/2012 (3:21 am)
Wow. I haven't used 1.5 but if this is the case then I'm staying away from 1.5 for now. These are the kinds of problems that I can't afford to run into.
#5
02/29/2012 (8:44 pm)
That explains it! At last I have a reason for my insanity while using Torsion with 1.5.

I wonder how much work it would be to recode the Telnet support back into 1.5? Or, has too much support been removed and it would have to be implemented from scratch???
#6
03/01/2012 (6:54 am)
Debugging via Torsion still "works" in 1.5. You can launch a game from Torsion, which will connect via Telnet and communicate. The problem is that there is a stack corruption. This is also related to a sporadic crash in the editor when shutting down, as well as varied call stack trace differences when debugging a crash in Debug mode. The reproduction case can differ between person to person, as it all depends on what script commands are being pushed and how many objects are being allocated. We have two people looking into the problem while I oversee their progress. All signs point to PUAP code or code written to counter PUAP macros. We should have a final solution ready for 1.5.1.

A future version beyond 1.5.1 will have all PUAP code disabled or removed to accommodate system overhauls.
#7
03/01/2012 (9:11 pm)
Thanks for the update!