How to save in txt files

Get help using Construct 2

Post » Tue Oct 28, 2014 4:57 am

I'm creating a game for a college paper, in the end of it I have to save a few informations. I got a some text variables that i need to save, I thought about saving all of them in a txt file, each playthrough in a line, or each in a single txt file. But, I've got no idea of how to do it. Can someone help me?
B
4
Posts: 7
Reputation: 214

Post » Tue Oct 28, 2014 5:27 pm

Have a look at the webstorage object for a way to save info across runs.
https://www.scirra.com/manual/120/webstorage

Also the browser object has a way to invoke a download to a text file, and The nodeWebkit plugin has a way to create a file when using nodewebkit export.
B
94
S
33
G
113
Posts: 5,354
Reputation: 73,269

Post » Thu Oct 30, 2014 4:40 am

Thanks! I managed to download what i wanted, I saved all the information in a global variable and then downloaded it with the "invoke download of string" function of the browser object. But I realized that it would be better if I could download it as PDF. I used the "application/pdf" in the MIME type and ".pdf" in the file name, but it still doesn't work, it says it can't be opened. Is there a way to download as .pdf?
B
4
Posts: 7
Reputation: 214

Post » Thu Oct 30, 2014 8:10 am

You could make use of the pdf plugin found here: https://www.scirra.com/forum/plugin-jspdf_t97838
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,484
Reputation: 59,754

Post » Fri Oct 31, 2014 12:46 am

Thanks! It worked perfectly!
B
4
Posts: 7
Reputation: 214


Return to How do I....?

Who is online

Users browsing this forum: 8tomo8 and 5 guests