dop2000's Recent Forum Activity

  • 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)
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

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

  • If you want to continue showing "SAVING PROJECT FILE" message while the "Save as" dialog is on the screen, you have no other option but to switch from using "Browser invoke download" to "NWJS Show Save Dialog", and then "NWJS Write text file".

    You can find how to use it in the official documentation, or search the forum for tutorials, examples. It's not difficult.

    But I would just forget about it, and leave it as it is - invoke download and immediately unlock the UI in the same event.

    .

    By the way, you should send the message to be shown in Text_Panel_CPU_Is_Busy in function parameter, and set text inside the function.

  • You don't really need to continue blocking UI when saving files. There will be a modal "Save as" dialog open, which will prevent users from doing anything else. So I think you can remove event 229, and in event 234 remove "wait for previous event to complete"

    .

    You can use NWJS actions and events to save files, if you want more control. You can find answers to your questions in the official documentation :)

    .

    Also, by TextBox I meant Text Input object.

  • "On saved dialog cancelled" may be triggered after "NWJS Show Save dialog" action. You are using "Browser invoke download" to save files, that's why it's not triggered.

    Boolean flag is needed for checks in your various events.

    If you add any opaque layer or background above everything in your project, it will not block mouse clicks, they will still go through to objects underneath. You need to use TextBox (or another Form Control object), only they block mouse events.

  • Tokencount(text,newline) counts the number of line breaks, it will not work here.

    I don't think it's possible to correctly count the number of lines in text object. You can use Text.TextHeight property to get the text height in pixels. And then divide this number by an average height of each line, say 30px. You'll get an estimate number of lines which may not be very accurate if you have a lot of text. Also, different browsers render the text slightly differently, so the results may vary.

    With SpriteFont you can calculate line height and the number of lines precisely.

  • If you need rigid connections, you have to make triangles. For example:

    Red lines represent joints.

    And of course you should try to minimize the number of objects with joints.

    Maybe build the line with just a few big sections using long invisible sprites with Physics. And draw a smooth visible line with small visible dots, pinned to Physics sprites.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 271 followers

Connect with dop2000

Trophy Case

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

29/44
How to earn trophies