Negative "on-Screen" Not working

0 favourites
  • 8 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Link to .capx file (required!):

    Steps to reproduce:

    Just look at the events for mouse fire. According to the logic a bullet should fire when:

    1, The mouse button is held

    2, There isn't one on the screen already (inverted on-screen logic)

    But nothing fires.

    ramones came up with an alternate method using an "else" which works and I'm using for now, see:

    I suspect negative logic for "on-screen" isn't working as intended.

    Observed result:

    No bullets are fired.

    Expected result:

    Mouse fires bullets, only one can be on screen at a time, thus fire rate is quick for close targets, slow for far targets.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Operating system & service pack:

    Win7 64bit SP1

    Construct 2 version:

    119 64bit

  • The way the engine works, a condition is always false, regardless of the state of invert, if there are no instances of that object which exist. In other words an event will not run if no instances met the condition. I would prefer not to change this, because "is on-screen" or "is off-screen" simply makes no sense to ask if there are no instances that exist.

    Rather than change how the engine works, the workaround is simple: just replace 'is not onscreen' with 'Bullet.Count = 0', and destroy any bullets that are not onscreen.

    Closing as won't fix.

  • Thanks for the reply. :)

    I do understand you wouldn't want to make any engine changes for such a minor case. Have to make similar decisions myself all the time.

    If it will never return true / never do anything, would it be better to disallow us from setting it to inverted? Otherwise it gives the illusion that something is broken; it isn't doing what I tell it to do.

    Also just out of interest, could you not put in the very code you suggested as part of the negative check?

    NOT On-Screen

    Instance.count = 0?

    Return True


    On-screen = False?

         Return True



    Return False

  • Ashley This is a good decision to not confuse users. If invert on on-screen doesn't work, it shouldn't be doable at all.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Agreed with Dam, took me a solid 30 minutes to figure out that it just doesn't work, please take out the ability to invert 'Is on screen'.

  • Changing such basic engine logic would "kill" many existing projects.

  • Changing such basic engine logic would "kill" many existing projects.

    Not really, adding an invert option wouldn't kill anything since everyone uses Else anyway. It'd just give everyone the option, nothing would be 'killed'. You can use Else as an invert for anything, it's just a less efficient way. At least I think anyway.

    EDIT: I derped, forgot we were talking about taking OUT the invert option for on-screen. That wouldn't kill anything lmao, it'd get rid of a lot of confusion for sure! At least give us a prompt when inverting on-screen saying 'This ain't gonna work bud'

  • invert "on screen"... but then does it work or not ?? why can it be enabled if it does not work? Is there a reason?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)