Also ich mach das bei Colors 3 so, dass die Highscore in einer Ini gespeichert wird (da sie selbst gemacht ist)
Jetzt habe ich folgendes Problem und kann mir überhaupt nicht erklären, woran das liegt!
Am Ende des Spiels soll der die Varialben in die Ini speichern!
Das macht der auch, bis auf den Highscore eintrag, der zuletzt eingetragen wurde!!!
Die Namen und die Schwierigkeitsgrade speichert der alle nur den zuletzt eingetragenen Punkte stand nicht!!!
Hier mal das Script, was kommt, wenn man einträgt:
Alles anzeigen
Und hier das, wenn der die Ini speichern soll:
Alles anzeigen
Und hier wird geloadet:
Alles anzeigen
Könnt ihr euch erklären, woran das liegen kann???
Jetzt habe ich folgendes Problem und kann mir überhaupt nicht erklären, woran das liegt!
Am Ende des Spiels soll der die Varialben in die Ini speichern!
Das macht der auch, bis auf den Highscore eintrag, der zuletzt eingetragen wurde!!!
Die Namen und die Schwierigkeitsgrade speichert der alle nur den zuletzt eingetragenen Punkte stand nicht!!!
Hier mal das Script, was kommt, wenn man einträgt:
GML-Quellcode
- if (global.highscore==1)
- {
- if score > real(global.highscore1)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = global.highscore7
- global.highscore7 = global.highscore6
- global.highscore6 = global.highscore5
- global.highscore5 = global.highscore4
- global.highscore4 = global.highscore3
- global.highscore3 = global.highscore2
- global.highscore2 = global.highscore1
- global.highscore1 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.name7
- global.name7 = global.name6
- global.name6 = global.name5
- global.name5 = global.name4
- global.name4 = global.name3
- global.name3 = global.name2
- global.name2 = global.name1
- global.name1 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult7
- global.difficult7 = global.difficult6
- global.difficult6 = global.difficult5
- global.difficult5 = global.difficult4
- global.difficult4 = global.difficult3
- global.difficult3 = global.difficult2
- global.difficult2 = global.difficult1
- global.difficult1 = global.difficult_text
- //draw//
- global.draw_high=1;
- }
- else if score > real(global.highscore2)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = global.highscore7
- global.highscore7 = global.highscore6
- global.highscore6 = global.highscore5
- global.highscore5 = global.highscore4
- global.highscore4 = global.highscore3
- global.highscore3 = global.highscore2
- global.highscore2 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.name7
- global.name7 = global.name6
- global.name6 = global.name5
- global.name5 = global.name4
- global.name4 = global.name3
- global.name3 = global.name2
- global.name2 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult7
- global.difficult7 = global.difficult6
- global.difficult6 = global.difficult5
- global.difficult5 = global.difficult4
- global.difficult4 = global.difficult3
- global.difficult3 = global.difficult2
- global.difficult2 = global.difficult_text
- //draw//
- global.draw_high=2;
- }
- else if score > real(global.highscore3)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = global.highscore7
- global.highscore7 = global.highscore6
- global.highscore6 = global.highscore5
- global.highscore5 = global.highscore4
- global.highscore4 = global.highscore3
- global.highscore3 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.name7
- global.name7 = global.name6
- global.name6 = global.name5
- global.name5 = global.name4
- global.name4 = global.name3
- global.name3 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult7
- global.difficult7 = global.difficult6
- global.difficult6 = global.difficult5
- global.difficult5 = global.difficult4
- global.difficult4 = global.difficult3
- global.difficult3 = global.difficult_text
- //draw//
- global.draw_high=3;
- }
- else if score > real(global.highscore4)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = global.highscore7
- global.highscore7 = global.highscore6
- global.highscore6 = global.highscore5
- global.highscore5 = global.highscore4
- global.highscore4 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.name7
- global.name7 = global.name6
- global.name6 = global.name5
- global.name5 = global.name4
- global.name4 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult7
- global.difficult7 = global.difficult6
- global.difficult6 = global.difficult5
- global.difficult5 = global.difficult4
- global.difficult4 = global.difficult_text
- //draw//
- global.draw_high=4;
- }
- else if score > real(global.highscore5)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = global.highscore7
- global.highscore7 = global.highscore6
- global.highscore6 = global.highscore5
- global.highscore5 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.name7
- global.name7 = global.name6
- global.name6 = global.name5
- global.name5 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult7
- global.difficult7 = global.difficult6
- global.difficult6 = global.difficult5
- global.difficult5 = global.difficult_text
- //draw//
- global.draw_high=5;
- }
- else if score > real(global.highscore6)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = global.highscore7
- global.highscore7 = global.highscore6
- global.highscore6 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.name7
- global.name7 = global.name6
- global.name6 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult7
- global.difficult7 = global.difficult6
- global.difficult6 = global.difficult_text
- //draw//
- global.draw_high=6;
- }
- else if score > real(global.highscore7)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = global.highscore7
- global.highscore7 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.name7
- global.name7 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult7
- global.difficult7 = global.difficult_text
- //draw//
- global.draw_high=7;
- }
- else if score > real(global.highscore8)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = global.highscore8
- global.highscore8 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.name8
- global.name8 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult8
- global.difficult8 = global.difficult_text
- //draw//
- global.draw_high=8;
- }
- else if score > real(global.highscore9)
- {
- //Punkte//
- global.highscore10 = global.highscore9
- global.highscore9 = score
- //Name//
- global.name10 = global.name9
- global.name9 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult9
- global.difficult9 = global.difficult_text
- //draw//
- global.draw_high=9;
- }
- else if score > real(global.highscore10)
- {
- //Punkte//
- global.highscore10 = score
- //Name//
- global.name10 = global.eintrag
- //Schwierigkeit//
- global.difficult10 = global.difficult_text
- //draw//
- global.draw_high=10;
- }
- global.highscore=0;
- score=0;
- global.eintrag="";
- }
Und hier das, wenn der die Ini speichern soll:
GML-Quellcode
- ini_open("game_options.ini")
- ini_write_string("highscore","highscore1",global.highscore1);
- ini_write_string("highscore","highscore2",global.highscore2);
- ini_write_string("highscore","highscore3",global.highscore3);
- ini_write_string("highscore","highscore4",global.highscore4);
- ini_write_string("highscore","highscore5",global.highscore5);
- ini_write_string("highscore","highscore6",global.highscore6);
- ini_write_string("highscore","highscore7",global.highscore7);
- ini_write_string("highscore","highscore8",global.highscore8);
- ini_write_string("highscore","highscore9",global.highscore9);
- ini_write_string("highscore","highscore10",global.highscore10);
- ini_write_string("highscore","name1",global.name1);
- ini_write_string("highscore","name2",global.name2);
- ini_write_string("highscore","name3",global.name3);
- ini_write_string("highscore","name4",global.name4);
- ini_write_string("highscore","name5",global.name5);
- ini_write_string("highscore","name6",global.name6);
- ini_write_string("highscore","name7",global.name7);
- ini_write_string("highscore","name8",global.name8);
- ini_write_string("highscore","name9",global.name9);
- ini_write_string("highscore","name10",global.name10);
- ini_write_string("highscore","difficult1",global.difficult1);
- ini_write_string("highscore","difficult2",global.difficult2);
- ini_write_string("highscore","difficult3",global.difficult3);
- ini_write_string("highscore","difficult4",global.difficult4);
- ini_write_string("highscore","difficult5",global.difficult5);
- ini_write_string("highscore","difficult6",global.difficult6);
- ini_write_string("highscore","difficult7",global.difficult7);
- ini_write_string("highscore","difficult8",global.difficult8);
- ini_write_string("highscore","difficult9",global.difficult9);
- ini_write_string("highscore","difficult10",global.difficult10);
- ini_close()
Und hier wird geloadet:
GML-Quellcode
- ini_open("game_options.ini")
- global.highscore1=ini_read_string("highscore","highscore1",0);
- global.highscore2=ini_read_string("highscore","highscore2",0);
- global.highscore3=ini_read_string("highscore","highscore3",0);
- global.highscore4=ini_read_string("highscore","highscore4",0);
- global.highscore5=ini_read_string("highscore","highscore5",0);
- global.highscore6=ini_read_string("highscore","highscore6",0);
- global.highscore7=ini_read_string("highscore","highscore7",0);
- global.highscore8=ini_read_string("highscore","highscore8",0);
- global.highscore9=ini_read_string("highscore","highscore9",0);
- global.highscore10=ini_read_string("highscore","highscore10",0);
- global.name1=ini_read_string("highscore","name1",0);
- global.name2=ini_read_string("highscore","name2",0);
- global.name3=ini_read_string("highscore","name3",0);
- global.name4=ini_read_string("highscore","name4",0);
- global.name5=ini_read_string("highscore","name5",0);
- global.name6=ini_read_string("highscore","name6",0);
- global.name7=ini_read_string("highscore","name7",0);
- global.name8=ini_read_string("highscore","name8",0);
- global.name9=ini_read_string("highscore","name9",0);
- global.name10=ini_read_string("highscore","name10",0);
- global.difficult1=ini_read_string("highscore","difficult1",0);
- global.difficult2=ini_read_string("highscore","difficult2",0);
- global.difficult3=ini_read_string("highscore","difficult3",0);
- global.difficult4=ini_read_string("highscore","difficult4",0);
- global.difficult5=ini_read_string("highscore","difficult5",0);
- global.difficult6=ini_read_string("highscore","difficult6",0);
- global.difficult7=ini_read_string("highscore","difficult7",0);
- global.difficult8=ini_read_string("highscore","difficult8",0);
- global.difficult9=ini_read_string("highscore","difficult9",0);
- global.difficult10=ini_read_string("highscore","difficult10",0);
- ini_close()
Könnt ihr euch erklären, woran das liegen kann???