Mylon's Forum Posts

  • I ask because it was a pain in the butt just making a scrollable window.

    I ended creating 2 layers dedicated to the window and using the Blend Mode of "source atop" so that the list is only drawn when over the inner window. All of the items in the menu are pinned to a sprite that is moved based on the position of the scroll widget. Took me a long while to get the implementation right and clearly there are still some flaws with my method:

    It really feels like Construct 2 needs better GUI support for games that want to display large amounts of information.

  • Wow, this is a very impressive project. I tried to make a similar project (isometric tower defense with RPG elements) but I ran into a lot of roadblocks like managing scrolling windows, keeping focus on the mouse so under-window elements aren't clicked, etc. I'm curious as to how you tackled these issues.

  • I reversed the order of the events and that seems to give me the desired result. Thanks for your help.

  • My current project involves a lot of manipulation of arrays. Say I want to increment an array, I need to do:

    X: currx

    y: curry

    set value: array.at(currx,curry) + 1

    I would like to be able to do += 1 or -= 1 or *= 0.99 or similar operations to help simplify my code and reduce the chance of errors. When currx and curry themselves are the values of an array stuff can get very messy and I may accidentally use the wrong currx and curry.

  • We need better methods for controlling loops.

    "Stop loop" doesn't exactly behave as expected. We need "break" to end the loop and stop any other events within that loop from firing. We also need "next" which stops further events from firing and goes back to the start of the loop.

  • I have a function that keeps getting called even though it shouldn't. I thought, "end loop" would end the loop but events are still firing.

    Here's the function in question:

    The event on the bottom still fires and I see the text "We shouldn't be here". The loop isn't being stopped before that bit of code executes.

    This loop itself shouldn't even be firing because of the other loop I'm using ends up calling this function. That function:

    For some reason both tool > 0 fires and tool < 0 fires. I suspect this is a picking issue.

  • So how do I check the instance variable without changing the picked object?

    Edit: I replaced it with compare to variables "Variable = 1" and it seems to work.

  • Problem Description

    Or Block does not always function as expected

    Attach a Capx

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

    Description of Capx

    In this demo, an or block checks conditions based on a global variable and an object instance variable. While one of the conditions of an or block is true, the event does not fire. If the second condition is true, the block will fire, but the first condition seems ignored.

    Steps to Reproduce Bug

    • Create an object (tested this with sprite in a group and Text object)
    • Assign a variable to that object
    • Create a global variable
    • Make an or block testing the global variable and the object's variable.
    • Set the global variable check to be true and the object's variable to be false.
    • Run the project and observe that the event does not fire.

    Observed Result

    Event does not fire.

    Expected Result

    Event should fire.

    Affected Browsers

    • Chrome: YES
    • FireFox: UNTESTED
    • Internet Explorer: YES

    Operating System and Service Pack

    Win7 SP1

    Construct 2 Version ID

    v206

    Related thread

    viewtopic.php?t=151494

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Looks like I got it. In my example, "Is Variable 1 < 1" is true yet the block doesn't fire.

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

  • Here was my attempt to recreate it: http://i.imgur.com/q3GnHgO.png

    So long as either condition of the or block was true, the text would change. If I could recreate this bug, I would submit an official report.

  • I'm running into this very strange bug. I have an or block with two conditions. With both conditions, it doesn't fire. If I disable a condition, then it does fire properly. I don't understand what's going on and I wasn't able to recreate it using similar objects in a minimalized project for a proper bug report.

    Here's the relevant block highlighted: http://i.imgur.com/NfjMJSJ.png

    With the second condition disabled and when (pop < poplimit) is true, it fires properly. The or block is to allow repositioning already counted units. The Heroes instanced is picked via the drag/drop action earlier in the block. With both sections of the or block enabled, I can reposition active units (pop < poplimit is false, but Active is true) but trying to add new units fails (poplimit < poplimit is true, but Active is false). Yet, despite the highlighted block not firing, neither does the over pop limit block and the unit ends up staying where it was dropped instead of either snapping to the grid (as expected) or being moved to the unit list (the fallback). I think there's a picking issue going on.

  • I think the touch object covers click/doubleclick just fine. I haven't had any success getting the "on dragging" condition to not trigger during a click with slight mouse movement so hopefully your project file provides good insight. But! You're using v210 and I only have v206.

  • I'm making a strategy RPG and UI/mouse is going to be a big part of my project. I need to be able to differentiate between a click, a click+drag, and a double-click. Unfortunately, starting the drag still counts as a click and any slight mouse movement during the click-release counts as a drag.

    I tried using "on any click set mousestartx , mousestarty to mouse.absolutex,mouse.absolutey" on one event with another for "while dragging" + "if 30 <= distance(mousestart,mouseend)" to prevent clicks from starting the drag event but it seems this condition is only checked once and then ignored because it's not true when it started.

    I can probably edit the javascript on publication to change the mouse-click to mouse-release. But I still need to prevent the drag behavior from firing too easily.

  • Is "On Browser Close" a feature added betwee 206 and 210? I don't see it on 206.

  • Problem Description

    Trying to mix progress bars and a custom mouse cursor can result in the mouse cursor changing when hovering over the progress bar, leading to a potentially disruptive experience.

    On IE 11, the event seems to fail entirely and there is no custom mouse cursor.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/552 ... gDemo.capx

    Description of Capx

    CapX uses a mouse with a cursor from sprite and contains a progress bar for the user to mouseover.

    Steps to Reproduce Bug

    • Set the mouse cursor to a sprite
    • Add a progress bar
    • Run the project via preview
    • Move the custom mouse cursor over the progress bar.

    Observed Result

    Mouse cursor reverts to windows mouse cursor while over the progress bar.

    IE 11: No custom mouse cursor happens at all.

    Expected Result

    Mouse cursor retains the sprite while over the progress bar.

    IE 11: Mouse cursor takes on the sprite's appearance.

    Affected Browsers

    • Chrome: YES
    • FireFox: UNTESTED
    • Internet Explorer 11: YES

    Operating System and Service Pack

    Win 7 SP1

    Construct 2 Version ID

    206