Using iTGB as a static library...
by Lake Watkins · in iTorque 2D · 11/23/2009 (12:40 pm) · 21 replies
Hey, first the error:
"Game Startup Error "initializeProject' function could not be found.
This could indicate a bad or corrupt common directory for your game."
So, I'm using Torque to make an AR (Augmented Reality) game for the iPhone. In the normal iTGB framework, I've already got the camera rendering under a level built with TGB, but now I have a different problem. I'd be willing to share my camera solution with anyone that can help me solve this new problem.
From what I've read, a lot of the intensive AR functions will need to be implemented in C++, and I'd like to add my own components to the existing component system in the T2Di framework. Plus, I'll need to use a variety of other libraries (such as the ARToolKit). At the same time, I'd like to build prototypes for the games in the game builder, if not the full games themselves.
So rather than overhauling the T2Di framework, I created a new target and compiled the non-iphone specific code into a static library. I'm linking with this library in my own xcode project so that I can make local changes without conflicting with Torque. This works fine up to a point, but the game crashes when trying to load scripts. It seems like there's a dependency with the directory structure for scripts.
Does anyone know what these dependencies are? I triple checked the common directory that I'm referencing, and I know that this works with the default iTGB framework. The only change is that I'm linking with a static library instead of compiling all that code in place... has anyone dealt with this before?
"Game Startup Error "initializeProject' function could not be found.
This could indicate a bad or corrupt common directory for your game."
So, I'm using Torque to make an AR (Augmented Reality) game for the iPhone. In the normal iTGB framework, I've already got the camera rendering under a level built with TGB, but now I have a different problem. I'd be willing to share my camera solution with anyone that can help me solve this new problem.
From what I've read, a lot of the intensive AR functions will need to be implemented in C++, and I'd like to add my own components to the existing component system in the T2Di framework. Plus, I'll need to use a variety of other libraries (such as the ARToolKit). At the same time, I'd like to build prototypes for the games in the game builder, if not the full games themselves.
So rather than overhauling the T2Di framework, I created a new target and compiled the non-iphone specific code into a static library. I'm linking with this library in my own xcode project so that I can make local changes without conflicting with Torque. This works fine up to a point, but the game crashes when trying to load scripts. It seems like there's a dependency with the directory structure for scripts.
Does anyone know what these dependencies are? I triple checked the common directory that I'm referencing, and I know that this works with the default iTGB framework. The only change is that I'm linking with a static library instead of compiling all that code in place... has anyone dealt with this before?
#2
I'm also pretty certain that this isn't a problem in the scripts themselves since I got this working with the default T2Di framework. In the meantime I've been reading through the script parsing code, and as far as I can tell, everything seems consistent between the default T2Di framework and my own. It's only when it pops up with the error message that the execution changes.
11/23/2009 (1:27 pm)
Yeah, that was what I thought at first. So I checked to make sure I have the main.cs, game folder, and common folder in both my resources and the copy bundle resources groups. To be absolutely sure, I cracked open the .app and found that the resources were indeed there. I'm also pretty certain that this isn't a problem in the scripts themselves since I got this working with the default T2Di framework. In the meantime I've been reading through the script parsing code, and as far as I can tell, everything seems consistent between the default T2Di framework and my own. It's only when it pops up with the error message that the execution changes.
#3
11/23/2009 (6:15 pm)
UPDATE: To make sure I'm not crazy, I checked the package file actually being installed on the device and simulator. The necessary files are there. Then I went line-by-line through the project settings for both the T2Di framework and my own. Still no luck. And I'm blocked since I need to get this working so I can debug/test new features... (any help?)
#4
But it can just as well be related to a potential shift in your folder structure from the program root which runs up a wall when ~/ is present in scripts for paths potentially.
11/23/2009 (7:35 pm)
The original error is commonly raised by having different optimization flags in your TGB / TGBGame than you have on the iphone thus leading to incompatible DSOs.But it can just as well be related to a potential shift in your folder structure from the program root which runs up a wall when ~/ is present in scripts for paths potentially.
#5
11/23/2009 (7:50 pm)
How would I check / change the optimization flags in TGB/TGBGame? I changed the svprintf function as Sven mentioned in the data verification thread, and found that none of the functions in main.cs were recognized. So this does seem like an indication that I have incompatible DSOs, but I'm not sure if I'd still get those errors with a bad ~/ configuration.
#6
the important flag is the PUAP_SCRIPT_OPTIMIZED
if you didn't rebuild your editor and TGBGame, you must ensure that this one is not present. (its set automatically in the optimize iphone buld)
11/23/2009 (8:01 pm)
The optimization flags are defined in "Edit active target ..." in the XCode Project menu under GCC_PREPROCESSOR_DEFINITIONSthe important flag is the PUAP_SCRIPT_OPTIMIZED
if you didn't rebuild your editor and TGBGame, you must ensure that this one is not present. (its set automatically in the optimize iphone buld)
#7
I appreciate your comments, but now I'm thoroughly confused. First of all, I never realized I could rebuild the editor, so whatever script optimizations it included are out of the box. Second, I used the iTGB framework to test the AR with the TouchGame example and it worked. I then used the same example with my new project and this is when I encountered my error.
Neither the iTGB framework, nor my framework define the PUAP_SCRIPT_OPTIMIZED flag in debug. Considering that the game runs and works in the default framework, I'm reasonably sure that the problem is in my framework. However, the project settings (and target settings) are identical to the iTGB framework's, with the exception of bundle names and a few header search paths. Again, they have the same flags.
It still seems to me that the DSOs are incompatible, but I don't understand how I would go about rebuilding the Torque Game Builder with new flags to test this. I noticed that the iTGB 1.2 should support a special project builder for the iPhone:
http://www.garagegames.com/community/blogs/view/17181
But my builder doesn't have this functionality. And neither do any of the builders that I can download from my account page. Do I even have the right builder? I just started working with all of this last week, so it's entirely possible...
11/23/2009 (9:15 pm)
Hey Marc,I appreciate your comments, but now I'm thoroughly confused. First of all, I never realized I could rebuild the editor, so whatever script optimizations it included are out of the box. Second, I used the iTGB framework to test the AR with the TouchGame example and it worked. I then used the same example with my new project and this is when I encountered my error.
Neither the iTGB framework, nor my framework define the PUAP_SCRIPT_OPTIMIZED flag in debug. Considering that the game runs and works in the default framework, I'm reasonably sure that the problem is in my framework. However, the project settings (and target settings) are identical to the iTGB framework's, with the exception of bundle names and a few header search paths. Again, they have the same flags.
It still seems to me that the DSOs are incompatible, but I don't understand how I would go about rebuilding the Torque Game Builder with new flags to test this. I noticed that the iTGB 1.2 should support a special project builder for the iPhone:
http://www.garagegames.com/community/blogs/view/17181
But my builder doesn't have this functionality. And neither do any of the builders that I can download from my account page. Do I even have the right builder? I just started working with all of this last week, so it's entirely possible...
#8
Also that it works with the default framework indicates that.
I would put in an echo into the root main.cs to return some basic things to see if you assumptions are fine, because it seems like the exec attempt out of the root main.cs breaks for whatever reason (paths leading to the wrong place is about the only reason I can think of aside of DSO incompatibilities), leading to the point where no further scripts are executed nor their functions etc found.
As for the recompile: there are two XCode projects. The one without iphone in the name is actually the project for the editor and desktop game client.
Neither of the two has the PUAP Script Optimized flag defined by default, they are unoptimized.
11/23/2009 (10:48 pm)
If you don't use the PUAP_SCRIPT_OPTIMIZED flag in your builds, its fine then the DSO generated by the editor / TGBGame will just work.Also that it works with the default framework indicates that.
I would put in an echo into the root main.cs to return some basic things to see if you assumptions are fine, because it seems like the exec attempt out of the root main.cs breaks for whatever reason (paths leading to the wrong place is about the only reason I can think of aside of DSO incompatibilities), leading to the point where no further scripts are executed nor their functions etc found.
As for the recompile: there are two XCode projects. The one without iphone in the name is actually the project for the editor and desktop game client.
Neither of the two has the PUAP Script Optimized flag defined by default, they are unoptimized.
#9
Inside engine/compilers/XCode is the project that builds this executable, and it just happens to build the editor as well (its not advisable to define the console/script PUAP stuff at all in the editor).
Once you have an executable, throw your game/common/main.cs in the same folder as the mac bundle (or inside if you want) and run the game. that should generate DSO' files for you BUT, only ones you execute. To be sure to make all DSO files there is a maccmdline.txt file that can exist, and be used to pass parameters. Inside games/ the main files should have a "-compile" flag right inside the top of main.cs which compiles all DSO files into the folder.
So - make sure exe has changes.
- run with -compile (and checking the main.cs has the compile code)
- try these on the device
11/24/2009 (5:08 am)
Actually its PUAP_SCRIPT_CHANGE, and PUAP_OPTIMIZE that need to be defined in any program that creates a DSO for the iPhone version. The editor will not create the DSO files because it creates its own dso's, not ones for the game. What creates the DSO's is the game itself, and in your build you should have it inside /tgb/gameData/T2DProject/TGBGame. Inside engine/compilers/XCode is the project that builds this executable, and it just happens to build the editor as well (its not advisable to define the console/script PUAP stuff at all in the editor).
Once you have an executable, throw your game/common/main.cs in the same folder as the mac bundle (or inside if you want) and run the game. that should generate DSO' files for you BUT, only ones you execute. To be sure to make all DSO files there is a maccmdline.txt file that can exist, and be used to pass parameters. Inside games/ the main files should have a "-compile" flag right inside the top of main.cs which compiles all DSO files into the folder.
So - make sure exe has changes.
- run with -compile (and checking the main.cs has the compile code)
- try these on the device
#10
Error: Failed to open "main.cs".
Error: Failed to initialize game, shutting down.
So I tried building for mac from within TGB and then using that output in my framework. When I run it on the device, I get the following output:
---------------------------------------------------------------------------------
Initial Command Line
0 : /var/mobile/Applications/E98A5B83-729A-4E33-9119-4A953EA7650E/iPhoneGameTemplate.app/iPhoneGameTemplate
Merged Command Line
0 : /var/mobile/Applications/E98A5B83-729A-4E33-9119-4A953EA7650E/iPhoneGameTemplate.app/iPhoneGameTemplate
performing mainInit()
$dbgVersion = 2;
System & Processor Information:
iPhone version: 0
CarbonLib version: 0
Physical RAM: 128MB
Logical RAM: 128MB
ARM 1176, 412 Mhz
FPU detected
Math Init:
Installing Standard C extensions
Input Init:
[]Input::enable.
Video Init:
Accelerated OpenGL display device detected.
Game::argv0
Initializing chunk mappings...
o 'TEXT' maps to TextChunk
o 'SCHK' maps to UnknownChunk
o 'SCHK' maps to SimChunk
main.cs (33): Unable to find function echo
main.cs (36): Unable to find function setLogMode
main.cs (23): Unable to find function exec
main.cs (24): Unable to find function echo
main.cs (23): Unable to find function exec
main.cs (24): Unable to find function echo
main.cs (45): Unable to find function getT2DVersion
main.cs (45): Unable to find function echo
main.cs (47): Unable to find function isFunction
Warning: (/Users/xtremelabspro/workspace/XMG/iTGB_1_2/engine/compilers/Xcode_iPhone/../../source/platform/nativeDialogs/msgBox.cpp @ 50) getIDFromName(): didn't find that name
----------------------------------------------------------------------------------
It then gets stuck displaying the message box. Since echo wasn't found, I can't use it for printf style debugging. For the time being, I'm going to just work with the default XCode_iphone framework, but I'd like to eventually figure this out. So if you see something obvious, let me know.
11/24/2009 (10:40 am)
Ok, so I rebuilt the TGB/TGBGame from the /engine/compilers/Xcode project and made sure the PUAP_SCRIPT_CHANGE and PUAP_OPTIMIZE flags were not set anywhere. Then I took the maccmdline.txt file and bundled it with my other resources from the top level of my Touchgame folder along with main.cs, game, and common. It includes the -compile parameter and all the DSO files are generated except for the one at the highest level (the one that corresponds to the first main.cs outside of /game and /common). When I try to build my project from within TGB (using the build dialog with iPhone selected), I get the following errors:Error: Failed to open "main.cs".
Error: Failed to initialize game, shutting down.
So I tried building for mac from within TGB and then using that output in my framework. When I run it on the device, I get the following output:
---------------------------------------------------------------------------------
Initial Command Line
0 : /var/mobile/Applications/E98A5B83-729A-4E33-9119-4A953EA7650E/iPhoneGameTemplate.app/iPhoneGameTemplate
Merged Command Line
0 : /var/mobile/Applications/E98A5B83-729A-4E33-9119-4A953EA7650E/iPhoneGameTemplate.app/iPhoneGameTemplate
performing mainInit()
$dbgVersion = 2;
System & Processor Information:
iPhone version: 0
CarbonLib version: 0
Physical RAM: 128MB
Logical RAM: 128MB
ARM 1176, 412 Mhz
FPU detected
Math Init:
Installing Standard C extensions
Input Init:
[]Input::enable.
Video Init:
Accelerated OpenGL display device detected.
Game::argv0
Initializing chunk mappings...
o 'TEXT' maps to TextChunk
o 'SCHK' maps to UnknownChunk
o 'SCHK' maps to SimChunk
main.cs (33): Unable to find function echo
main.cs (36): Unable to find function setLogMode
main.cs (23): Unable to find function exec
main.cs (24): Unable to find function echo
main.cs (23): Unable to find function exec
main.cs (24): Unable to find function echo
main.cs (45): Unable to find function getT2DVersion
main.cs (45): Unable to find function echo
main.cs (47): Unable to find function isFunction
Warning: (/Users/xtremelabspro/workspace/XMG/iTGB_1_2/engine/compilers/Xcode_iPhone/../../source/platform/nativeDialogs/msgBox.cpp @ 50) getIDFromName(): didn't find that name
----------------------------------------------------------------------------------
It then gets stuck displaying the message box. Since echo wasn't found, I can't use it for printf style debugging. For the time being, I'm going to just work with the default XCode_iphone framework, but I'd like to eventually figure this out. So if you see something obvious, let me know.
#11
Make sure of :
Correct architecture of static lib
Correct files included
Correct target platform
And also,
TGBGame executable REQUIRES them ;)
11/24/2009 (10:45 am)
Ok, so its definately a CODE SIDE problem. IE: the ConsoleFunctions macros are seemingly not there. The fundamental functions are in ConsoleFunctions.cc and are littered throughout the engine - you didnt remove much code did you? Make sure of :
Correct architecture of static lib
Correct files included
Correct target platform
And also,
Quote:
PUAP_SCRIPT_CHANGE, and PUAP_OPTIMIZE that need to be defined in any program that creates a DSO for the iPhone version
Quote:
What creates the DSO's is the game itself, and in your build you should have it inside /tgb/gameData/T2DProject/TGBGame
Quote:
and made sure the PUAP_SCRIPT_CHANGE and PUAP_OPTIMIZE flags were not set anywhere
TGBGame executable REQUIRES them ;)
#12
-----------------------------------------------------------------------------------
In main.cs ...
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/main.cs.
loadingPath: common
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/main.cs.
loadingPath: game
% - Initializing Common
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/preferences/defaultPrefs.cs.
common/preferences/defaultPrefs.cs (84): Unable to find function initDisplayDeviceInfo
Using OpenGL rendering. Fullscreen: 0
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/xml.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/properties.cs.
Couldn't find class rep for dynamic class: SimXMLDocument
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: SimXMLDocument
common/gameScripts/xml.cs (43): Unable to instantiate non-conobject class SimXMLDocument.
common/gameScripts/xml.cs (44): Unable to find object: '0' attempting to call function 'loadFile'
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/common.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/audio.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/canvas.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/cursor.cs.
oniPhoneChangeOrientation: Unknown command.
Activating the OpenGL display device...
OpenGLDevice activating...
OpenGL driver information:
Vendor: Imagination Technologies
Renderer: PowerVR SGX 535
Version: OpenGL ES-CM 1.1 IMGSGX535-35.3
OpenGL Init: Enabled Extensions
EXT_blend_minmax
Vertical Sync
ATI_FSAA
OpenGL Init: Disabled Extensions
ARB_multitexture
EXT_blend_color
EXT_paletted_texture
EXT_compiled_vertex_array
NV_vertex_array_range
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
3DFX_texture_compression_FXT1
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic
set screen mode 480 x 480 x 16, fullscreen, force it, dont repaint
Cleaning up the display device...
>> Attempting to change display settings to fullscreen 480x480x16...
Resurrecting the texture manager...
Max Texture Size reported as: 2048
set screen mode 800 x 600 x 32, windowed, dont force it, repaint
Cleaning up the display device...
>> Attempting to change display settings to windowed 800x600x32...
Resurrecting the texture manager...
common/gameScripts/audio.cs (72): Unable to find function OpenALShutdownDriver
OpenAL Driver Init:
common/gameScripts/audio.cs (40): Unable to find function OpenALInitDriver
Failed to initialize driver.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/profiles.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/cursors.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/messageBoxOk.gui.
... and it fails to find virtually every other function referenced from the scripts.
----------------------------------------------------------------------------------
So I'm currently going through the process of reconstructing the static library. Any reason why statically linked files would not be found from script?
The echo commands indicate that the paths are right, at least for the script files themselves.
11/24/2009 (11:55 am)
So I set the flags in TGBGame and tried it again. This time I did better, but it seems like a lot of functions are missing (that I know are included in the static library version of T2Di):-----------------------------------------------------------------------------------
In main.cs ...
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/main.cs.
loadingPath: common
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/main.cs.
loadingPath: game
% - Initializing Common
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/preferences/defaultPrefs.cs.
common/preferences/defaultPrefs.cs (84): Unable to find function initDisplayDeviceInfo
Using OpenGL rendering. Fullscreen: 0
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/xml.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/properties.cs.
Couldn't find class rep for dynamic class: SimXMLDocument
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: SimXMLDocument
common/gameScripts/xml.cs (43): Unable to instantiate non-conobject class SimXMLDocument.
common/gameScripts/xml.cs (44): Unable to find object: '0' attempting to call function 'loadFile'
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/common.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/audio.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/canvas.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/cursor.cs.
oniPhoneChangeOrientation: Unknown command.
Activating the OpenGL display device...
OpenGLDevice activating...
OpenGL driver information:
Vendor: Imagination Technologies
Renderer: PowerVR SGX 535
Version: OpenGL ES-CM 1.1 IMGSGX535-35.3
OpenGL Init: Enabled Extensions
EXT_blend_minmax
Vertical Sync
ATI_FSAA
OpenGL Init: Disabled Extensions
ARB_multitexture
EXT_blend_color
EXT_paletted_texture
EXT_compiled_vertex_array
NV_vertex_array_range
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
3DFX_texture_compression_FXT1
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic
set screen mode 480 x 480 x 16, fullscreen, force it, dont repaint
Cleaning up the display device...
>> Attempting to change display settings to fullscreen 480x480x16...
Resurrecting the texture manager...
Max Texture Size reported as: 2048
set screen mode 800 x 600 x 32, windowed, dont force it, repaint
Cleaning up the display device...
>> Attempting to change display settings to windowed 800x600x32...
Resurrecting the texture manager...
common/gameScripts/audio.cs (72): Unable to find function OpenALShutdownDriver
OpenAL Driver Init:
common/gameScripts/audio.cs (40): Unable to find function OpenALInitDriver
Failed to initialize driver.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/profiles.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/cursors.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/messageBoxOk.gui.
... and it fails to find virtually every other function referenced from the scripts.
----------------------------------------------------------------------------------
So I'm currently going through the process of reconstructing the static library. Any reason why statically linked files would not be found from script?
The echo commands indicate that the paths are right, at least for the script files themselves.
#13
11/24/2009 (12:00 pm)
Well the scripts seem to be executing just fine, the openAL is not too concerning, but you stopped the errors there. What functions are missing? its easier to search code for the ConsoleFunction declaration and see if its #ifdef'd out or, something.
#14
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/messageBox.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/help.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/chatGui.gui.
Couldn't find class rep for dynamic class: GuiWindowCtrl
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: GuiWindowCtrl
common/gui/chatGui.gui (120): Unable to instantiate non-conobject class GuiWindowCtrl.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/screenshot.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/metrics.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/Gui/FrameOverlayGui.gui.
Couldn't find class rep for dynamic class: GuiConsoleTextCtrl
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: GuiConsoleTextCtrl
common/Gui/FrameOverlayGui.gui (0): Unable to instantiate non-conobject class GuiConsoleTextCtrl.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/scriptDoc.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/keybindings.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/options.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/levelManagement.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/projectManagement.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/projectResources.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/align.cs.
main.cs (45): Unable to find function getT2DVersion
Torque Game Builder () initialized...
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/managed/datablocks.cs.
Couldn't find class rep for dynamic class: t2dImageMapDatablock
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: t2dImageMapDatablock
game/managed/datablocks.cs (0): Unable to instantiate non-conobject class t2dImageMapDatablock.
Couldn't find class rep for dynamic class: t2dImageMapDatablock
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: t2dImageMapDatablock
game/managed/datablocks.cs (0): Unable to instantiate non-conobject class t2dImageMapDatablock.
..... (continued)
11/24/2009 (12:15 pm)
here's some more:Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/messageBox.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/help.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gui/chatGui.gui.
Couldn't find class rep for dynamic class: GuiWindowCtrl
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: GuiWindowCtrl
common/gui/chatGui.gui (120): Unable to instantiate non-conobject class GuiWindowCtrl.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/screenshot.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/metrics.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/Gui/FrameOverlayGui.gui.
Couldn't find class rep for dynamic class: GuiConsoleTextCtrl
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: GuiConsoleTextCtrl
common/Gui/FrameOverlayGui.gui (0): Unable to instantiate non-conobject class GuiConsoleTextCtrl.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/scriptDoc.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/keybindings.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/options.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/levelManagement.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/projectManagement.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/projectResources.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/common/gameScripts/align.cs.
main.cs (45): Unable to find function getT2DVersion
Torque Game Builder () initialized...
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/managed/datablocks.cs.
Couldn't find class rep for dynamic class: t2dImageMapDatablock
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: t2dImageMapDatablock
game/managed/datablocks.cs (0): Unable to instantiate non-conobject class t2dImageMapDatablock.
Couldn't find class rep for dynamic class: t2dImageMapDatablock
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: t2dImageMapDatablock
game/managed/datablocks.cs (0): Unable to instantiate non-conobject class t2dImageMapDatablock.
..... (continued)
#15
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/behaviors/makeDraggable.cs.
Couldn't find class rep for dynamic class: BehaviorTemplate
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: BehaviorTemplate
game/behaviors/makeDraggable.cs (8): Unable to instantiate non-conobject class BehaviorTemplate.
game/behaviors/makeDraggable.cs (14): Unable to find object: '0' attempting to call function 'addBehaviorField'
game/behaviors/makeDraggable.cs (15): Unable to find object: '0' attempting to call function 'addBehaviorField'
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/behaviors/faceObject.cs.
Couldn't find class rep for dynamic class: BehaviorTemplate
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: BehaviorTemplate
game/behaviors/faceObject.cs (8): Unable to instantiate non-conobject class BehaviorTemplate.
game/behaviors/faceObject.cs (14): Unable to find object: '0' attempting to call function 'addBehaviorField'
game/behaviors/faceObject.cs (15): Unable to find object: '0' attempting to call function 'addBehaviorField'
game/behaviors/faceObject.cs (16): Unable to find object: '0' attempting to call function 'addBehaviorField'
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/gameScripts/guiProfiles.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/gui/mainScreen.gui.
Couldn't find class rep for dynamic class: t2dSceneWindow
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: t2dSceneWindow
game/gui/mainScreen.gui (0): Unable to instantiate non-conobject class t2dSceneWindow.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/gameScripts/game.cs.
game/gameScripts/game.cs (21): Unable to find function enableJoystick
game/gameScripts/game.cs (23): Unable to find object: 'sceneWindow2D' attempting to call function 'loadLevel'
oniPhoneBecomeActive: Unknown command.
and there was a lot of gui stuff before that. But the game still didn't run correctly, effictively a blank background.
A problem that I ran into before and solved was that the initialization depends on the order of global variable initialization (see main.cc), so I've been selectively moving files from the library to my framework to ensure that these initializations occur in the proper order. Not sure if that means anything, but I'll continue setting up this static library again.
11/24/2009 (12:26 pm)
....Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/behaviors/makeDraggable.cs.
Couldn't find class rep for dynamic class: BehaviorTemplate
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: BehaviorTemplate
game/behaviors/makeDraggable.cs (8): Unable to instantiate non-conobject class BehaviorTemplate.
game/behaviors/makeDraggable.cs (14): Unable to find object: '0' attempting to call function 'addBehaviorField'
game/behaviors/makeDraggable.cs (15): Unable to find object: '0' attempting to call function 'addBehaviorField'
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/behaviors/faceObject.cs.
Couldn't find class rep for dynamic class: BehaviorTemplate
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: BehaviorTemplate
game/behaviors/faceObject.cs (8): Unable to instantiate non-conobject class BehaviorTemplate.
game/behaviors/faceObject.cs (14): Unable to find object: '0' attempting to call function 'addBehaviorField'
game/behaviors/faceObject.cs (15): Unable to find object: '0' attempting to call function 'addBehaviorField'
game/behaviors/faceObject.cs (16): Unable to find object: '0' attempting to call function 'addBehaviorField'
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/gameScripts/guiProfiles.cs.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/gui/mainScreen.gui.
Couldn't find class rep for dynamic class: t2dSceneWindow
Warning: (/Users/xtremelabspro/workspace/XMG/iPhoneGameTemplate/Classes/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: t2dSceneWindow
game/gui/mainScreen.gui (0): Unable to instantiate non-conobject class t2dSceneWindow.
Loading compiled script /private/var/mobile/Applications/F913D2E8-C7D2-4846-A47F-B0C9E8F08F79/iPhoneGameTemplate.app/game/gameScripts/game.cs.
game/gameScripts/game.cs (21): Unable to find function enableJoystick
game/gameScripts/game.cs (23): Unable to find object: 'sceneWindow2D' attempting to call function 'loadLevel'
oniPhoneBecomeActive: Unknown command.
and there was a lot of gui stuff before that. But the game still didn't run correctly, effictively a blank background.
A problem that I ran into before and solved was that the initialization depends on the order of global variable initialization (see main.cc), so I've been selectively moving files from the library to my framework to ensure that these initializations occur in the proper order. Not sure if that means anything, but I'll continue setting up this static library again.
#16
For clarification : DECLARE_CONOBJECT(t2dSceneWindow); is where it creates the console class, and the dynamic rep errors are all from that not being found
11/24/2009 (12:51 pm)
yes, it looks like those console classes are not making it into the build somehow, or you have removed their CONOBJECT declarations maybe? perhaps there is something with the Torque setup thats not finding its way to the code. Those macros can be found with console.h so , maybe its a link order issue.For clarification : DECLARE_CONOBJECT(t2dSceneWindow); is where it creates the console class, and the dynamic rep errors are all from that not being found
#17
However, something changed in the TouchGame project that is reproducing this error in the normal T2Di framework. The example compiles and runs, but the level never loads correctly, so I effectively get a blank screen.
Not being able to figure out when went wrong in the first place, I tried to just go and redownload the newest version of the T2Di framework (1.3 beta). All I'm trying to do is rebuild the TouchGame demo. After including the right flags, I loaded the 1.3 TGB and rebuilt the demo from scratch. When I tried to run it, it wouldn't install on my iPhone:
"Could not inspect the application package."
I also tried using the 1.2 version of TGB/TGBGame.
Why is this so difficult?
11/24/2009 (3:55 pm)
It definitely seems like including the source as a static library somehow prevents important declarations from being exposed to the script. This is despite the fact that I make sure to include important declarations like DECLARE_CONOBJECT(t2dSceneWindow). So I pretty much gave up on trying to use Torque in my own framework, and refocused my efforts on the provided default framework. However, something changed in the TouchGame project that is reproducing this error in the normal T2Di framework. The example compiles and runs, but the level never loads correctly, so I effectively get a blank screen.
Not being able to figure out when went wrong in the first place, I tried to just go and redownload the newest version of the T2Di framework (1.3 beta). All I'm trying to do is rebuild the TouchGame demo. After including the right flags, I loaded the 1.3 TGB and rebuilt the demo from scratch. When I tried to run it, it wouldn't install on my iPhone:
"Could not inspect the application package."
I also tried using the 1.2 version of TGB/TGBGame.
Why is this so difficult?
#18
On version 1.2, it magically started working again in the default framework. No idea why, but I'm just not going to touch it now and move onto other things for the moment.
11/24/2009 (4:29 pm)
The inspection problem was just because I didn't clean, but still, the TouchGame demo isn't quite working. I see the level, but it accepts no input in version 1.3.On version 1.2, it magically started working again in the default framework. No idea why, but I'm just not going to touch it now and move onto other things for the moment.
#19
So I'd like to use Torque as a static library. It seems like Sven is right in that the CONOBJECT declarations are not making it into the new project. After triple checking that the appropriate files exist, my guess is that there's still a global variable I can't find that initializes the interface for these objects. Or that there's a linking order or directory structure dependency that I'm not taking into account.
Any ideas? Has anyone successfully used Torque as a static library?
12/17/2009 (2:02 pm)
Alright, so I'm back to this problem again. Sorry to resurrect an old thread, but I'd really like to get this working. For awhile I used the default Torque Framework for this iPhone AR game, and I even got the camera working with heading updates through script. But I'd like to not have to make intrusive changes to Torque, and since I need to recompile scripts through the game builder a lot, it's rather inconvenient when it overwrites the project file.So I'd like to use Torque as a static library. It seems like Sven is right in that the CONOBJECT declarations are not making it into the new project. After triple checking that the appropriate files exist, my guess is that there's still a global variable I can't find that initializes the interface for these objects. Or that there's a linking order or directory structure dependency that I'm not taking into account.
Any ideas? Has anyone successfully used Torque as a static library?
#20
After running into troubles getting Augmented reality into Torque, I am thinking of switching over to Unity. Before that, wanted to find out if anyone was successful in getting AR into Torque?
06/23/2010 (3:14 pm)
Lake, After running into troubles getting Augmented reality into Torque, I am thinking of switching over to Unity. Before that, wanted to find out if anyone was successful in getting AR into Torque?
Associate Sven Bergström
Luma Arcade
www.garagegames.com/community/forums/viewthread/104091/1#comment-699979
Nearer the last part of the comment covers the process for trying to check the data integrity.