dop2000's Forum Posts

  • roguelike2018 Please don't use Google Translate! Lots of your contributions are unusable. For example google translated "tween" as "подросток" ("teen" or "young boy"), and you didn't even bother to change it!

  • 1. Try opening script url from the browser like this:

    http://yourserver.com/savescores.php?name=john&score=999
    

    Try both http and https.

    See if there are any errors on the screen or in browser console. Check if the record was added to the database.

    2. Check permissions on the file savescores.php

    3. Try connecting to the database via phpMyAdmin with the same credentials as in the php scripts, and "manually" inserting one record into the table as described here:

    construct.net/en/tutorials/creating-own-leaderboard-1032/page-2

  • I doubt the syntax has changed, the problem is most likely with something like permissions. Maybe this user doesn't have write permission for this table.

    There is another zip attached to the tutorial - php7.zip, have you tried it? It's using different functions to connect and write to the database - mysqli_connect and mysqli_query. (notice the letter "i"). Maybe they will work?

  • 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.