Estecka's Forum Posts

  • Problem Description

    Picking two events modifying one variable, the changes from the first to come will be carried after the second is executed. The changes from the second to come will not be kept outside of its own scope.

    Attach a Capx

    sta.sh/010tefj7gcwj

    Description of Capx

    Spite haz boolean.

    When boolean True, sprite destroyed.

    Two times in the project, the boolean value is changed:

    • A first time with no condition: the boolean is set to false.
    • A second time, on click, it is set to True.

    Afterward, the boolean is checked, and the sprite i or isn't destroyed.

    Since the boolean is set to True AFTER being set to False, it should still be considered True afterward by the following events.

    It is not.

    Steps to Reproduce Bug

    • Disable Event 1 and run the project. On click, sprite is destroyed.
    • Enable Event 1 and rerun the project. The sprite won't be destroyed anymore.
    • Make Event 3 a subevent of Event 2. The sprite will be destroyed again

    Observed Result

    The action of Event 1 will be carried after Event 2, despite Event 2 supposedly cancelling it.

    Expected Result

    Event 2 overwrites Event 1 's changes once and for all.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)

    Operating System and Service Pack

    Windows 8.1 / windows 7

    Construct 2 Version ID

    r221

  • "Usually" set to global ?

    Ho, thank, I never noticed that little subtlelty in objects being able to be global or not. In my case that's fixing my problem.

    Now you say "global" though, there's one thing still poking my mind: how comes we have an action to reset global variables but not global objects ?

  • I noticed that upon restarting a layout, the instance variables of a dictionnary wouldn't be reset to their original values.

    I've tried making a capx from scratch, triggering every reset action I found on a keypress (persisted object, layout and global variable), but the changes made to the dictionnary's variable would survive everything...

    Did I miss something ?

  • What I'd suggest you:

    • Create a global variable, a number, and name it "SelectedChara" or whatever you fancy.
    • In the event "On E pressed", add the action: "Set SelectedChara to Gorilla.UID"

    UID is the Unique ID of the object. Here "SelectedChara" will remember which instance you intend to use.

    • On every event where you tell the gorillas what to do, add the condition: "Pick gorilla with UID: SelectedChara"

    thus only the gorilla withe previously selected UID will be affected by these actions.

    Hope it helps.

  • postimg.org/image/5429xt4l9/

    On this one I can see that pressing E brings out the menu, but is that all it does ? Is there anything inside this event that tells the overlapped gorilla that it is the "chosen one" ?

    I see nothing in your code that sorts the controlled gorilla apart from the others.

  • There is only 1 explanation: If x=z and b, or IF x=c, but used with an "or" and an "and" block. How can this be interpreted differently?

    Well again, I could as well interpret it as IF x=z, and IF x=b or x=c.

    Unless there is a programming rule I don't know that tells which operations must be performed first? (Like in math with multiplications and additions?)

    LittleStain - Local variables are indeed shown only when they are within their scope but what I am trying to tell you that all the other global variables are shown there too, besides the local variables. That does not help as the list is getting longer.

    If you absolutely need this many global variables, one thing you could consider is turning some of them to instance variables.

    As an example, when I needed to manage the "hive mind" of certains AIs, many of the "global" variable I used for them were in fact instances variables of a single dictionary named Hive. These still work the same way as global variables except they don't appear under the system's list.

  • What I would like:

    IF x=z

    and

    IF x=b

    or

    IF x=c

    Well you can't simply mix "or" and "and" inside a single event, because there's actually two way to interpret this:

    • "A and (B-or-C)"
    • "(A-and-B) or C",

    If you're looking for the first one, simply put one part into an event, and the second part into a sub-event like this :

    --> If A

    _____ --> If B

    ___________-or-

    ___________C

    If you're looking for the second one, it's gonna be a little more tricky indeed. And local variable seems like the best way to work around that indeed:

  • R0J0hound Nice one.

    I could refine the Capx even more by completely removing red, replacing the loop with "for each blue"

    Also, the loop doesn't have to be a "for each" at all. A "repeat 1 time" also works.

    I've rewritten my first post with what you've found. Attaching your capx and one I believe is better for understanding.

    Notably I readded an action that turns the picked Blue sideway: we can see that Blue-1 is never actually picked by the loop despite being used in its subevents.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I only ever managed to reproduce it using text variables before, I appeared to be half wrong there.

    Comparing Number or Boolean Instance variables still disable the bug, but apparently coordinates also enable it.

    There might be more to add to the list, I should try using different kinds of events, and see which ones enable or disable the bug.

    I know already that comparing opacity, Dimensions and Animation also enables the bug.

  • Though I have a workaround for myself and don't need help on it, I'd like to know whether this was confirmed as a bug.

  • Problem Description

    Having certain events enabled in the code even if no actions are triggered by these events, changes the way other events behave, may they be in completely event sheet.

    If a "pick with UID" is in the same event as a loop, it doesn't always pass the right UID to all of its subevent.

    Attach a Capx

    Compact : sta.sh/025e3kk223cf (as little code as possible)

    Expansive : sta.sh/0n24fz9hycm (more mechanics of the bug explained inside)

    Description of Capx

    There are two Blue sprites, with UID 0 and 1

    A loop picks Blue-0 everytime it repeats, and make it transparent when certain conditions are met.

    Blue-1 is ignored by this loop, and does nothing.

    Steps to Reproduce Bug

    • Start "or-bug.compact.capx", drag and drop the two Blues around the place
    • -> Blue-0 becomes transparent when placed outside of the lower-right quadrant of the layout
    • -> Blue-1 stays opaque no matter what. ----
    • Enable Event 2, and restart the project.
    • -> Blue-1 now becomes transparent when placed in the top half of the layout. It shouldn't. ----
    • Change the order of the conditions in Event 4
    • -> Blue-1 now becomes transparent when placed int the Left half of the layout. Expected Result ? Event 4 is the subevent of "Pick Blue with UID 0", it should only ever affect this instance of Blue Observed Result ? When the bug is enabled, if the first condition of Event 4 is true, it may affect other instance of Blue than the picked one. ? Event 4 is affected by this bug because :
      • Its mother-event "Pick with UID" is also a loop.
      • It is an -or- block
      ? To Enable the bug, you also need Event 2, which one :
      • Is placed before the loop
      • Is a subevent
      • Is an -or- block
      • Has at least one condition enabled, which compare one of the following properties in Blue :
      X, Y, Eight, Width, TextVariable, Animation, any form of Pick
      • Has no condition enabled that would compare anything but one of these properties.
      Affected Browsers
      • Chrome: (YES)
      • FireFox: (Not Installed)
      • Internet Explorer: (Not installed)

    Operating System and Service Pack

    Windows 8.1

    Construct 2 Version ID

    r216 & r219