CannedEssence's Forum Posts

  • naelian

    Darn you, I was going for a record number of views with no replies! lol

  • Trevor10 jbadams

    I think jbadams is just misunderstanding the OP.

    Yes, every programming language (to my knowledge) allows multiple "return points", heck there wouldn't be much of a reason for one to execute "early" if that weren't the case.

    However, no programming language continues executing statements within a function past the return statement (but Construct 2 does, *ahem...).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In all programming languages to my knowledge, a return statement stops the function and returns the value to the caller.

    In Construct 2, setting a return value does not stop the function. If this was intended behavior, arguing that it makes more sense to beginners, then offer an option in an action like "Stop Function" or something.

    I feel like I have to vouch for all programming languages trying to explain why this is beneficial. For brevity, it allows for [at times far] more optimized code and it prevents tricky logic situations that would otherwise muddle code with needless variables and events.

  • Ashley

    Thank you for acknowledging the submitted report.

    However, I do still believe that this is a general System pick objects OR block bug, and not just specific to the System overlapping point condition.

    Take these events for example:

    <img src="http://cannedessence.com/construct2screens/SystemOrBlockBug.png" border="0" />

    The first event works as expected, picking Sprite with UID 0, but the second event does not work.

    I probably should have given these other examples in the original report to be more clear about the claimed issue.

    Thanks!

  • Closes fine in Windows 8 Professional and Windows 8 Enterprise.

    I think Scirra uses Windows 8, so maybe it's a Windows 7 thing.

  • Link to .capx file (required!):

    iu.box.com/s/dxkwpmokj7fiz163lgen

    Steps to reproduce:

    1. Create any Object: Pick condition (for example, Sprite: Is on-screen, or Sprite: X > 0)

    2. Nest within the above event an OR block that picks the same kind of object that the parent condition picks (for example, Sprite: Y > 300).

    3. Make some kind of action that verifies that picking was correct.

    Observed result:

    When a nested condition triggers, it picks whatever the parent picks, regardless of the nested condition that fires.

    Expected result:

    The nested condition picks the objects, narrowing down what the parent picks.

    More info:

    For those of you who can't go into the simple CAPX file provided, here's a quick screenshot of the issue:

    <img src="http://cannedessence.com/construct2screens/orBlockBug.png" border="0" />

    There are three root-level events, two of which are disabled. The two that are disabled work as expected, but the one that is not disabled is where the bug lies.

    In the first root-level event, all Sprites on-screen should be picked, then only the ones that are less than 200 or greater than 400 should be picked. However, all of the Sprites on-screen are picked, as can be verified by the Debug text object.

    The second root-level event is exactly the same as the first, except that it isn't nested within the arbitrary Sprite: is on-screen event, but for some reason it works as expected.

    The third root-level event is exactly the same as the first, except that the parent event does System: Pick all Sprite instead of functionally the same condition in this case Sprite: Is on-screen. This one works as expected.

    What truly verifies this as an OR block bug is that if you delete one of the conditions in the OR in the broken 1st root-level event, thus ridding the OR block, it works as expected.

    Most revealing is that strangely, if you disable one of the OR block conditions, thus effectively nullifying the OR block, it is still broken.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 8 Pro 64-bit

    Construct 2 version:

    r139

  • I'm not of much help, but seeing that this post has almost 500 views but no comments impelled me to post something.

    Looking at the JS error, and then going to line 1117 of data.js, that line references sprite19-default-000.png, which doesn't exist anywhere it seems.

    It's particularly suspicious that there are Sprite folders in the animations directory of your unzipped capx numbered through and past Sprite19, but not including Sprite19.

    An error occurs when you try and export the project.

    Seems like your project is corrupt in some way... Have you tried to rebuild the project by making a new one, making all the objects again, and pasting in the events?

  • Link to .capx file (required!):

    iu.box.com/s/erbqmp2jffivlzwrbu0y

    Steps to reproduce:

    1. Use any System pick object condition in an OR block.

    2. Place any other System pick condition picking the same objects in the same OR block after the 1st System pick condition. This should be one that will actually pick objects.

    3. Place an action that can be verified as a result of the event.

    As an example:

    <img src="http://cannedessence.com/Construct2Screens/OrBlockTest.png" border="0" />

    Observed result:

    If the first System pick object condition fails to pick any instances, then the OR fails, regardless of whether subsequent System pick object conditions would pick objects (of the same type).

    Expected result:

    The first System pick object condition to pick objects in an OR block should pick the objects for the SOL, regardless of whether one before it failed to pick any instances.

    This is the behavior for Object: condition conditions in an OR block, which is intuitive and expected.

    Using the example in the provided CAPX and image:

    Sprite: Overlapping Redpoint?

    OR

    Sprite: Overlapping Bluepoint?

    This will pick sprites overlapping Bluepoint, even if none overlap Redpoint.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 8 Professional 64-bit

    Construct 2 version:

    r139 (most recent stable)

  • I think I figured it out.

    It almost certainly is a bug.

    The problem is that OR blocks with the System object picking another object are functionally the same as AND blocks.

    If you do

    System: Pick Sprite by evaluating 0 //this is automatically false

    OR

    System: Pick Sprite where Sprite.UID = 0

    Then nothing is picked, even though there is a sprite with UID as 0. This shouldn't be the case.

    If you do

    System: 0 = 1

    OR

    System: Pick Sprite where Sprite.UID = 0

    Then it successfully picks the sprite whose UID is 0. This is working as it should.

    If you do

    System: Pick all Sprite

    OR

    System: Pick Sprite where Sprite.UID = 0

    it will select only the one sprite whose UID is 0. This is a design decision, but I consider it a poor one if it is intentional. It should pick all the instances of Sprite, because an OR block should stop evaluating the other conditions once it finds something that is true.

    The argument would be that for example System 0 = 0 OR System pick Sprite.UID = 0 will keep the full Sprite instance list. Even so, that IMO should be how Construct operates. They can handle the picking in a sub-event if a non-picking OR condition is true.

  • Okay okay, I'll post a project file example and image:

    CAPX: iu.box.com/s/erbqmp2jffivlzwrbu0y

    Screenshot from project:

    <img src="http://cannedessence.com/Construct2Screens/OrBlockTest.png" border="0" />

    The event fails to trigger, even though the blue point is overlapping the sprite. If you disable the redpoint check condition, then it works.

    If you insert a System Pick All Sprite condition in between the redpoint and bluepoint checks, then it works too.

    Is this intended behavior? If so, I disagree that it should be that way. I don't think that conditions that fail in an OR block should be picking objects.

  • UPDATE: Check the second post for project file and image of issue, and the fourth post for a description of the issue/potential bug.

    Hi, from my tests, I'm seeing that the OR block is picking objects even when one of the conditions in the OR fails.

    For instance,

    Tiger == Red

    OR

    Tiger == Green

    OR

    Tiger == Silver

    If the tiger is Silver, it won't trigger because it is picking the red tigers in the first condition, and when there are no red tigers (only silver tigers), then the SOL is empty because of the failed first condition.

    For reference, the actual condition I'm testing is the new System Pick overlapping condition, so maybe that's where the problem is.

    I've isolated the OR block as to where the problem is lying. If I separate out each condition into separate events, it works. It only fails in this OR block.

  • All too coincidental. I came to Scirra just now to search "check collision with point", and while I was typing that, it caught my eye that the most recent post in the General forum (seeing this from the main forum landing page) was in this thread.

    Ashley, you say that you've implemented it into r137, great! When is that due to be released? Wait, just checked the release page, and wow it looks like it's out. I'm gonna give it a shot!

  • Is there a way to store a position as a single data type?

    Since this is a 2D engine, I figured there'd be a native way to store a position in a single variable, in order to store a position, or to be able to store an array of positions.

    For example, in most 2D games, I'd expect there to be a struct or class called Position or Vector2 that simply has two numbers X and Y.

    For an editor like this, having a natural way to store positions global, local, or instance would be tremendously intuitive.

    Is there a best way to do this?

    Thanks

  • Thank you for the responses, that's nice to know.

    So you're saying that because of the graphics chip and VRAM on some devices, it might be faster to break the 1x1024 image down into a 32x32 image, where the gradient is arranged in a tabular way, i.e. to have the first 32 pixels from the top of the gradient as the first row, and so on; to then make the Sprite object, add the art as a spritestrip with 32 rows and columns;

    to then generate 1024 instances of this object, placing each next frame below the previous.

    Am I right?

  • California

    Yes, the 32x32 sprite sounds like it'd be faster, but a single 32x32 Sprite can't do everything a 1x1024 Sprite can. For instance, if you wanted to have a gradient that vertically spans the entire color wheel with 1024 different hues.