Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


when save game is loaded, an ugly \n appears at the end of string variables


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 game of thought   Members   -  Reputation: 213

Like
0Likes
Like

Posted 28 February 2013 - 01:24 PM

Not so much of a technical problem as a cosmetic problem, but when loading from game generated save files, a ugly \n for the breaks between lines appear in string variables. 

 

For example:

 

filen.write(name)#your name
        filen.write("\n")
 
 
the above results in in this in the console window:
 
Dryad Berserker\n
 
for example, the classes are variable
 
what i want to know is if or how i can remove this
 
thank you for your time


Sponsor:

#2 ultramailman   Prime Members   -  Reputation: 1582

Like
0Likes
Like

Posted 28 February 2013 - 03:41 PM

You can remove the line

filen.write("\n")

 

or you can use the strip method on the string,

 

or you can just write your game save loader in such a way that it will decide which newlines should be ignored.

 

That's all I can think of now.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS