Sign in to follow this  
game of thought

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

Recommended Posts

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

Share this post


Link to post
Share on other sites
ultramailman    1720

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this