iTorque save file help
by Andrew Deters · in iTorque 2D · 10/14/2011 (1:40 am) · 22 replies
I used a tutorial to learn save files for torque 2D, but that technique is not compatible with iTorque. The code I was trying to use is this.
The first time I run the game on an iOS device it will load the data fine, but every time after that it will say the SaveData_mod.cs is not there but still the isFile() will call back true.
function LoadSaves()
{
%loadpath = "~/data/saves/SaveData_mod.cs";
if ((isFile(%loadpath)) || (isFile(%loadpath @ ".dso")))
{
echo("Loading the existing save file");
//loading modified leveldata
exec(%loadpath);
}
else
{
echo("no save file found");
exec("~/../data/saves/SaveData.cs");
//SaveList is the simset my saves are in
SaveList.save(%loadpath);
}
}The first time I run the game on an iOS device it will load the data fine, but every time after that it will say the SaveData_mod.cs is not there but still the isFile() will call back true.
About the author
#2
10/14/2011 (11:55 am)
Removed bug tag. Ronny is correct in his solution.
#3
10/14/2011 (12:24 pm)
Like that? I modified the original post.
#4
Try this sequence of events:
-Save the simset
-Compile the .cs with compile(%whatever)
-Delete the .cs, leaving only a .dso
-Only check for and load a .dso when it's loading time
10/14/2011 (1:28 pm)
Now I'm confused. You shouldn't modify the original post.Try this sequence of events:
-Save the simset
-Compile the .cs with compile(%whatever)
-Delete the .cs, leaving only a .dso
-Only check for and load a .dso when it's loading time
#5
10/14/2011 (1:28 pm)
@Andrew - Can you post a console log for us?
#6
10/14/2011 (1:32 pm)
I am far more confused than you are. And I have no idea what you are saying. I have trouble understanding concepts that I can't see. But I will change the original post back.
#7
10/14/2011 (2:00 pm)
I think what Ronny means, is that if you change the original post, then there's no history. Make the changes, but add another segment to the post, maybe, so people can compare?
#8
Loading the existing save file
Missing file: /private/var/mobile/Applications/44F9DE7D-3664-4DE2-A088-225E7C80A964/iTorque2DGame.app/Scripts/data/saves/leveldata_mod.cs!
I knew he ment to not change the first post, its the rest of the stuff he said that i dont get
10/14/2011 (3:08 pm)
This is the concole log.Loading the existing save file
Missing file: /private/var/mobile/Applications/44F9DE7D-3664-4DE2-A088-225E7C80A964/iTorque2DGame.app/Scripts/data/saves/leveldata_mod.cs!
I knew he ment to not change the first post, its the rest of the stuff he said that i dont get
#9
10/20/2011 (10:32 pm)
I think I might be saving and loading in a location I cant do that from. Any thoughts?
#10
10/22/2011 (6:57 pm)
I just dont know what to do. I feel like giving up.
#11
10/22/2011 (8:15 pm)
Yes. As a beginner programmer, like my self (2 years, and only in Torque) I am confused as to what to do and feel any resources that explain how are in no way sufficient. I think building a save tutorial should be a very prominent task for the GG crew to accomplish soon.
#12
10/22/2011 (11:32 pm)
I have looked up many different pages in the search. They all had great looking code. If I find one that can potentially save a simset I ether don't have enough info to implement it, or I still get the problem of "Missing file:". even tho I know the file exists.
#13
I've made a post about it here:
http://www.garagegames.com/community/forums/viewthread/128226
10/23/2011 (8:30 am)
I have a save system that works fine on windows platform but when on an iOS device even the file containing the code for the save system doesn't show up even though its where it should be. It gives the same error above that you describe with the missing file.I've made a post about it here:
http://www.garagegames.com/community/forums/viewthread/128226
#14
10/23/2011 (2:46 pm)
sorry i cant help, but if i get it i will let you know.
#15
10/23/2011 (5:32 pm)
Quote:the isFile() will call back true.Well, you have two conditions that could be met. Which one is true? The .cs or the .dso?
#16
10/23/2011 (6:33 pm)
the .cs is true, but then the error says the .cs file is missing. I know nothing about where, or what I am not aloud to write on iOS. Is there any place where I can learn a new way to save my simset that is compatible with iOS?
#17
10/24/2011 (10:04 am)
This is exactly the question I need answered too, where in iOS can I tell save() to save to.
#18
iOS has a similiar application directory but how do I get torque to give me that address in iOS so I can use it in the save() function?
10/24/2011 (4:58 pm)
I know in windows app data is saved "C:\Documents and Settings\*user name*\Application Data\*application name*iOS has a similiar application directory but how do I get torque to give me that address in iOS so I can use it in the save() function?
#19
Any idea about the save directory for ios???
We are really stuck without it...
Any help would be greatly appreciated..
Ps michael? Did you have a look at the information we sent you?
Thankyou for the help
11/02/2011 (4:49 pm)
Hi guys.... Any idea about the save directory for ios???
We are really stuck without it...
Any help would be greatly appreciated..
Ps michael? Did you have a look at the information we sent you?
Thankyou for the help
#20
11/09/2011 (7:35 pm)
This info would be really great for me. I am working on my game all by my self so I need all the help I can get.
Torque 3D Owner Ronny Bangsund
Torque Cheerleaders