From 1.2 -> 1.4, behavior and GUI Problems
by John Sear · in iTorque 2D · 06/07/2010 (8:11 am) · 5 replies
Hi,
We're a bit behind the times, and I just wanted to move our latest project into the present day by using iTGB 1.4. We were using 1.2 before and after moving all .cs files and data elements into a new 1.4 project, we found a few problems.
Behaviors
The Problem: The behavior loads and is exec'd, I have a scene object which uses this behavior. In 1.2 it works fine, the behavior is loaded and when the level loads with the object in the behaviors addToScene() method is called.
In 1.4 however, the behaviors addToScene() method is not being called when the level is loaded and the object is added to the scene.
I have moved the behaviors folder into the scripts folder, but other than that i have not changed anything. I've spend all of today trying to get this to work and can't see any mention of changes in the documentation.
GUI
The Problem: When the GUI element is loaded using Canvas.pushDialog(levelGui); in 1.4 the mouse input stops working, when this line is commented out the mouse input works. We are using the scenewindow2D.onMouseDown() function. Again, in 1.2 this works fine without being commented out.
I hope you can help, and sorry if all of this has been talked about before.
Thanks!
John.
Edit: All of these problems are on Windows.
We're a bit behind the times, and I just wanted to move our latest project into the present day by using iTGB 1.4. We were using 1.2 before and after moving all .cs files and data elements into a new 1.4 project, we found a few problems.
Behaviors
The Problem: The behavior loads and is exec'd, I have a scene object which uses this behavior. In 1.2 it works fine, the behavior is loaded and when the level loads with the object in the behaviors addToScene() method is called.
In 1.4 however, the behaviors addToScene() method is not being called when the level is loaded and the object is added to the scene.
I have moved the behaviors folder into the scripts folder, but other than that i have not changed anything. I've spend all of today trying to get this to work and can't see any mention of changes in the documentation.
GUI
The Problem: When the GUI element is loaded using Canvas.pushDialog(levelGui); in 1.4 the mouse input stops working, when this line is commented out the mouse input works. We are using the scenewindow2D.onMouseDown() function. Again, in 1.2 this works fine without being commented out.
I hope you can help, and sorry if all of this has been talked about before.
Thanks!
John.
Edit: All of these problems are on Windows.
About the author
Recent Threads
#2
From my end, it looks like when addBehaviors() is called, the field that is being searched for is malformed. Instead of _behavior0, it starts with _behavior1613512. In fact, any time that 'avar' is being used, it is coming out incorrect.
Very strange!
06/15/2010 (5:29 pm)
Did you ever manage to find out the issues with the behaviors? I'm running into a pretty big issue (as far as I can tell) where no behaviors are loaded at all.From my end, it looks like when addBehaviors() is called, the field that is being searched for is malformed. Instead of _behavior0, it starts with _behavior1613512. In fact, any time that 'avar' is being used, it is coming out incorrect.
Very strange!
#3
It looks like the folks working on iTGB changed a few of the string methods, avar included. In platformAssert.cc, replace the avar method with the following:
06/15/2010 (5:40 pm)
That's about right, 30seconds after I post, I fix the problem.It looks like the folks working on iTGB changed a few of the string methods, avar included. In platformAssert.cc, replace the avar method with the following:
const char* avar(const char *message, ...)
{
static char buffer[4096];
va_list args;
va_start(args, message);
dVsprintf(buffer, sizeof(buffer), message, args);
va_end(args);
return( buffer );
}
#4
06/16/2010 (1:13 am)
Ahh great, thanks for that! Surprised that more people haven't had that problem. Since I had no reply I'm just back on 1.2 at the moment but if I wish to move on to 1.4 for the next project I know how to fix the behavior problems!
#5
As a reminder, please use the Bug Reporting Standard. This makes easier for us to reproduce bugs and log them in our tracker.
06/28/2010 (11:05 am)
Going to look into this.As a reminder, please use the Bug Reporting Standard. This makes easier for us to reproduce bugs and log them in our tracker.
Torque Owner John Sear
Default Studio Name
Guess it's time to trawl through my code and find out the problem :(.