dop2000's Recent Forum Activity

  • Use Timer behavior instead of "Every X seconds".

  • You can not modify project files from runtime. You need to read the file on the first run, change or add new books and save the data to Local Storage for example. Next time, if Local Storage item exists, get it from Local Storage instead of the project file.

    But of course, this method will only work for one user. If you want to add books for all users, you need some kind of online database.

  • Loading using Browser object: (maybe I should try convert it to NWJS

    It's already done with NWJS, where do you see any browser actions?

    NWJS.ChosenPath = If I got this right: actually telling the NWJS object to use the Chosen Path to Saved the file (that stored in the SaveStateJSON)

    ChosenPath is the chosen path to some file, nothing else. It has nothing to do with SaveStateJSON yet. Even the file itself may not exist, it's just a string containing a path, like "C:\Temp\MyFile.alon"

    And then you can write something to this path, and the file MyFile.alon will be created and contain whatever you've written into it.

  • Have you tried opening the file with Notepad? Didn't it appear strange to you that the file size is 0 bytes?

    .

    Looks like SaveStateJSON is only valid for one tick, after that it's reset. So you need to change the order of events - when button is clicked, first show "Save as" dialog, then on dialog OK save the game, on save complete write the file.

  • I can keep explaining this but you won't understand since you're a programmer and these things are obvious to you

    But you do see how ChosenPath and Path both have the word "Path" in them? It's not some sacred programming knowledge, just a very basic observation :)

    What you have on your last screenshot looks correct.

    What errors are you getting? Is the file created? If you open it with Notepad, does it contain JSON data (bunch of brackets, tags and numbers)?

  • FYI, there is raycast addon:

    construct.net/en/forum/extending-construct-2/work-in-progress-addons-30/plugin-jcwtrace-raycast-112436

    Also, in Construct 3 you can cast rays with Line of Sight behavior.

  • You are right, it's weird that with Sine or any other behavior, even when the platform is moving fast, the character stays on the ground. While with Tween it's constantly jumping/falling.

    I made a small demo project:

    dropbox.com/s/ayri8cqeglg79ek/TweenPlatformBug.c3p

    I suggest you log a bug report.

  • split("\n") works the same way as tokencount(text,newline)

    It searches for new line character, which is not there. If you break the text into multiple lines manually (by pressing Enter), then you will be able count the number of lines with those functions.

  • Again, you don't need to be a programmer to figure out that ChosenPath expression should go into Path field, not into the Contents field!

    I give up....

    Path: NWJS.ChosenPath

    Contents: SaveStateJSON

    No quotes!

    Here is how everything works, in plain English:

    1. 1. You save the game
    2. 2. On save complete event you have SaveStateJSON expression which contains game data. You need to save it to a disk file.
    3. 3. You display "Save as" dialog
    4. 4. After user selected a file, you now have file name in NWJS.ChosenPath expression
    5. 5. Finally you have everything to write your data (SaveStateJSON) into the file (NWJS.ChosenPath)
  • You've almost figured everything out yourself.

    Move "Show save dialog" to event 240, and remove "Wait for previous action to complete".

    Now look at the "Write text" action. You need to write saved data SaveStateJSON into the file with filename NWJS.ChoosenPath

    What you are currently doing is you are writing chosen path into the file named "mysave". Why?

    It looks like you are trying different random things in hope that one of them will work, instead of taking a moment to read. I mean it's right there - Path, Contents. You don't need to be a programmer to know what path and contents is.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you really read the documentation? Because it explains everything.

    The result of Save dialog is the file name only, which will be in ChosenPath expression. Then you need to write to this file.

  • Yes, you need to publish, otherwise these expressions point to the directory where NWJS is installed.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies