dop2000's Forum Posts

  • If you want to save file with NWjs, better not use "Invoke download". Use NWjs-> Show Save dialog. On Save dialog OK -> NWjs Write File, put NWjs.ChosenPath in path field.

    To read a file: NWjs Show open dialog, On open dialog OK - AJAX request URL, put NWjs.ChosenPath in URL field.

  • random(0) is 0, so I'm guessing your event spawns 5 gems all in the same position.

  • See my edited comment above.

  • So the character moves correctly and mirrors, but animations are not playing? Could you re-upload the changed file? In the previous version it couldn't even move properly with the touchpad.

    EDIT: Actually, no need. The problem is that your two groups (Player Movement and TouchPad) are clashing. When no keys are pressed, your events 21-28 reset animation to "Idle" on every tick.

    Since you have more than one way to control the character, the best solution would be creating a separate group that will manage animations, not based on control method, but based on 8direction moving angle.

    Something like this:

  • Like this:

    Because angles in Construct can take negative and positive numbers, it's tricky to compare them. It's much easier to use specific conditions and expressions - "between angles" instead of "between values", "is clockwise from" instead of "is greater", anglelerp() instead of lerp() and so on.

  • It's hard to make sense of your code without seeing the project file and the structure of txt file with questions.

    If you need a randomized array, you can initially set array width to 0. Then read a new question from AJAX and insert it at index int(random(array.width+1))

    Or you can load all questions into the array at Y=1, put random values into Y=0 and then use "array sort".

    Or load all questions into temp array, then pick a random element, push it into another array and remove from the temp array. Repeat until all questions are transferred.

  • In real world or in a game?

  • You need to change the loop to "For each X element". This will not fix the problem (if there is any), but it's more efficient.

    You're monitoring only one fixed array element with browser log - CraftingTable.At(1,2). Try changing this to CraftingTable.At(CraftingTable.CurX,2)

    Also, have you tried Debug Mode? You'll be able to see the entire array.

  • R0J0hound Thanks! That was actually my second question - how do you chain two curves, or make a curve from 4 or more points?

    I tried drawing a second curve from where the first stopped, but it obviously didn't work that well.

  • Use System condition "Is between angles" instead of "Compare instance variable" in your TouchPad group in events 121-142.

    Also, in event 121 you have a mistake, the range should be -22.5 to 22.5

  • It does work:

    dropbox.com/s/ml7mf2upjz5vy5d/PinPlusDemo.capx

    You can do the same with events, of course. It's just easier with the behavior if you want to "pin" many different properties.

  • R0J0hound Your method works great, as usual. :)

    The only small correction - "set t to loopindex/9"

  • There is also Pin+ addon, which allows you to pin to image point, takes care of mirroring, scaling etc.

  • In sprite font you can get the size of each character, space width, line height etc. This allows you to calculate position of any words in the text, but in a big multi-line text with word wrapping it may not be a very easy task.

    How do you currently scroll the text? Do you have a really tall text object and scroll the entire layout?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your question is too general. You might need to use instance variables, "For each" loops, Timer behavior etc.

    Search for "AI" in the Tutorials section, there are lots of examples there:

    scirra.com/tutorials/all