How do I get NW.js write file to work?

Get help using Construct 2

Post » Sat Feb 28, 2015 4:14 pm

I tried:
Write file: file "test.txt", contents "abc"
and exported the project.

I would expect the file "test.txt" to appear in the exported program's directory, but it doesn't. What's wrong? A working example would also do the job.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Thu Mar 26, 2015 9:04 pm

I was about to open a thread to ask the same, as I haven't find the answer after many and many searches.

I basically can't make the actions to work at all, even if I set
Start of layout -> NWjs -> set clipboard text to "test"

Nothing happens, the clipboard still have whatever it had at than moment.

My goal is, as @mindfaQ 's, to be able to write an external file. I also think a working file would be enough for me (I hope).

Thanks.
B
7
S
1
G
3
Posts: 11
Reputation: 1,237

Post » Fri Mar 27, 2015 2:50 pm

OK, part of the solution to this... if I export the project with NW.js then it works... but if I export it to HTML5 it doesn't (I've tried directly from the folder on my desktop or uploading to my public dropbox folder).

Is there a way to write external files in HTML5? Maybe not using NW.js, but other method?
B
7
S
1
G
3
Posts: 11
Reputation: 1,237

Post » Sat Feb 27, 2016 10:24 pm

I also want to write a plain text file. I need that the project can continuously store new data. I created a kind of database with a TXT file. Since not exist in Construct2 some that can be manipulated such as a MySQL database. But I don't know writing in my text file "data.txt"...
B
27
S
10
G
2
Posts: 39
Reputation: 2,869

Post » Sun Feb 28, 2016 11:57 am

FERdeBOER wrote:OK, part of the solution to this... if I export the project with NW.js then it works... but if I export it to HTML5 it doesn't (I've tried directly from the folder on my desktop or uploading to my public dropbox folder).

Is there a way to write external files in HTML5? Maybe not using NW.js, but other method?

Conditions and actions of NW.JS work only if you preview with NW.js and/or export as NW.JS.
“The best time to plant a tree is 20 years ago. The second best time is now.”
B
31
S
7
G
4
Posts: 382
Reputation: 4,528


Return to How do I....?

Who is online

Users browsing this forum: AekiroStudio, Lancifer, lucstanislash, RetroSpock and 13 guests