Liste aus Datei
Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen
-
-
GML-Quellcode
- //create event
- var file;
- file=0
- count=0//das ist zum drawen da
- if !(file_exists("datei.txt"))
- {
- game_end();
- exit;
- }
- file=file_text_open_read("datei.txt")
- for (i=0;!file_text_eof(file);i+=1;)
- {
- list[i,0]=file_text_read_string(file)
- file_text_readln(file)
- list[i,1]=file_text_read_string(file)
- file_text_readln(file)
- count=i
- }
Und dann kannst du list drawen. Z.b. so:
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von henrik1235 ()
-
THX Aber jetzt bekomm ich den Fehler:
File is not opened for reading -
-
Oh ja, dass war das Problem!
Doch jetzt kommt dieses Problem:
___________________________________________
ERROR in
action number 1
of Draw Event
for object object0:
Error in code at line 7:
draw_text(x,y+(i*16),list[i,0])
at position 23: Unknown variable list -
Ich hab da einen kleinen Fehler bei mir.
GML-Quellcode
- //create event
- var file;
- file=0
- count=0//das ist zum drawen da
- if !(file_exists("datei.txt"))
- {
- game_end();
- exit;
- }
- file=file_text_open_read("datei.txt")
- for (i=0;!file_text_eof(file);i+=1;)
- {
- list[i,0]=file_text_read_string(file)
- file_text_readln(file)
- list[i,1]=file_text_read_string(file)
- file_text_readln(file)
- count=i
- }
Sollte es heisse.
Ich häng noch das richtige Example (mit Test Datei.txt) an.
MfG Henrik1235 -
Vielen Dank!
-
-
-
Ja.
Vielen Dank! -
( Ich könnte nicht mehr nen edit machen)
Das Example sollte stimmen. -
-
Kannst du mir das selbe nochmal mit 2 Dateien machen? Ich bekomms net hin.