Scripting Issue in it2d (Was: XMLDocument stopping short.)
by Charlie Patterson · in iTorque 2D · 02/28/2013 (1:23 pm) · 8 replies
I'm updating this in the comments. I'll leave the original post here, though. And mention this is related to PUAP_SCRIPT_CHANGE:
Using iT2D as a Mac app (or T2D as a PC or Mac app), I can read in a large 150K XML file full of animation.
However, in the iPad Simulator, this file is cut short and only some of the tags are reproduced. I have traced it far enough to see that the file is being loaded in correctly, so it must be during the Parse() phase that something is going sideways.
Anyone see this?
Thanks.
Using iT2D as a Mac app (or T2D as a PC or Mac app), I can read in a large 150K XML file full of animation.
However, in the iPad Simulator, this file is cut short and only some of the tags are reproduced. I have traced it far enough to see that the file is being loaded in correctly, so it must be during the Parse() phase that something is going sideways.
Anyone see this?
Thanks.
#2
02/28/2013 (2:00 pm)
Thanks @Mich. I can see the file being fully loaded. But I'm currently looking for some limit on the parsing (in iT2D on iOS only). Alternatively, perhaps it is running out of memory during the parse? We'll see.
#3
A couple of days of debugging and it looks like there may be an instruction pointer or stack pointer problem. I added a counter in it (for debugging, you know %count++), but the code does not always increment it in iPhone only. It's like the script jumps up the stack or something. Hmm...
03/02/2013 (4:42 pm)
So this does not appear to be a memory problem. Instead I believe I'm having a TorqueScript update problem. Looks like there are even some "if iPhone" calls in the language. Oh noes! Hopefully I can find one magic change in the source code. My scripts work fine in every other context.A couple of days of debugging and it looks like there may be an instruction pointer or stack pointer problem. I added a counter in it (for debugging, you know %count++), but the code does not always increment it in iPhone only. It's like the script jumps up the stack or something. Hmm...
#4
It looks like it2d has a copy-and-pasted version of the source for the TorqueScript "evaluator". One branch is protected with #ifdef PUAP_SCRIPT_CHANGE. By turning that macro off, I got much farther and perhaps all the way to working!
Ugh. :)
P.S. What is exactly wrong with the "PUAP" branch is beyond me. It's a LOT of copied code.
03/04/2013 (3:24 pm)
Well after 4 or 5 days of digging, I worked this issue down to a confusing fail with just TorqueScript. No XML necessary. No custom code changes necessary.It looks like it2d has a copy-and-pasted version of the source for the TorqueScript "evaluator". One branch is protected with #ifdef PUAP_SCRIPT_CHANGE. By turning that macro off, I got much farther and perhaps all the way to working!
Ugh. :)
P.S. What is exactly wrong with the "PUAP" branch is beyond me. It's a LOT of copied code.
#5
03/04/2013 (3:41 pm)
I can save you much time and headache by saying "Abandon Ship!" The hacks and PUAP plague in the source is so counterproductive that it is best to skip it entirely.
#6
I'm curious if there a seminal forum post I missed over the last year on some of the best practices? I've seen the porting guide and the official release notes, but I had avoided any more conversations less I get confused with all my other work on TGB.
For now, I left in the other PUAP_* macros, but canceled the SCRIPT_CHANGE one and was surprised when things started worked. I had assumed some of that may be necessary for iOS.
P.S. It may help to know what PUAP stands for. My best guess... Project Universal App Project. :)
03/04/2013 (3:46 pm)
Hahaha! Well *now* you tell me. If I understand, you do want me to turn "off" the PUAP stuff? It is on by default I'm 90% sure.I'm curious if there a seminal forum post I missed over the last year on some of the best practices? I've seen the porting guide and the official release notes, but I had avoided any more conversations less I get confused with all my other work on TGB.
For now, I left in the other PUAP_* macros, but canceled the SCRIPT_CHANGE one and was surprised when things started worked. I had assumed some of that may be necessary for iOS.
P.S. It may help to know what PUAP stands for. My best guess... Project Universal App Project. :)
#7
03/04/2013 (4:28 pm)
Pick Up And Play. It's the company that originally worked on the iOS port of TGB. Disabling any of the macros will result in other problems, such as memory leaks or full on crashes. It's a lose, lose scenario when compared to the new T2D MIT.
#8
Well I'm currently, desperately trying to get my game (demo) up on iOS so I can pack it on ice for a while. :( Time to go get a paying gig but to leave it in a state to show it off and cross my fingers for interest. So that's why I'm connecting to what I can get running the easiest, including any subclasses of scene objects and the like.
03/04/2013 (4:40 pm)
Oh!? Skip it2d entirely? Aaggghhh!Well I'm currently, desperately trying to get my game (demo) up on iOS so I can pack it on ice for a while. :( Time to go get a paying gig but to leave it in a state to show it off and cross my fingers for interest. So that's why I'm connecting to what I can get running the easiest, including any subclasses of scene objects and the like.
Employee Michael Perry
ZombieShortbus