problem with saving high score name on GE

Non-platform specific questions.

problem with saving high score name on GE

Postby frodo » Sun Mar 26, 2006 3:52 am

I am able to save the high score itself, but am having trouble saving the name that goes with the high score. Can anyone help?
Thanks
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby makslane » Sun Mar 26, 2006 4:19 am

Can you send me the game?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby frodo » Mon Mar 27, 2006 4:21 am

should I export the game before uploading it?
last time I uploaded something it had an error with loading the animations.
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby plinydogg » Mon Mar 27, 2006 12:56 pm

Frodo,

Quick question: are you using strcpy()? I had problems saving the name associated with a high score a little while back and they all stemmed from the fact that I wasn't using strcpy().

Just thought I'd ask.
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score

Postby frodo » Mon Mar 27, 2006 3:59 pm

No, I'm not using strcpy. do you know how I can save it?
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby frodo » Mon Mar 27, 2006 5:36 pm

I tried to upload it, and it won't work.
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby plinydogg » Mon Mar 27, 2006 11:57 pm

This may not be what your problem is, but this is how I did it:

strcpy(Score01Name, TextActor.text);
Score01Level = level;
Score01Score = score;
saveVars("game.sav", "high scores");

Score01Name is a global string variable. TextActor is a text actor that has the holds the name of the high scorer. I copy the contents of TextActor into Score01Name with the strcpy() command. The other two are saved just like you normallly save global integer variables. Hope this helps a little bit.
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score

Postby frodo » Tue Mar 28, 2006 5:07 am

it didn't work.
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby plinydogg » Tue Mar 28, 2006 4:48 pm

Are you sure that your high score name variable is both GLOBAL and a STRING variable?
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score

Postby frodo » Tue Mar 28, 2006 4:52 pm

yes
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby plinydogg » Tue Mar 28, 2006 8:30 pm

Okay. What exactly are you doing? :?
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score

Postby frodo » Tue Mar 28, 2006 9:10 pm

here's what I'm doing:

save=name.text;
saveVars("game.sav","scores");

I don't need to save the score; I can do that. I have my high score, and there should be a name with it.

for example, A guy named Jon makes a high score. He puts his name in,"Jon". The next person that plays the game should be able to see the high score, and see Jon's name by it.
Thanks for your patience with a little guy like me!
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby plinydogg » Tue Mar 28, 2006 10:43 pm

Instead of this:

save = name.text;

Use this:

strcpy(save, name.text);

This copies the contents of name.text into the save variable. You can't do it the same way that you assign a number value to a variable (which is in effect what you're doing by using the code save = name.text;).

As far as I know, every time you want to do anything with strings, you have to use strcpy(). Examples:

strcpy(save, name.text); //copies the contents of name.text into save
strcpy(name.text, save); //copies the contents of save into name.text

I hope this helps solve your problem. And you don't have to thank me for my patience. I had the exact same problem you're having and others were patient enough to help me, so it's the least I can do....I just hope that it works!
plinydogg
 
Posts: 104
Joined: Thu Aug 25, 2005 8:34 pm
Score: 0 Give a positive score

Postby frodo » Wed Mar 29, 2006 3:50 pm

When you make the save variable, what do you you put in the save group?

Thanks
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby Fuzzy » Wed Mar 29, 2006 11:17 pm

You name the save group whatever you want.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest