How to Open & Run a TGB Project?
by Rachel P · in iTorque 2D · 01/30/2010 (1:10 am) · 21 replies
Hey everyone,
I just bought Torque 2D for the iPhone (whoo!) but I'm a bit confused. You see, I have been working on a game in Torque Game Builder and would like to "port" it to Torque 2D iPhone so I can continue development from where I left off (instead of making a new project from scratch). But first, when I try to run a scene it says, "Could not find player executable." And then just clicking "Build Project" does nothing. Clearly I'm missing something here. I tried looking in the documents that came with the software, but I couldn't find a part that explained how to get your old TGB files working properly for the iPhone.
So basically, what am I missing here? What do I need to do to get my TGB project capable of working with the iPhone and T2D for the iPhone?
Thanks much guys. =]
I just bought Torque 2D for the iPhone (whoo!) but I'm a bit confused. You see, I have been working on a game in Torque Game Builder and would like to "port" it to Torque 2D iPhone so I can continue development from where I left off (instead of making a new project from scratch). But first, when I try to run a scene it says, "Could not find player executable." And then just clicking "Build Project" does nothing. Clearly I'm missing something here. I tried looking in the documents that came with the software, but I couldn't find a part that explained how to get your old TGB files working properly for the iPhone.
So basically, what am I missing here? What do I need to do to get my TGB project capable of working with the iPhone and T2D for the iPhone?
Thanks much guys. =]
About the author
#2
01/30/2010 (7:01 am)
You won't be able to build for the Device if you aren't registered as a paid developer and have the proper provisioning data. However, you should still be able to build for the Simulator. In the Overview drop-down, in the top-left of XCode, make sure your Active Target is set to "iPhone Simulator", then hit Build and Go. It should work, now.
#3
But how come whenever I load the project I made in TGB the Build Project button doesn't even do anything?
01/30/2010 (6:11 pm)
Okay, thanks for clearing that up. Yeah, the iPhone simulator works, but it takes a really long time to compile (like 3 minutes, that normal?)But how come whenever I load the project I made in TGB the Build Project button doesn't even do anything?
#4
build project does nothing else than opening the xcode project in the project folder/buildproject
01/30/2010 (6:29 pm)
that the initial build takes 3 minutes is normal and actually short given the fact that you compile a good 450 files :)build project does nothing else than opening the xcode project in the project folder/buildproject
#5
Edit: Ah, thank you for explaining! Now I get why it won't open xcode. I'll try to fix that. I did get it to compile the project when I manually opened it in xCode, but it was just a weird blank screen. =P
Edit 2: Well, now I'm able to compile it by clicking the icon, but when I do it gives me a fatal error once it's done compiling in the iPhone simulator... It says "Error, no key specified!" Hmm... Well, I'm making progress at least! Is there some kind of tutorial that specifically talks about working with projects built in TGB? I hate to be asking so many questions, but I just can't seem to find a tutorial or anything..
Edit 3: Holy crap, I got it working!! Woot! Just needed to copy the tgbgame.app file from the "iPhoneExample/ProjectFiles" to the same location in my folders and it worked! Still having problems with the simulator though and that error, but I'll see if I can find the problem. If anyone knows what it is though and doesn't mind helping, please let me know. =)
01/30/2010 (6:29 pm)
Oh okay, thanks Marc! But any idea why it doesn't work when I try to play the scene? I just wanna know how I'm supposed to get my TGB project working in this.. probably a very simple solution, I just unfortunately am not aware of it. =PEdit: Ah, thank you for explaining! Now I get why it won't open xcode. I'll try to fix that. I did get it to compile the project when I manually opened it in xCode, but it was just a weird blank screen. =P
Edit 2: Well, now I'm able to compile it by clicking the icon, but when I do it gives me a fatal error once it's done compiling in the iPhone simulator... It says "Error, no key specified!" Hmm... Well, I'm making progress at least! Is there some kind of tutorial that specifically talks about working with projects built in TGB? I hate to be asking so many questions, but I just can't seem to find a tutorial or anything..
Edit 3: Holy crap, I got it working!! Woot! Just needed to copy the tgbgame.app file from the "iPhoneExample/ProjectFiles" to the same location in my folders and it worked! Still having problems with the simulator though and that error, but I'll see if I can find the problem. If anyone knows what it is though and doesn't mind helping, please let me know. =)
#6
As for the key specification: check the provision property and see if you can assign something there for usage in simulator only. I've had a apple dev contract since it became available here in europe, so I always had valid dev provisions and don't know if it has changed on the non-provision side.
Developers that invest $500 in an iphone engine are normally assumed to have the $99/year apple iphone dev contract ;)
01/30/2010 (7:13 pm)
Cool cool :)As for the key specification: check the provision property and see if you can assign something there for usage in simulator only. I've had a apple dev contract since it became available here in europe, so I always had valid dev provisions and don't know if it has changed on the non-provision side.
Developers that invest $500 in an iphone engine are normally assumed to have the $99/year apple iphone dev contract ;)
#7
01/30/2010 (7:34 pm)
Hmm. Unfortunately I'm not familiar with provision properties and stuff (I'm really quite new to this... haha) but are you also saying that if I just got an apple dev contract for $99 then I won't have this problem? Cause if that's the case, I'll probably just buy that now since I'm going to have to eventually anyway. =P
#8
01/30/2010 (7:47 pm)
Building for the iPhone Device requires a Provisioning Profile, which is only available through a paid Apple Developer Account. Building for the iPhone Simulator however can be done through a free iPhone Developer account. Just read through the documentation made available to you on your Apple Developer account page. :)
#9
Thanks much guys, I really appreciate the help!
EDIT: Hmm, unfortunately I can't find a way to get a provisioning profile/a way to test on the simulator unless I pay the $99. =/ Oh well, as long as that's the problem and that'll solve it, that's fine.
01/30/2010 (7:52 pm)
Ah, got it! I'll do that. :)Thanks much guys, I really appreciate the help!
EDIT: Hmm, unfortunately I can't find a way to get a provisioning profile/a way to test on the simulator unless I pay the $99. =/ Oh well, as long as that's the problem and that'll solve it, that's fine.
#10
01/31/2010 (8:45 am)
Keep in mind theres documentation to read about this stuff. Good luck!
#11
Update: Okay, I've been having a crazy past couple hours thinking I figured the solution out, but then ended up screwing things up even more, etc etc. But I guess I should just buy a dev license now. It's trying to find a key in "event.h" so I guess if I get my provisioning profile that'll fix things? I am able to compile the iTGB example game, but maybe that's cause it was developed by someone else with a license?
Er, I see that I'm able to compile a newly created project too. I guess what I'll try to do is rebuild my project since I can't find a solution to what's wrong.
Update 2: Okay, that's really not helping. So you guys really think the problem is that I haven't registered for an Apple dev license (even though I can compile other projects that I create natively in iTGB)? Cause if so, I'll definitely pay the $99 so I can fix this incredibly annoying problem. :P
Update 3: Never give up I guess... cause now it's starting to work. O.O I followed this tutorial http://tdn.garagegames.com/wiki/ITGB/Tutorials/SimulatorTest1 and it now loads my game. The problem is, only a few icons are shown, but I think I know why...I don't think all my script files are being called. Hmm, I'll need to look into that. Where exactly should my exec scripts be called? Cause wherever they are now doesn't seem to be working.
But daaaaang, I'm getting excited! Getting closer! ;D
To be more specific, I changed the main.cs file & common and game folders (shown on the tutorial). I have the main.cs and common taken from a new project created in iTGB. The game folder, however, is taken from the folder of my TGB game. But again, not everything is loading. It's weird..
01/31/2010 (1:09 pm)
Yeah, I've been reading through the documentation but whenever it talks about a provisioning profile it seems to always loop back to saying you get it on the Portal which can only be viewed if you're a registered developer. It's kinda weird cause I am able to run other things on the iPhone Simulator, including the demo game that came with iTGB. It just messes up whenever trying to load my project. :P Update: Okay, I've been having a crazy past couple hours thinking I figured the solution out, but then ended up screwing things up even more, etc etc. But I guess I should just buy a dev license now. It's trying to find a key in "event.h" so I guess if I get my provisioning profile that'll fix things? I am able to compile the iTGB example game, but maybe that's cause it was developed by someone else with a license?
Er, I see that I'm able to compile a newly created project too. I guess what I'll try to do is rebuild my project since I can't find a solution to what's wrong.
Update 2: Okay, that's really not helping. So you guys really think the problem is that I haven't registered for an Apple dev license (even though I can compile other projects that I create natively in iTGB)? Cause if so, I'll definitely pay the $99 so I can fix this incredibly annoying problem. :P
Update 3: Never give up I guess... cause now it's starting to work. O.O I followed this tutorial http://tdn.garagegames.com/wiki/ITGB/Tutorials/SimulatorTest1 and it now loads my game. The problem is, only a few icons are shown, but I think I know why...I don't think all my script files are being called. Hmm, I'll need to look into that. Where exactly should my exec scripts be called? Cause wherever they are now doesn't seem to be working.
But daaaaang, I'm getting excited! Getting closer! ;D
To be more specific, I changed the main.cs file & common and game folders (shown on the tutorial). I have the main.cs and common taken from a new project created in iTGB. The game folder, however, is taken from the folder of my TGB game. But again, not everything is loading. It's weird..
#12
Using 1.3? 1.3.1?
And if you are going to do *anything* useful, you NEED a developer licence.
01/31/2010 (6:51 pm)
Im confused, if you followed the quick start guide it should work straight out of the zip right? Using 1.3? 1.3.1?
And if you are going to do *anything* useful, you NEED a developer licence.
#13
Torque 2D for iPhone is supposed to load files from Torque Game Builder that you've created and easily convert them so they can be deployed to the iPhone, right? It says so right on the product description page:
"Torque 2D for the iPhone is built to natively load projects from Torque Game Builder Pro and deploy them to the iPhone."
Okay, so why is it that whenever I simply open a project using Torque 2D for iPhone that I had created in Torque Game Builder, 1) I can't run the game ("Scene Builder: Could not find player executable") and 2) the "Build Project" button does nothing? Granted, I have found fixes to these two issues (both having to do with the fact that they are added files that only are created when you create a project in Torque 2D for iPhone (such as the "buildFiles" folder. However, even when I create a native project in Torque 2D for iPhone, the "Play Scene" button will NOT work automatically. What is up with this?
This brings me to my general frustrations of simply WHY can't I run a project I've created in Torque Game Builder on the simulator?? Even if I open it with Torque 2D for iPhone and then press the "Build Project" button (after having to add the folder from a project natively created in Torque 2D For iPhone), it won't run on the simulator. It gets tons of errors and simply fails.
Someone here has to have created a project via Torque Game Builder and gotten it to successfully run on the iPhone Simulator... but HOW? It seems like Torque 2D for iPhone (wow, said that a lot) doesn't even fully work - like I said previously, what's up with "Play Scene" not working?
Sorry, but I've been working on this all day and it really frustrates me cause I've looked through the documentations and cannot seem to find any kind of "Porting files you created via TGB" or whatever tutorial. This is just driving me insane! Granted I'm not super-skilled right now in this field so I could be missing something obvious, but it just doesn't seem like it should be this hard.
So I'm basically back to square one: How can I get a TGB project to work with iTGB/iPhone Simulator?
Is there an admin or someone I can contact?
01/31/2010 (9:55 pm)
I'm incredibly confused now... I don't even understand why I'm having this problem in the first place.Torque 2D for iPhone is supposed to load files from Torque Game Builder that you've created and easily convert them so they can be deployed to the iPhone, right? It says so right on the product description page:
"Torque 2D for the iPhone is built to natively load projects from Torque Game Builder Pro and deploy them to the iPhone."
Okay, so why is it that whenever I simply open a project using Torque 2D for iPhone that I had created in Torque Game Builder, 1) I can't run the game ("Scene Builder: Could not find player executable") and 2) the "Build Project" button does nothing? Granted, I have found fixes to these two issues (both having to do with the fact that they are added files that only are created when you create a project in Torque 2D for iPhone (such as the "buildFiles" folder. However, even when I create a native project in Torque 2D for iPhone, the "Play Scene" button will NOT work automatically. What is up with this?
This brings me to my general frustrations of simply WHY can't I run a project I've created in Torque Game Builder on the simulator?? Even if I open it with Torque 2D for iPhone and then press the "Build Project" button (after having to add the folder from a project natively created in Torque 2D For iPhone), it won't run on the simulator. It gets tons of errors and simply fails.
Someone here has to have created a project via Torque Game Builder and gotten it to successfully run on the iPhone Simulator... but HOW? It seems like Torque 2D for iPhone (wow, said that a lot) doesn't even fully work - like I said previously, what's up with "Play Scene" not working?
Sorry, but I've been working on this all day and it really frustrates me cause I've looked through the documentations and cannot seem to find any kind of "Porting files you created via TGB" or whatever tutorial. This is just driving me insane! Granted I'm not super-skilled right now in this field so I could be missing something obvious, but it just doesn't seem like it should be this hard.
So I'm basically back to square one: How can I get a TGB project to work with iTGB/iPhone Simulator?
Is there an admin or someone I can contact?
#14
TGB Games on the desktop don't need memory and loading optimizations as the desktop has no restrictions to 30mb of RAM, a slow flash memory, 23MB of VRAM or "at max 20s of loading or you are killed" as you have on the iphone.
Play scene issue: I would guess you forgot to copy tgbgame over to the projects folder from the sample project. that one is required to run anything.
Optimally I would recommend that you read the pdfs and the iphone specific docs that come with it, that will help you seriously.
also there are some threads on that.
Generally, it should take you a day or two until you get used to the iphone requirements (that are not there to punish you but to make your game run at all / run at more than 5 FPS), after that taking TGB Games over should be fairly straight forward, although I would personally recommend to use the T2Di "TGB Editor" as it has the stuff cut thats gone (3D Shapes especially)
01/31/2010 (10:24 pm)
You have to port TGB games to the iphone (basically what you have to do is to create the per level datablock files, as the regular datablocks.cs is ignored on the iphone / simulator. also don't forget: resources don't work - you can't afford "random addition of data" on a restrictive platform as a mobile one)TGB Games on the desktop don't need memory and loading optimizations as the desktop has no restrictions to 30mb of RAM, a slow flash memory, 23MB of VRAM or "at max 20s of loading or you are killed" as you have on the iphone.
Play scene issue: I would guess you forgot to copy tgbgame over to the projects folder from the sample project. that one is required to run anything.
Optimally I would recommend that you read the pdfs and the iphone specific docs that come with it, that will help you seriously.
also there are some threads on that.
Generally, it should take you a day or two until you get used to the iphone requirements (that are not there to punish you but to make your game run at all / run at more than 5 FPS), after that taking TGB Games over should be fairly straight forward, although I would personally recommend to use the T2Di "TGB Editor" as it has the stuff cut thats gone (3D Shapes especially)
#15
Anyways, I really appreciate all of you helping me out! I'll take a couple days to read over everything, and hopefully by then I'll have it figured out. :)
01/31/2010 (11:10 pm)
Hey, thanks for the quick reply. You're right, clearly I need to do some more research. I was trying to cut corners a bit but that's not working. I'll just have to sit myself down and read through all the documentation. =PAnyways, I really appreciate all of you helping me out! I'll take a couple days to read over everything, and hopefully by then I'll have it figured out. :)
#16
01/31/2010 (11:24 pm)
looking forward to see what you created and are going to create :)
#17
A) getProjectNameFromPath is returning "projectFiles" which is obviously wrong. Find that function :tgbtoolslevelEditorscriptslevelManagement.ed.cs( line 332 )
and change
to (note the 2, so it gets the game name)
Im hoping the last fix to that will keep it working until the new fixes are in the build : although there is a new executable for osx inside tgb/gamedata/ if you want to try copying that to your game folder.
Also, looking at the rungame() function will show you what might be going wrong (as , its working just dandy on our end)
02/01/2010 (5:53 am)
I actually found a bug in the play scene code, the whole thing is being made more logical but for now : Windows Fix below
A) getProjectNameFromPath is returning "projectFiles" which is obviously wrong. Find that function :tgbtoolslevelEditorscriptslevelManagement.ed.cs( line 332 )
and change
%n = getWord( %tmp, %cnt - 1 );
to (note the 2, so it gets the game name)
%n = getWord( %tmp, %cnt - 2 );
Next, find the function getGameExecutableFile()
tgbtoolslevelEditorscriptslevelManagement.ed.cs(line 358): function getGameExecutableFile()
function getGameExecutableFile()
{
// Don't look for custom game on mac
if( $platform !$= "macos" )
{
//Something new, it returns the folder name, the executable is always called iTorque2DGame.exe by default, so try the prject name,
//if that fails try the default.
%default = "iTorque2DGame";
%gname = getProjectNameFromPath();
%gfile = expandFileName( "^project/" @ %gname @ ".exe" );
echo("Game executable is : " @ %gfile);
// If it exists use it...
if( isFile( %gfile ) )
{
echo("Game executable found, using it.");
return %gfile;
}
else
{
echo("Not here, using default executable");
return expandFileName( "^project/" @ %default @ ".exe" );
}
}
//Return an error instead, no defaults here yet.
return "";
}OSX side
Im hoping the last fix to that will keep it working until the new fixes are in the build : although there is a new executable for osx inside tgb/gamedata/ if you want to try copying that to your game folder.
Also, looking at the rungame() function will show you what might be going wrong (as , its working just dandy on our end)
#18
Just wanted to give you all a quick update saying that, after reading through the documentation thoroughly, my game now runs on the simulator. =) Thanks again for all your help!
And to anyone like me who wants to skip reading the documents so they can get straight to working... don't! =P
02/02/2010 (6:10 pm)
Hey guys,Just wanted to give you all a quick update saying that, after reading through the documentation thoroughly, my game now runs on the simulator. =) Thanks again for all your help!
And to anyone like me who wants to skip reading the documents so they can get straight to working... don't! =P
#19
02/03/2010 (11:21 am)
hehe :)
#20
can any buddy give me the beginners tutorial that will help me in learning torque game builder...
thnx
08/26/2010 (7:00 am)
Aslam o alkum, can any buddy give me the beginners tutorial that will help me in learning torque game builder...
thnx
Torque Owner Rachel P
Default Studio Name