Hab mal wieder ne frage. Also ich will in ein Textdokument schreiben. Und zwar mit Zufall erstellte Namen (ist alles nur mal ein Test, nicht über komische Namen wundern). Doch dann erscheint dieser komische Error:
___________________________________________
ERROR in
action number 1
of Keyboard Event for <Enter> Key
for object obj_name_generator:
Error opening file for writing.
So hier ist der Code:
Alles anzeigen
___________________________________________
ERROR in
action number 1
of Keyboard Event for <Enter> Key
for object obj_name_generator:
Error opening file for writing.
So hier ist der Code:
GML-Quellcode
- file=file_text_open_write(names.txt)
- for (r=0;r<=20;r+=1)
- {
- name=""
- lettercount=round(random(7))+3
- kon=choose(true,false)
- for (i=0;i<=lettercount;i+=1)
- {if kon=true
- {addstring=choose("a","e","i","o","u")
- if choose(0,1,2,3,4,5)=0&&i!=0 {addstring=choose("ei","ee","aa","oo","ai","au")}
- }
- if kon=false
- {n=choose(true,false)
- {if n=true {addstring=choose("b","c","d","f","g","h","i","j","k","l","m","n")}
- else {addstring=choose("t","u","v","w","x","y","z","o","p","r","s")}
- if choose(0,1,2,3,4,5)=0&&i!=0 {addstring=choose("st","ck","ch","tt","pf","sch","pp","rr","ll")}
- }
- }
- if kon=false {kon=true}
- else {kon=false}
- name+=addstring
- }
- file_text_write_string(file,string(name))
- file_text_writeln(file)
- }
- file_text_close(file)