Game Development Community

Torsion Debugging in iTorque2D_1.5

by Phillip Zeto · in Torque Game Engine · 01/03/2012 (8:59 pm) · 0 replies

I am using the RainyDay Example for testing purposes.

To make debugging easier I removed all the plants in that example that get watered except for ONE.

Running Torsion on the Rainy Day example and placing a break point on this callback (or any, I just use this one for simplicity)

File:plantGrowthBehavior.cs line 177

// This callback function is envoked when an object
// leaves the trigger zone
// %this - The current trigger
// %object - ID of the object that has left the zone
function WateringBehavior::onLeave(%this, %object)
{
%object.endWatering(); <-------- Place Break Point on this line
}

Step 1:
Move the cloud over the plant and let the plant grow (animation runs).

Step 2:
Move the cloud off the plant and the callback is triggered. (line 177)
At this point if the %this parameter is evaluated the object should have a valid ID. In this case it is undefined or "". So is the %object.

Step 3..
If you�re lucky in step 2 and the ID is valid. Just repeat steps 1 and 2 a few times and it should fail. At least on my machine.

Also once I have a failure, the animated RainDay example is really broke and leaves the flower up even after watering. Sometimes the animated rain will also stop...

I believe this is a Torsion thing, because the Demo will run fine as long as I don�t debug it.