1 Replies - 3836 Views - Last Post: 31 May 2012 - 10:08 AM Rate Topic: -----

#1 newbienew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 16-May 12

help for gamemaker

Posted 16 May 2012 - 08:23 PM

Im trying to save the login name of the user and the score into a textfile. however, i only manage to either save the name of user or score.

inputText_[0] = global.chara
inputText_[1] = global.score

var file, i, j, size;
size = 1;
file = file_text_open_write("Highscore.txt");  


for (i=0; i<1; i+=1)
 {
         file_text_write_string(file, global.chara);

                for (j=0; j<1; j+=1)
                {
               // if string(ds_map_find_value(_data, j)) == name[i] {
                 //   count += 1;
                        file_text_write_string(file, global.score);
                }
            
            file_text_writeln(file)
 }
file_text_close(file)

This post has been edited by GunnerInc: 16 May 2012 - 08:29 PM
Reason for edit:: Added code tags *** Please use code tags! ***


Is This A Good Question/Topic? 0
  • +

Replies To: help for gamemaker

#2 3P1C_F@!l  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 98
  • Joined: 01-March 11

Re: help for gamemaker

Posted 31 May 2012 - 10:08 AM

Try writing both strings in your for loop..

inputText_[0] = global.chara
inputText_[1] = global.score
	 
var file, i, j, size;
size = 1;
file = file_text_open_write("Highscore.txt"); 

for (i=0; i<1; i+=1)
{
       file_text_write_string(file, global.chara);
       file_text_write_string(file, global.score);
	 
	                for (j=0; j<1; j+=1)
	                {
	               // if string(ds_map_find_value(_data, j)) == name[i] {
	                 //   count += 1;
	                        file_text_write_string(file, global.score);
	                }
	             
	            file_text_writeln(file)
	 }
	file_text_close(file)


This post has been edited by 3P1C_F@!l: 31 May 2012 - 10:09 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1