narFsnw's Recent Forum Activity

  • Whaaaaat?!!!! :O

    I've been using Construct 2 since 2013 and only today do I learn that I can pick an object through expression using their IID!!!!

    This is so powerful!

    • set variable parentID to critter.IID
    • create object critter
    • set critter's speed to critter(parentID).speed

    mind explode...

  • I'm making a simulator where creatures can mutate and evolve over time. When the parent makes a baby, I want to copy the parent's variables (movement speed, jump force, size, etc) to the child, but with some mutation.

    Basically, I want to do something like that:

    • Set child's speed to parent.speed*random(-0.1, 0.1)
    • Set child's jumpForce to parent.jumpForce*random(-0.1, 0.1)
    • etc....

    But obviously, because of the way construct picks objects, either I pick only the child and I can't "see" the parent's variables, or I pick both the parent and the child, but I will then affect the instance variables of both, which I don't want.

    Possible solution I can think of:

    • I create a local variable for each instance variable, copy the parent's variables to these local vars, then pick the child and copy the local vars to the child's var
    • Create an array and do the same thing as ↑
    • I create a family called "parent" and use that to talk to the parent (as the family) and the child (as the object itself) at the same time

    Is there other easier ways that I can't think of?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm afraid you might need complicated things.

    I would suggest you start looking into the Local Storage object type. It might work for what you're trying to do.

    I think you'll have to name your project ID with the exact same name for it to work.

    imgur.com/FWRulBo

    Someone with better knowledge of how Local Storage works should confirm what I'm saying.

  • I'm guessing the sprint "teleports" and isn't smooth because you increment or decrease the amplitude instantly. If you want it to be smooth, you need to increment the amplitude gradually over time.

    One way to do this would be the following:

    Add an instance variable to camel called: myAmplitude

    • - When camel is touched and is not bujasie:
    • --- Set camel's myAmplitude to 55
    • --- Wait 3 seconds
    • --- Set camel's myAmplitude to 30
    • - Every tick:
    • --- Set camel's sine amplitude to : lerp(camel.sine.amplitude, camel.myAmplitude, 0.1)

    The trick here is the use of lerp(). I encourage you to look on this forum for example of magic lerp can do!

    (Note: I don't know what "bujasie" means so apologize if I misunderstood the whole problem.)

  • Ashley

    I have a config file that is sitting next to the app. Users need to be able to reach and open that file to configure the app. Then the app automatically look for that file and reads it.

    So, in the folder, there's:

    * bot.app

    * config.json

    I could, of course, put the config elsewhere, like in the user folder, but the user folder on mac is hidden by default, making it difficult for users to find it for edit.

    If I use NWjs.AppFolder as is, it will search for the config file deep inside the .app, making it super hard for users to find it. Also, I think it's against Apple's Mac Appstore regulation for an app to edit stuff within itself, or the ask the user to do it.

    Another workaround could be to ask the user, at launch, to locate the config file using the file explorer action, but my app is meant to be fully automated : launch, do it's thing and close without user input. So I can't do that either.

    I hope this explanation helps you understand better.

  • Found a workaround.

    First, create a variable "workpath".

    Then detect the platform. If windows, set workpath to nwjs.appfolder as usual. But if on Mac, then append a bunch of "../../../../" to bring you back to the correct folder.

  • Problem Description

    When using the expression NWjs.AppFolder, if the game runs on Mac, the path will be pointing to a folder very deep inside the .app folder.

    I would be expecting it to point instead to the parent folder of my .app, so that it remains consistant with Windows.

    Attach a Capx

    https://www.dropbox.com/s/2ri5fb6q8l06s ... .capx?dl=0

    Description of Capx

    It simply displays the path from NWjs.AppFolder

    Steps to Reproduce Bug

    • Open the attached appfolder.capx
    • Export it using NW (Note: Do not try to launch it in the editor, that won't show the bug)
    • Navigate to the exported folder > osx64
    • Launch newproject.app
    • Observe the paths displayed

    Observed Result

    The path displayed (NWjs.AppFolder) is located deep within the app package.

    Example: /Users/me/Downloads/osx64/newproject.app/Contents/Versions/53.0.2785.89/nwjs Helper.app/Contents/MacOS/

    Screenshot:

    Expected Result

    NWjs.AppFolder path points to the parent folder where the .app is located. That would be the same behavior as on Windows.

    Example: /Users/me/Downloads/osx64/

    Affected Browsers

    • Chrome: no
    • FireFox: no
    • Internet Explorer: no
    • NW.js : Yes
    • Windows : no
    • Mac: yes

    Operating System and Service Pack

    Mac OSX El Capitan 10.11.6

    Construct 2 Version ID

    r252

  • I was able to find a working solution in this post:

    https://goo.gl/ouPuXx

    I has an attached .capx that work.

    And just in case the attached capx ever disappear, here's a screenshot of it:

    https://i.imgur.com/1rgt8qJ.png

    (Notice that I disabled a line: it produced an extra unused file for no reason)

  • Hi all

    I have a NW.js project and I'd like it to be able to save screenshots. However, the current method (using "request download") causes the app to ask the user where to save the file. My app would require that it saves without any prompt, so that no user intervention is required.

    I found this tutorial, which sounded promising, but the result is a corrupted image.

    https://www.scirra.com/tutorials/1087/u ... top-builds

    Do you know why this tutoriel didn't work and how to fix it? Do you know other alternatives?

  • WOW!!!

    Thank you soooo much and R0J0hound

    I was about to code my own weighted RNG from scratch. You two just saved me a lot of hours!!!

    +1

    Thumbs Up!

    Like!

    Vote Up!

  • Here's my submission:

    http://www.newgrounds.com/portal/view/694086

    It's a tiny RPG with Peggle mechanics. Hope you like it!

  • So far, I managed to fix the issue by not checking any optimization feature in the Html5 Exporter. I'll update later to see which one is particular is causing the issue...

narFsnw's avatar

narFsnw

Member since 20 Oct, 2013

None one is following narFsnw yet!

Connect with narFsnw

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies