Danwood's Forum Posts

  • Yep it works! Thank you

  • Yea, it's not very professional indeed xD

  • It works as it is now, here's the js:

    "var fs = require('fs');fs['writeFileSync']('" &replace(NodeWebkit.UserFolder&"\Documents\"&"\DinoSystem\"&"\History\" & "DScreen" & SnapN & ".jpg","\","\\")& "','" &CanvasSnapshot& "'.split(',')[1], {'encoding': 'base64'});"

    the SnapN is just a variable to number the screens

    Is there any advantage in changing to the way you suggested?

    PS: is there a way to tell the game to delete a folder? Looks like i can delete only a single file, but i want to delete all files in the given folder or the whole folder. Just an optional thing though.

  • Yep, Documents is way more professional!

    PS: it works like a charm, but i had to find out that in the js code the path has to be reported with "\folder\"!

    Thanks a lot, mission accomplished!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Oh, well i have a good reason to do that: in my game, the world evolves based on ecological principles, i've created a system that takes a screenshot of the island every ingame day, automatically. After ingame years, you get hundred of screenshots and you can bundle them and create a sort of "history show" of it's evolution. It's an optional feature disabled by default.

    Thanks for the info, i'll try it as i get home and report back!

  • I'm so close to archieving my goal for a new feature in my game, but i need one last step!

    Baiscally, my game takes a canvas snapshot (in NW.js), and automatically saves it on the computer in png.

    I use a custom js to do that:

    "var fs = require('fs');fs['writeFileSync']('" &replace(NodeWebkit.UserFolder & "screenshot" & ".png","\","\\")& "','" &CanvasSnapshot& "'.split(',')[1], {'encoding': 'base64'});"

    I just want it to save on the user Desktop, and possibly on a custom folder created there. I know the part i need to focus on is replace(NodeWebkit.UserFolder, but i really have no clue of how to point it to the desktop, and then a custom new folder

    Anyone can help? Plz

  • I got this js expression that saves a snapshot on my user folder:

    "var fs = require('fs');fs['writeFileSync']('" &replace(NodeWebkit.UserFolder & "screenshot" & ".png","\","\\")& "','" &CanvasSnapshot& "'.split(',')[1], {'encoding': 'base64'});"

    I used NodeWebkit.UserFolder for saving it on my User folder, but i need it to be on the desktop, what should i add to that?

  • Jermfire

    Node Webkit

  • I've noticed it as well, looks like it happens when using 2 differenct conditions, 1 with an ihnstance, and the other global, but i may be wrong. I recommend making a proper bug report so Ashley could look into it better.

  • Is there a way to do it (as title)? I've tried following some tutorials, but the created image seems corrupt. I would like to automatically save the snapshot in a custom folder like desktop/folder

  • I can confirm that the next NW 0.13 will most probably fix the jank, because i had the jank in Chrome 41, and they disappeared on Chrome 43, NW 0.13 is based on Chrome 43! Moreover, NW 0.13 alpha3 is already there, but i can't manage to export/preview the game with it as there is a problem with package.zip file. Hope the full version will solve this issue.

    We made this with C2, and are selling on Steam:

    Subscribe to Construct videos now

    Lego are a toy, but you can create awesome things with them, same with C2. You don't "feel" it is a professional tool, that's your prospective, but feelings dont speak: results speak.

  • I export my game in NW.js for Steam. I need a way to automatically save a snapshot to a specific folder (Desktop/DinoSystem or Documents/DinoSystem).

    I succesfully did something similiar with save dialog using js:

    "var fs = require('fs');fs['writeFileSync']('" &replace(NodeWebkit.ChosenPath,"\","\\")& "','" &CanvasSnapshot& "'.split(',')[1], {'encoding': 'base64'});"

    But now i need it to automatically save the screen in the aforementioned folder! Any hint?

  • Thank you all for the comments. I'm a bit emotional sometimes, but when i look back i see that i was giving too much importance to something that doesn't deserve it, either because he's a troll or lame... what really matters is being productive, creative and delivering as scheduled.

  • The comment felt a bit sarcastic.

    In general I'd recommend not to get too offended by negative comments whether they be on youtube or twitter etc. Either someone will leave constructive negative criticism, which you should take in stride when you are tweaking your game, or someone is just looking to get a rise out of you, in which case you should grow thicker skin!

    Definitely... but you know, i need to practice my written english (for the spoken one i've lost all my hopes )