RC3: Can't open/create new projects / no changes being saved
by Leroy Frederick · in Torque Game Builder · 06/14/2006 (1:59 pm) · 23 replies
Think i'm the first! EDIT: Andrew beat me to it!
Anyway, after been in the default TGB project, i opened up the fish demo, open and player a few levels in that project, close TGB, re-opened, back in fish demo as suppose to be, attempted to open wack a mole, window closes/goes black, re-appears, still fish demo, tried to open something else, same difference :(
Anyway, after been in the default TGB project, i opened up the fish demo, open and player a few levels in that project, close TGB, re-opened, back in fish demo as suppose to be, attempted to open wack a mole, window closes/goes black, re-appears, still fish demo, tried to open something else, same difference :(
#2
06/14/2006 (2:03 pm)
Hmmm, thanks Andrew, i'll give that i try (i'm kinda suspecting it's that too). I just installed it in a seperate folder (no uninstall), anyway, ill see what happens...
#3
EDIT: Tried again, this time opening the shooter demo first, same difference :( Gonna try and pinpoint it now...
06/14/2006 (2:43 pm)
So far not good, uninstalled all previous versions, cleaned out install directory, reinstalled, open fish demo, close TGB, re-opened TGB, attempted to open shooter demo (or whatever project), instead i got fish demo yet again :(EDIT: Tried again, this time opening the shooter demo first, same difference :( Gonna try and pinpoint it now...
#4
Change this entry in the games folder 'main.cs' file
Yet to pinpoint the problem yet...
EDIT: Just noticed you don't actually need to close TGB to be locked into a project, it locks on the first project you open...
EDIT: Problem lies within the common folder i believe (how a file saves the last open project)
EDIT: To pinpoint it further, i think it lies within '\games\common\gameScripts\projectManagement.cs', i'm going in, if i'm not back in five minutes i want you to get out of here and get help!
06/14/2006 (2:59 pm)
Here's a inconvient workaround in case i'm not alone in this problemChange this entry in the games folder 'main.cs' file
$startupProject = "MyProjectName";
Yet to pinpoint the problem yet...
EDIT: Just noticed you don't actually need to close TGB to be locked into a project, it locks on the first project you open...
EDIT: Problem lies within the common folder i believe (how a file saves the last open project)
EDIT: To pinpoint it further, i think it lies within '\games\common\gameScripts\projectManagement.cs', i'm going in, if i'm not back in five minutes i want you to get out of here and get help!
#5
I don't think $pref::startupProject = %projectName; is saving the projectName so it keeps loading up the same thing, am i the only one thats got this problem, it's starting to feel like the torqlight zone here (ok, i know, that one was bad)
06/14/2006 (4:19 pm)
Think i've pinpointed the problem, it's located in the 'projectManagement.ed.cs' file located in the '\games\tools\levelEditor\scripts' directory.// If we've already got a loaded project, restart the sim with a new one
if ( %this.activeProject !$= "" )
{
// Store startup project for restart
$pref::startupProject = %projectName;
// Restart it!
restartInstance();
// Return Success
return true;
}I don't think $pref::startupProject = %projectName; is saving the projectName so it keeps loading up the same thing, am i the only one thats got this problem, it's starting to feel like the torqlight zone here (ok, i know, that one was bad)
#6
06/14/2006 (4:52 pm)
Just made the startling discovery that nothing is saving for me!? The only time changes are saved to my levels is after running the cleandso.bat! I'm gonna reinstall to a different drive or something!
#7
If I take a project I made in RC2 and copy it to the RC3 installed (Installed into seperated directories) and open it with RC3, the level that loads by default in RC2 doesn't appear to load at all.
It loads all the resources (sprites etc) but not the level, unless I go File/Open Level and load the level manually?
Is this meant to happen?
06/14/2006 (5:06 pm)
I have a different(ish) problem.If I take a project I made in RC2 and copy it to the RC3 installed (Installed into seperated directories) and open it with RC3, the level that loads by default in RC2 doesn't appear to load at all.
It loads all the resources (sprites etc) but not the level, unless I go File/Open Level and load the level manually?
Is this meant to happen?
#8
@Matt: You got some of symptons i experienced in that i had to load a level on RC2 (+RC3 TGB is that's not default behaviour) projects to see them (default would be empty) even thougth the project was save with the level in tact and loaded successfully.
06/14/2006 (5:51 pm)
Nope, i restarted, re-installed in a different (& default) directory, still no joy :(@Matt: You got some of symptons i experienced in that i had to load a level on RC2 (+RC3 TGB is that's not default behaviour) projects to see them (default would be empty) even thougth the project was save with the level in tact and loaded successfully.
#9
The reason your default level was not loaded when you copied over your game is because the LevelBuilder preferences file (in your RC2 path) contains all the 'last level loaded' file paths and you did not copy that preferences file over. Of course you shouldn't have to, but I think if you open the level and then exit, it should reload it in RC3 the next time you start TGB.
@Leroy,
Sorry to hear about this happening to you, funny it seems not to be happening to anyone else. I suppose it is possible that somehow your prefs are not being properly exported, but here's a quick 'fix' to see if your problem is resolved. Let me know if this helps.
Cheers!
-Justin
06/15/2006 (1:15 am)
@Matt,The reason your default level was not loaded when you copied over your game is because the LevelBuilder preferences file (in your RC2 path) contains all the 'last level loaded' file paths and you did not copy that preferences file over. Of course you shouldn't have to, but I think if you open the level and then exit, it should reload it in RC3 the next time you start TGB.
@Leroy,
Sorry to hear about this happening to you, funny it seems not to be happening to anyone else. I suppose it is possible that somehow your prefs are not being properly exported, but here's a quick 'fix' to see if your problem is resolved. Let me know if this helps.
// If we've already got a loaded project, restart the sim with a new one
if ( %this.activeProject !$= "" )
{
// Store startup project for restart
$pref::startupProject = %projectName;
[b] // Force a pref export before restarting (this should happen automatically in onExit)
export("$pref::*", "common/preferences/prefs.cs", false);[/b]
// Restart it!
restartInstance();
// Return Success
return true;
}Cheers!
-Justin
#10
EDIT: Level changes seem to update if i run the 'cleandso.bat' before re-opening
EDIT: This is strange, after i open up a project, the data is being saved to the pref file (the original code) but the selected project isn't being opened up and level changes aren't being updated (data is being saved, but reset after restart/stop of play) until i run the 'cleandso.bat'! So perhaps the dso files are not being cleaned/deleted when changes occur!?
Is there anyway i can force the 'cleandso.bat' function or edit the code to make the dso's are cleaned/deleted when necessary?
06/15/2006 (2:37 am)
Thanks for the help Justin, but no change, in fact, the only time anything saves for me is when i use the save as, other then that, if i drag a sprite onto the level and press play (whether i pressed save or not), once i stop the changes have dissappered! so it seems no data changes are saving other then the save as... function? :(EDIT: Level changes seem to update if i run the 'cleandso.bat' before re-opening
EDIT: This is strange, after i open up a project, the data is being saved to the pref file (the original code) but the selected project isn't being opened up and level changes aren't being updated (data is being saved, but reset after restart/stop of play) until i run the 'cleandso.bat'! So perhaps the dso files are not being cleaned/deleted when changes occur!?
Is there anyway i can force the 'cleandso.bat' function or edit the code to make the dso's are cleaned/deleted when necessary?
#11
06/15/2006 (3:51 am)
@Justin: ahhah! Yes, that's what it is. Works as advertised then. :)
#12
I've uninstalled RC3, removed all me-made game folders, and re-installed.
At initial startup, the checkers demo was briefly shown, but then TGB closed this project and gave me an empty workspace. I loaded scollerDemo which worked fine (although I didn't edit anything). All subsequent loads of any other project fails - TGB seems to clear the workspace, but then re-loads the scrollerdemo.
Creating a new project based on any game template will create the filesystem game structure, but TGB will not load the new project.
Shutting down TGB and running 'cleandso.bat' didn't help - I'm stuck with the scroller demo.
06/15/2006 (11:55 am)
I'm experiencing the same problem as Leroy.I've uninstalled RC3, removed all me-made game folders, and re-installed.
At initial startup, the checkers demo was briefly shown, but then TGB closed this project and gave me an empty workspace. I loaded scollerDemo which worked fine (although I didn't edit anything). All subsequent loads of any other project fails - TGB seems to clear the workspace, but then re-loads the scrollerdemo.
Creating a new project based on any game template will create the filesystem game structure, but TGB will not load the new project.
Shutting down TGB and running 'cleandso.bat' didn't help - I'm stuck with the scroller demo.
#13
go into your common/gameScripts/ folder and open main.cs. Replace the onStart() function with this.
and let me know if that fixes it.
EDIT: changed the function
06/15/2006 (12:44 pm)
Very weird... could you try something.go into your common/gameScripts/ folder and open main.cs. Replace the onStart() function with this.
function onStart()
{
Parent::onStart();
echo("\n--------- Initializing Common ---------");
$Scripts::ignoreDSOs = true;
// Load preferences.
exec("./preferences/defaultPrefs.cs");
if (isFile("./preferences/prefs.cs") || isFile("./preferences/prefs.cs.dso"))
exec("./preferences/prefs.cs");
$Scripts::ignoreDSOs = false;
// Initialise stuff.
exec("./gameScripts/common.cs");
initializeCommon();
}and let me know if that fixes it.
EDIT: changed the function
#14
Replacing the onStart() function + cleaning dso's seemed to fix the issue. I can now open and create new projects, and TGB is playing nice.
06/15/2006 (12:55 pm)
@Matthew there is no main.cs is the /common/gameScripts/ folder, so I assume it's the main.cs in /common/ folder. Replacing the onStart() function + cleaning dso's seemed to fix the issue. I can now open and create new projects, and TGB is playing nice.
#15
It seems it was grabbing the prefs off of the .dso and not the .cs, so when your last loaded project was saved out it wouldn't load that in, it would just load whatever the .dso had compiled.
06/15/2006 (12:58 pm)
Thanks, lol my mind is in 10 different place, sorry about the "gameScripts" folder... Glad to hear it worked. It seems it was grabbing the prefs off of the .dso and not the .cs, so when your last loaded project was saved out it wouldn't load that in, it would just load whatever the .dso had compiled.
#16
06/15/2006 (2:15 pm)
Yep, i suspected it to be something like that, thanks Matthew :-), i can open projects now, but i'm still in limbo as the same problem seems to be preventing the level editor from saving any changes after the saved button is pressed or after the play button is used :(
#17
What is the potential negative effects (if any) of leaving the function in this fashion?
06/15/2006 (2:29 pm)
Ok, thus far everything works as normal (finally, thanks again Matthew :)), but theres a catch, it only all works if i remark this line://$Scripts::ignoreDSOs = false;
What is the potential negative effects (if any) of leaving the function in this fashion?
#18
Here's how the section of code should look now:
There are some other spots that will need similar things done in order to get copy/paste to work right. For now, let me know if that works for you.
I can't really figure out why this is happening to just a couple of people, but these fixes should insure it works for everyone.
06/15/2006 (2:34 pm)
Fix for the level saving issue. This goes in tools/levelEditor/scripts/levelManagement.cs at line 173 right after %fo.delete();// Make sure the dso doesn't interfere with the level.
if (isFile( $currentLevelFile @ ".dso" ))
fileDelete($currentLevelFile @ ".dso");Here's how the section of code should look now:
// Save the Level
if( isWriteableFileName( $currentLevelFile ) )
{
%fo = new FileObject();
%fo.openForWrite($currentLevelFile);
%fo.writeObject(%scenegraph, "%levelContent = ");
%fo.close();
%fo.delete();
// Make sure the dso doesn't interfere with the level.
if (isFile( $currentLevelFile @ ".dso" ))
fileDelete($currentLevelFile @ ".dso");
}There are some other spots that will need similar things done in order to get copy/paste to work right. For now, let me know if that works for you.
I can't really figure out why this is happening to just a couple of people, but these fixes should insure it works for everyone.
#19
Commenting out that line will leave ignoreDSOs on, which isn't really a problem - until you package your game. Packaged games don't have .cs files and thus no scripts will be able to load.
06/15/2006 (2:38 pm)
$scripts::ignoreDSOs tells the script interpreter to always recompile DSOs regardless of whether or not an existing DSO is found.Commenting out that line will leave ignoreDSOs on, which isn't really a problem - until you package your game. Packaged games don't have .cs files and thus no scripts will be able to load.
#20
EDIT: it's strange, we've all downloaded the same build (allegedly) yet only 2-3 peeps have had the symptons of this problem, i'll say it a third time, welcome to The Torqlight Zone!
06/15/2006 (2:47 pm)
O righty then, thanks for the info, so bascially when i'm ready to package, i should remove the remark and the package build should be cool right?EDIT: it's strange, we've all downloaded the same build (allegedly) yet only 2-3 peeps have had the symptons of this problem, i'll say it a third time, welcome to The Torqlight Zone!
Torque Owner Andrew Douglas
-Andrew