Highscore Problem (ini)

  • Highscore Problem (ini)

    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:

    GML-Quellcode

    1. if (global.highscore==1)
    2. {
    3. if score > real(global.highscore1)
    4. {
    5. //Punkte//
    6. global.highscore10 = global.highscore9
    7. global.highscore9 = global.highscore8
    8. global.highscore8 = global.highscore7
    9. global.highscore7 = global.highscore6
    10. global.highscore6 = global.highscore5
    11. global.highscore5 = global.highscore4
    12. global.highscore4 = global.highscore3
    13. global.highscore3 = global.highscore2
    14. global.highscore2 = global.highscore1
    15. global.highscore1 = score
    16. //Name//
    17. global.name10 = global.name9
    18. global.name9 = global.name8
    19. global.name8 = global.name7
    20. global.name7 = global.name6
    21. global.name6 = global.name5
    22. global.name5 = global.name4
    23. global.name4 = global.name3
    24. global.name3 = global.name2
    25. global.name2 = global.name1
    26. global.name1 = global.eintrag
    27. //Schwierigkeit//
    28. global.difficult10 = global.difficult9
    29. global.difficult9 = global.difficult8
    30. global.difficult8 = global.difficult7
    31. global.difficult7 = global.difficult6
    32. global.difficult6 = global.difficult5
    33. global.difficult5 = global.difficult4
    34. global.difficult4 = global.difficult3
    35. global.difficult3 = global.difficult2
    36. global.difficult2 = global.difficult1
    37. global.difficult1 = global.difficult_text
    38. //draw//
    39. global.draw_high=1;
    40. }
    41. else if score > real(global.highscore2)
    42. {
    43. //Punkte//
    44. global.highscore10 = global.highscore9
    45. global.highscore9 = global.highscore8
    46. global.highscore8 = global.highscore7
    47. global.highscore7 = global.highscore6
    48. global.highscore6 = global.highscore5
    49. global.highscore5 = global.highscore4
    50. global.highscore4 = global.highscore3
    51. global.highscore3 = global.highscore2
    52. global.highscore2 = score
    53. //Name//
    54. global.name10 = global.name9
    55. global.name9 = global.name8
    56. global.name8 = global.name7
    57. global.name7 = global.name6
    58. global.name6 = global.name5
    59. global.name5 = global.name4
    60. global.name4 = global.name3
    61. global.name3 = global.name2
    62. global.name2 = global.eintrag
    63. //Schwierigkeit//
    64. global.difficult10 = global.difficult9
    65. global.difficult9 = global.difficult8
    66. global.difficult8 = global.difficult7
    67. global.difficult7 = global.difficult6
    68. global.difficult6 = global.difficult5
    69. global.difficult5 = global.difficult4
    70. global.difficult4 = global.difficult3
    71. global.difficult3 = global.difficult2
    72. global.difficult2 = global.difficult_text
    73. //draw//
    74. global.draw_high=2;
    75. }
    76. else if score > real(global.highscore3)
    77. {
    78. //Punkte//
    79. global.highscore10 = global.highscore9
    80. global.highscore9 = global.highscore8
    81. global.highscore8 = global.highscore7
    82. global.highscore7 = global.highscore6
    83. global.highscore6 = global.highscore5
    84. global.highscore5 = global.highscore4
    85. global.highscore4 = global.highscore3
    86. global.highscore3 = score
    87. //Name//
    88. global.name10 = global.name9
    89. global.name9 = global.name8
    90. global.name8 = global.name7
    91. global.name7 = global.name6
    92. global.name6 = global.name5
    93. global.name5 = global.name4
    94. global.name4 = global.name3
    95. global.name3 = global.eintrag
    96. //Schwierigkeit//
    97. global.difficult10 = global.difficult9
    98. global.difficult9 = global.difficult8
    99. global.difficult8 = global.difficult7
    100. global.difficult7 = global.difficult6
    101. global.difficult6 = global.difficult5
    102. global.difficult5 = global.difficult4
    103. global.difficult4 = global.difficult3
    104. global.difficult3 = global.difficult_text
    105. //draw//
    106. global.draw_high=3;
    107. }
    108. else if score > real(global.highscore4)
    109. {
    110. //Punkte//
    111. global.highscore10 = global.highscore9
    112. global.highscore9 = global.highscore8
    113. global.highscore8 = global.highscore7
    114. global.highscore7 = global.highscore6
    115. global.highscore6 = global.highscore5
    116. global.highscore5 = global.highscore4
    117. global.highscore4 = score
    118. //Name//
    119. global.name10 = global.name9
    120. global.name9 = global.name8
    121. global.name8 = global.name7
    122. global.name7 = global.name6
    123. global.name6 = global.name5
    124. global.name5 = global.name4
    125. global.name4 = global.eintrag
    126. //Schwierigkeit//
    127. global.difficult10 = global.difficult9
    128. global.difficult9 = global.difficult8
    129. global.difficult8 = global.difficult7
    130. global.difficult7 = global.difficult6
    131. global.difficult6 = global.difficult5
    132. global.difficult5 = global.difficult4
    133. global.difficult4 = global.difficult_text
    134. //draw//
    135. global.draw_high=4;
    136. }
    137. else if score > real(global.highscore5)
    138. {
    139. //Punkte//
    140. global.highscore10 = global.highscore9
    141. global.highscore9 = global.highscore8
    142. global.highscore8 = global.highscore7
    143. global.highscore7 = global.highscore6
    144. global.highscore6 = global.highscore5
    145. global.highscore5 = score
    146. //Name//
    147. global.name10 = global.name9
    148. global.name9 = global.name8
    149. global.name8 = global.name7
    150. global.name7 = global.name6
    151. global.name6 = global.name5
    152. global.name5 = global.eintrag
    153. //Schwierigkeit//
    154. global.difficult10 = global.difficult9
    155. global.difficult9 = global.difficult8
    156. global.difficult8 = global.difficult7
    157. global.difficult7 = global.difficult6
    158. global.difficult6 = global.difficult5
    159. global.difficult5 = global.difficult_text
    160. //draw//
    161. global.draw_high=5;
    162. }
    163. else if score > real(global.highscore6)
    164. {
    165. //Punkte//
    166. global.highscore10 = global.highscore9
    167. global.highscore9 = global.highscore8
    168. global.highscore8 = global.highscore7
    169. global.highscore7 = global.highscore6
    170. global.highscore6 = score
    171. //Name//
    172. global.name10 = global.name9
    173. global.name9 = global.name8
    174. global.name8 = global.name7
    175. global.name7 = global.name6
    176. global.name6 = global.eintrag
    177. //Schwierigkeit//
    178. global.difficult10 = global.difficult9
    179. global.difficult9 = global.difficult8
    180. global.difficult8 = global.difficult7
    181. global.difficult7 = global.difficult6
    182. global.difficult6 = global.difficult_text
    183. //draw//
    184. global.draw_high=6;
    185. }
    186. else if score > real(global.highscore7)
    187. {
    188. //Punkte//
    189. global.highscore10 = global.highscore9
    190. global.highscore9 = global.highscore8
    191. global.highscore8 = global.highscore7
    192. global.highscore7 = score
    193. //Name//
    194. global.name10 = global.name9
    195. global.name9 = global.name8
    196. global.name8 = global.name7
    197. global.name7 = global.eintrag
    198. //Schwierigkeit//
    199. global.difficult10 = global.difficult9
    200. global.difficult9 = global.difficult8
    201. global.difficult8 = global.difficult7
    202. global.difficult7 = global.difficult_text
    203. //draw//
    204. global.draw_high=7;
    205. }
    206. else if score > real(global.highscore8)
    207. {
    208. //Punkte//
    209. global.highscore10 = global.highscore9
    210. global.highscore9 = global.highscore8
    211. global.highscore8 = score
    212. //Name//
    213. global.name10 = global.name9
    214. global.name9 = global.name8
    215. global.name8 = global.eintrag
    216. //Schwierigkeit//
    217. global.difficult10 = global.difficult9
    218. global.difficult9 = global.difficult8
    219. global.difficult8 = global.difficult_text
    220. //draw//
    221. global.draw_high=8;
    222. }
    223. else if score > real(global.highscore9)
    224. {
    225. //Punkte//
    226. global.highscore10 = global.highscore9
    227. global.highscore9 = score
    228. //Name//
    229. global.name10 = global.name9
    230. global.name9 = global.eintrag
    231. //Schwierigkeit//
    232. global.difficult10 = global.difficult9
    233. global.difficult9 = global.difficult_text
    234. //draw//
    235. global.draw_high=9;
    236. }
    237. else if score > real(global.highscore10)
    238. {
    239. //Punkte//
    240. global.highscore10 = score
    241. //Name//
    242. global.name10 = global.eintrag
    243. //Schwierigkeit//
    244. global.difficult10 = global.difficult_text
    245. //draw//
    246. global.draw_high=10;
    247. }
    248. global.highscore=0;
    249. score=0;
    250. global.eintrag="";
    251. }
    Alles anzeigen

    Und hier das, wenn der die Ini speichern soll:

    GML-Quellcode

    1. ini_open("game_options.ini")
    2. ini_write_string("highscore","highscore1",global.highscore1);
    3. ini_write_string("highscore","highscore2",global.highscore2);
    4. ini_write_string("highscore","highscore3",global.highscore3);
    5. ini_write_string("highscore","highscore4",global.highscore4);
    6. ini_write_string("highscore","highscore5",global.highscore5);
    7. ini_write_string("highscore","highscore6",global.highscore6);
    8. ini_write_string("highscore","highscore7",global.highscore7);
    9. ini_write_string("highscore","highscore8",global.highscore8);
    10. ini_write_string("highscore","highscore9",global.highscore9);
    11. ini_write_string("highscore","highscore10",global.highscore10);
    12. ini_write_string("highscore","name1",global.name1);
    13. ini_write_string("highscore","name2",global.name2);
    14. ini_write_string("highscore","name3",global.name3);
    15. ini_write_string("highscore","name4",global.name4);
    16. ini_write_string("highscore","name5",global.name5);
    17. ini_write_string("highscore","name6",global.name6);
    18. ini_write_string("highscore","name7",global.name7);
    19. ini_write_string("highscore","name8",global.name8);
    20. ini_write_string("highscore","name9",global.name9);
    21. ini_write_string("highscore","name10",global.name10);
    22. ini_write_string("highscore","difficult1",global.difficult1);
    23. ini_write_string("highscore","difficult2",global.difficult2);
    24. ini_write_string("highscore","difficult3",global.difficult3);
    25. ini_write_string("highscore","difficult4",global.difficult4);
    26. ini_write_string("highscore","difficult5",global.difficult5);
    27. ini_write_string("highscore","difficult6",global.difficult6);
    28. ini_write_string("highscore","difficult7",global.difficult7);
    29. ini_write_string("highscore","difficult8",global.difficult8);
    30. ini_write_string("highscore","difficult9",global.difficult9);
    31. ini_write_string("highscore","difficult10",global.difficult10);
    32. ini_close()
    Alles anzeigen

    Und hier wird geloadet:

    GML-Quellcode

    1. ini_open("game_options.ini")
    2. global.highscore1=ini_read_string("highscore","highscore1",0);
    3. global.highscore2=ini_read_string("highscore","highscore2",0);
    4. global.highscore3=ini_read_string("highscore","highscore3",0);
    5. global.highscore4=ini_read_string("highscore","highscore4",0);
    6. global.highscore5=ini_read_string("highscore","highscore5",0);
    7. global.highscore6=ini_read_string("highscore","highscore6",0);
    8. global.highscore7=ini_read_string("highscore","highscore7",0);
    9. global.highscore8=ini_read_string("highscore","highscore8",0);
    10. global.highscore9=ini_read_string("highscore","highscore9",0);
    11. global.highscore10=ini_read_string("highscore","highscore10",0);
    12. global.name1=ini_read_string("highscore","name1",0);
    13. global.name2=ini_read_string("highscore","name2",0);
    14. global.name3=ini_read_string("highscore","name3",0);
    15. global.name4=ini_read_string("highscore","name4",0);
    16. global.name5=ini_read_string("highscore","name5",0);
    17. global.name6=ini_read_string("highscore","name6",0);
    18. global.name7=ini_read_string("highscore","name7",0);
    19. global.name8=ini_read_string("highscore","name8",0);
    20. global.name9=ini_read_string("highscore","name9",0);
    21. global.name10=ini_read_string("highscore","name10",0);
    22. global.difficult1=ini_read_string("highscore","difficult1",0);
    23. global.difficult2=ini_read_string("highscore","difficult2",0);
    24. global.difficult3=ini_read_string("highscore","difficult3",0);
    25. global.difficult4=ini_read_string("highscore","difficult4",0);
    26. global.difficult5=ini_read_string("highscore","difficult5",0);
    27. global.difficult6=ini_read_string("highscore","difficult6",0);
    28. global.difficult7=ini_read_string("highscore","difficult7",0);
    29. global.difficult8=ini_read_string("highscore","difficult8",0);
    30. global.difficult9=ini_read_string("highscore","difficult9",0);
    31. global.difficult10=ini_read_string("highscore","difficult10",0);
    32. ini_close()
    Alles anzeigen

    Könnt ihr euch erklären, woran das liegen kann???